|
|
5b2f0d |
From 1166883e5d7fcfc24ce24b5f5b158053c59be7a2 Mon Sep 17 00:00:00 2001
|
|
|
5b2f0d |
From: Matthias Clasen <mclasen@redhat.com>
|
|
|
5b2f0d |
Date: Thu, 27 Feb 2014 19:29:49 -0500
|
|
|
5b2f0d |
Subject: [PATCH] Fix creating new items
|
|
|
5b2f0d |
|
|
|
5b2f0d |
Just as for menus, the code to insert the new item in
|
|
|
5b2f0d |
the right place was dropped in refactoring.
|
|
|
5b2f0d |
Bring it back.
|
|
|
5b2f0d |
|
|
|
5b2f0d |
https://bugzilla.gnome.org/show_bug.cgi?id=725360
|
|
|
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 a0c884c..f52f216 100644
|
|
|
5b2f0d |
--- a/Alacarte/MainWindow.py
|
|
|
5b2f0d |
+++ b/Alacarte/MainWindow.py
|
|
|
5b2f0d |
@@ -261,11 +261,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.getUserItemPath(), util.getUniqueFileId('alacarte-made', '.desktop'))
|
|
|
5b2f0d |
+ file_name = util.getUniqueFileId('alacarte-made', '.desktop')
|
|
|
5b2f0d |
+ file_path = os.path.join(util.getUserItemPath(), file_name)
|
|
|
5b2f0d |
|
|
|
5b2f0d |
editor = LauncherEditor(self.main_window, file_path)
|
|
|
5b2f0d |
+ editor.file_name = file_name;
|
|
|
5b2f0d |
+ editor.parent = parent.get_menu_id()
|
|
|
5b2f0d |
+ editor.connect ('response', self.on_item_created)
|
|
|
5b2f0d |
editor.run()
|
|
|
5b2f0d |
|
|
|
5b2f0d |
+ def on_item_created(self, editor, response):
|
|
|
5b2f0d |
+ if response == True:
|
|
|
5b2f0d |
+ self.editor.insertExternalItem(editor.file_name, editor.parent)
|
|
|
5b2f0d |
+
|
|
|
5b2f0d |
def on_new_separator_button_clicked(self, button):
|
|
|
5b2f0d |
item_tree = self.tree.get_object('item_tree')
|
|
|
5b2f0d |
items, iter = item_tree.get_selection().get_selected()
|
|
|
5b2f0d |
--
|
|
|
5b2f0d |
1.9.0
|
|
|
5b2f0d |
|