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