[alacarte] Add properties and a delete button



commit 2c45f58234c0ab702518a434e10f8d4c8116831d
Author: Matt Jorde <majorde gmail com>
Date:   Tue Aug 23 20:58:10 2011 +0200

    Add properties and a delete button
    
    https://bugzilla.gnome.org/show_bug.cgi?id=518251

 Alacarte/MainWindow.py |   10 ++++++++++
 data/alacarte.ui       |   30 ++++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+), 0 deletions(-)
---
diff --git a/Alacarte/MainWindow.py b/Alacarte/MainWindow.py
index c9595dd..be7734d 100644
--- a/Alacarte/MainWindow.py
+++ b/Alacarte/MainWindow.py
@@ -412,6 +412,8 @@ class MainWindow:
 		self.tree.get_object('move_up_button').set_sensitive(False)
 		self.tree.get_object('move_down_button').set_sensitive(False)
 		self.tree.get_object('new_separator_button').set_sensitive(False)
+		self.tree.get_object('properties_button').set_sensitive(False)
+		self.tree.get_object('delete_button').set_sensitive(False)
 
 	def on_menu_tree_drag_data_get(self, treeview, context, selection, target_id, etime):
 		menus, iter = treeview.get_selection().get_selected()
@@ -463,14 +465,17 @@ class MainWindow:
 		item = items[iter][3]
 		self.tree.get_object('edit_delete').set_sensitive(True)
 		self.tree.get_object('new_separator_button').set_sensitive(True)
+		self.tree.get_object('delete_button').set_sensitive(True)
 		if self.editor.canRevert(item):
 			self.tree.get_object('edit_revert_to_original').set_sensitive(True)
 		else:
 			self.tree.get_object('edit_revert_to_original').set_sensitive(False)
 		if not item.get_type() == gmenu.TYPE_SEPARATOR:
 			self.tree.get_object('edit_properties').set_sensitive(True)
+			self.tree.get_object('properties_button').set_sensitive(True)
 		else:
 			self.tree.get_object('edit_properties').set_sensitive(False)
+			self.tree.get_object('properties_button').set_sensitive(False)
 
 		# If first item...
 		if items.get_path(iter).get_indices()[0] == 0:
@@ -652,6 +657,11 @@ class MainWindow:
 			pass
 		GObject.timeout_add(10, self.quit)
 
+	def on_properties_button_clicked(self, button):
+		self.on_edit_properties_activate(None)
+	def on_delete_button_clicked(self, button):
+		self.on_edit_delete_activate(None)
+
 	def on_style_set(self, *args):
 		self.loadUpdates()
 
diff --git a/data/alacarte.ui b/data/alacarte.ui
index aec923a..fd629b6 100644
--- a/data/alacarte.ui
+++ b/data/alacarte.ui
@@ -380,6 +380,36 @@
                                             <signal handler="on_move_down_button_clicked" last_modification_time="Wed, 26 Apr 2006 22:09:15 GMT" name="clicked"/>
                                           </object>
                                         </child>
+                                        <child>
+                                          <object class="GtkButton" id="delete_button">
+                                            <property name="label" translatable="no">gtk-delete</property>
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="receives_default">True</property>
+                                            <property name="use_stock">True</property>
+					    <signal handler="on_delete_button_clicked" name="clicked"/>
+                                          </object>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">False</property>
+                                            <property name="position">2</property>
+                                          </packing>
+					</child>
+                                        <child>
+                                          <object class="GtkButton" id="properties_button">
+                                            <property name="label" translatable="no">gtk-properties</property>
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="receives_default">True</property>
+                                            <property name="use_stock">True</property>
+					    <signal handler="on_properties_button_clicked" name="clicked"/>
+                                          </object>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">False</property>
+                                            <property name="position">3</property>
+                                          </packing>
+                                        </child>
                                       </object>
                                     </child>
                                   </object>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]