1 |
tetromino 11/11/26 18:11:31 |
2 |
|
3 |
Added: alacarte-0.13.2-selection_browse.patch |
4 |
alacarte-0.13.2-settings_menu.patch |
5 |
Log: |
6 |
Add version with patches for gnome3 compatibility (bug #391989) from the gnome overlay; it's -r50 to provide some room in case the gnome2 version of alacarte will need to be revbumped in the future. |
7 |
|
8 |
(Portage version: 2.2.0_alpha77/cvs/Linux x86_64) |
9 |
|
10 |
Revision Changes Path |
11 |
1.1 x11-misc/alacarte/files/alacarte-0.13.2-selection_browse.patch |
12 |
|
13 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-misc/alacarte/files/alacarte-0.13.2-selection_browse.patch?rev=1.1&view=markup |
14 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-misc/alacarte/files/alacarte-0.13.2-selection_browse.patch?rev=1.1&content-type=text/plain |
15 |
|
16 |
Index: alacarte-0.13.2-selection_browse.patch |
17 |
=================================================================== |
18 |
From c3271e552b5071d5663a57a6f8d185258a47a704 Mon Sep 17 00:00:00 2001 |
19 |
From: Alexandre Rostovtsev <tetromino@×××××.com> |
20 |
Date: Sat, 6 Aug 2011 19:16:54 -0400 |
21 |
Subject: [PATCH] Use gtk.SELECTION_BROWSE mode for menu_tree (bgo 652454) |
22 |
|
23 |
Use gtk.SELECTION_BROWSE selection mode for menu_tree to ensure that |
24 |
one row is always selected and valid iters are returned from the |
25 |
selection's get_selected(). |
26 |
|
27 |
Addresses https://bugzilla.gnome.org/show_bug.cgi?id=652454 |
28 |
--- |
29 |
Alacarte/MainWindow.py | 1 + |
30 |
1 files changed, 1 insertions(+), 0 deletions(-) |
31 |
|
32 |
diff --git a/Alacarte/MainWindow.py b/Alacarte/MainWindow.py |
33 |
index 260efe5..c2b4780 100644 |
34 |
--- a/Alacarte/MainWindow.py |
35 |
+++ b/Alacarte/MainWindow.py |
36 |
@@ -174,6 +174,7 @@ class MainWindow: |
37 |
menus.append_column(column) |
38 |
menus.enable_model_drag_source(gtk.gdk.BUTTON1_MASK, self.dnd_menus, gtk.gdk.ACTION_COPY) |
39 |
menus.enable_model_drag_dest(self.dnd_both, gtk.gdk.ACTION_PRIVATE) |
40 |
+ menus.get_selection().set_mode(gtk.SELECTION_BROWSE) |
41 |
|
42 |
def setupItemTree(self): |
43 |
items = self.tree.get_object('item_tree') |
44 |
-- |
45 |
1.7.6 |
46 |
|
47 |
|
48 |
|
49 |
|
50 |
1.1 x11-misc/alacarte/files/alacarte-0.13.2-settings_menu.patch |
51 |
|
52 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-misc/alacarte/files/alacarte-0.13.2-settings_menu.patch?rev=1.1&view=markup |
53 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-misc/alacarte/files/alacarte-0.13.2-settings_menu.patch?rev=1.1&content-type=text/plain |
54 |
|
55 |
Index: alacarte-0.13.2-settings_menu.patch |
56 |
=================================================================== |
57 |
Index: alacarte-0.13.2/Alacarte/MainWindow.py |
58 |
=================================================================== |
59 |
--- alacarte-0.13.2.orig/Alacarte/MainWindow.py 2011-04-16 19:05:15.086723615 +0200 |
60 |
+++ alacarte-0.13.2/Alacarte/MainWindow.py 2011-04-16 19:05:19.482745099 +0200 |
61 |
@@ -72,7 +72,6 @@ class MainWindow: |
62 |
def run(self): |
63 |
self.loadMenus() |
64 |
self.editor.applications.tree.add_monitor(self.menuChanged, None) |
65 |
- self.editor.settings.tree.add_monitor(self.menuChanged, None) |
66 |
self.tree.get_object('mainwindow').show_all() |
67 |
gtk.main() |
68 |
|
69 |
Index: alacarte-0.13.2/Alacarte/MenuEditor.py |
70 |
=================================================================== |
71 |
--- alacarte-0.13.2.orig/Alacarte/MenuEditor.py 2011-04-16 19:05:39.102841022 +0200 |
72 |
+++ alacarte-0.13.2/Alacarte/MenuEditor.py 2011-04-16 19:07:26.783367453 +0200 |
73 |
@@ -48,22 +48,10 @@ class MenuEditor: |
74 |
self.applications.dom = xml.dom.minidom.parse(self.applications.path) |
75 |
self.__remove_whilespace_nodes(self.applications.dom) |
76 |
|
77 |
- self.settings = Menu() |
78 |
- self.settings.tree = gmenu.lookup_tree('settings.menu', gmenu.FLAGS_SHOW_EMPTY|gmenu.FLAGS_INCLUDE_EXCLUDED|gmenu.FLAGS_INCLUDE_NODISPLAY|gmenu.FLAGS_SHOW_ALL_SEPARATORS) |
79 |
- self.settings.visible_tree = gmenu.lookup_tree('settings.menu') |
80 |
- self.settings.tree.sort_key = gmenu.SORT_DISPLAY_NAME |
81 |
- self.settings.visible_tree.sort_key = gmenu.SORT_DISPLAY_NAME |
82 |
- self.settings.path = os.path.join(util.getUserMenuPath(), self.settings.tree.get_menu_file()) |
83 |
- if not os.path.isfile(self.settings.path): |
84 |
- self.settings.dom = xml.dom.minidom.parseString(util.getUserMenuXml(self.settings.tree)) |
85 |
- else: |
86 |
- self.settings.dom = xml.dom.minidom.parse(self.settings.path) |
87 |
- self.__remove_whilespace_nodes(self.settings.dom) |
88 |
- |
89 |
self.save(True) |
90 |
|
91 |
def save(self, from_loading=False): |
92 |
- for menu in ('applications', 'settings'): |
93 |
+ for menu in ('applications',): |
94 |
fd = open(getattr(self, menu).path, 'w') |
95 |
fd.write(re.sub("\n[\s]*([^\n<]*)\n[\s]*</", "\\1</", getattr(self, menu).dom.toprettyxml().replace('<?xml version="1.0" ?>\n', ''))) |
96 |
fd.close() |
97 |
@@ -85,7 +73,7 @@ class MenuEditor: |
98 |
os.unlink(file_path) |
99 |
|
100 |
def revert(self): |
101 |
- for name in ('applications', 'settings'): |
102 |
+ for name in ('applications',): |
103 |
menu = getattr(self, name) |
104 |
self.revertTree(menu.tree.root) |
105 |
path = os.path.join(util.getUserMenuPath(), menu.tree.get_menu_file()) |
106 |
@@ -126,7 +114,7 @@ class MenuEditor: |
107 |
os.unlink(file_path) |
108 |
redo.append(redo_path) |
109 |
#reload DOM to make changes stick |
110 |
- for name in ('applications', 'settings'): |
111 |
+ for name in ('applications',): |
112 |
menu = getattr(self, name) |
113 |
if not os.path.isfile(menu.path): |
114 |
menu.dom = xml.dom.minidom.parseString(util.getUserMenuXml(menu.tree)) |
115 |
@@ -150,7 +138,7 @@ class MenuEditor: |
116 |
os.unlink(file_path) |
117 |
undo.append(undo_path) |
118 |
#reload DOM to make changes stick |
119 |
- for name in ('applications', 'settings'): |
120 |
+ for name in ('applications',): |
121 |
menu = getattr(self, name) |
122 |
if not os.path.isfile(menu.path): |
123 |
menu.dom = xml.dom.minidom.parseString(util.getUserMenuXml(menu.tree)) |
124 |
@@ -162,7 +150,6 @@ class MenuEditor: |
125 |
def getMenus(self, parent=None): |
126 |
if parent == None: |
127 |
yield self.applications.tree.root |
128 |
- yield self.settings.tree.root |
129 |
else: |
130 |
for menu in parent.get_contents(): |
131 |
if menu.get_type() == gmenu.TYPE_DIRECTORY: |
132 |
@@ -429,31 +416,13 @@ class MenuEditor: |
133 |
self.__undo[-1].append(undo_path) |
134 |
|
135 |
def __getMenu(self, item): |
136 |
- root = item.get_parent() |
137 |
- if not root: |
138 |
- #already at the top |
139 |
- root = item |
140 |
- else: |
141 |
- while True: |
142 |
- if root.get_parent(): |
143 |
- root = root.get_parent() |
144 |
- else: |
145 |
- break |
146 |
- if root.menu_id == self.applications.tree.root.menu_id: |
147 |
- return self.applications |
148 |
- return self.settings |
149 |
+ return self.applications |
150 |
|
151 |
def __findMenu(self, menu_id, parent=None): |
152 |
if parent == None: |
153 |
- menu = self.__findMenu(menu_id, self.applications.tree.root) |
154 |
- if menu != None: |
155 |
- return menu |
156 |
- else: |
157 |
- return self.__findMenu(menu_id, self.settings.tree.root) |
158 |
+ return self.__findMenu(menu_id, self.applications.tree.root) |
159 |
if menu_id == self.applications.tree.root.menu_id: |
160 |
return self.applications.tree.root |
161 |
- if menu_id == self.settings.tree.root.menu_id: |
162 |
- return self.settings.tree.root |
163 |
for item in parent.get_contents(): |
164 |
if item.get_type() == gmenu.TYPE_DIRECTORY: |
165 |
if item.menu_id == menu_id: |
166 |
@@ -468,8 +437,6 @@ class MenuEditor: |
167 |
menu = self.__getMenu(item) |
168 |
if menu == self.applications: |
169 |
root = self.applications.visible_tree.root |
170 |
- elif menu == self.settings: |
171 |
- root = self.settings.visible_tree.root |
172 |
if item.get_type() == gmenu.TYPE_DIRECTORY: |
173 |
if self.__findMenu(item.menu_id, root) == None: |
174 |
return False |