|
|
5b2f0d |
From fd2c16c3929e57f5f2071ed3bc36f02c77930bab Mon Sep 17 00:00:00 2001
|
|
|
5b2f0d |
From: Matthias Clasen <mclasen@redhat.com>
|
|
|
5b2f0d |
Date: Wed, 26 Feb 2014 20:29:51 -0500
|
|
|
5b2f0d |
Subject: [PATCH] Fix creating new menus
|
|
|
5b2f0d |
|
|
|
5b2f0d |
We were still creating the .directory file, but some
|
|
|
5b2f0d |
refactoring dropped the code that inserted the menu
|
|
|
5b2f0d |
into the menu tree. Bring it back.
|
|
|
5b2f0d |
|
|
|
5b2f0d |
https://bugzilla.gnome.org/show_bug.cgi?id=725287
|
|
|
5b2f0d |
---
|
|
|
5b2f0d |
Alacarte/MainWindow.py | 10 +++++++++-
|
|
|
5b2f0d |
1 file changed, 9 insertions(+), 1 deletion(-)
|
|
|
5b2f0d |
|
|
|
5b2f0d |
diff --git a/Alacarte/MainWindow.py b/Alacarte/MainWindow.py
|
|
|
5b2f0d |
index aa36aaa..a0c884c 100644
|
|
|
5b2f0d |
--- a/Alacarte/MainWindow.py
|
|
|
5b2f0d |
+++ b/Alacarte/MainWindow.py
|
|
|
5b2f0d |
@@ -239,11 +239,19 @@ class MainWindow(object):
|
|
|
5b2f0d |
menu_tree.get_selection().select_path((0,))
|
|
|
5b2f0d |
else:
|
|
|
5b2f0d |
parent = menus[iter][2]
|
|
|
5b2f0d |
- file_path = os.path.join(util.getUserDirectoryPath(), util.getUniqueFileId('alacarte-made', '.directory'))
|
|
|
5b2f0d |
+ file_name = util.getUniqueFileId('alacarte-made', '.directory')
|
|
|
5b2f0d |
+ file_path = os.path.join(util.getUserDirectoryPath(), file_name)
|
|
|
5b2f0d |
|
|
|
5b2f0d |
editor = DirectoryEditor(self.main_window, file_path)
|
|
|
5b2f0d |
+ editor.file_name = file_name;
|
|
|
5b2f0d |
+ editor.parent = parent.get_menu_id()
|
|
|
5b2f0d |
+ editor.connect ('response', self.on_directory_created)
|
|
|
5b2f0d |
editor.run()
|
|
|
5b2f0d |
|
|
|
5b2f0d |
+ def on_directory_created(self, editor, response):
|
|
|
5b2f0d |
+ if response == True:
|
|
|
5b2f0d |
+ self.editor.insertExternalMenu(editor.file_name, editor.parent)
|
|
|
5b2f0d |
+
|
|
|
5b2f0d |
def on_new_item_button_clicked(self, button):
|
|
|
5b2f0d |
menu_tree = self.tree.get_object('menu_tree')
|
|
|
5b2f0d |
menus, iter = menu_tree.get_selection().get_selected()
|
|
|
5b2f0d |
--
|
|
|
5b2f0d |
1.9.0
|
|
|
5b2f0d |
|