From c39ea786f9bfff1eef4962b8a8bbb700ffb34de5 Mon Sep 17 00:00:00 2001 From: Matt Jorde Date: Tue, 23 Aug 2011 20:58:10 +0200 Subject: add properties and a delete button https://bugzilla.gnome.org/show_bug.cgi?id=518251 --- Mozo/MainWindow.py | 11 +++++++++++ data/mozo.ui | 33 ++++++++++++++++++++++++++++++--- 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/Mozo/MainWindow.py b/Mozo/MainWindow.py index 176c410..74e5fd8 100644 --- a/Mozo/MainWindow.py +++ b/Mozo/MainWindow.py @@ -67,6 +67,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) accelgroup = Gtk.AccelGroup() keyval, modifier = Gtk.accelerator_parse('Z') accelgroup.connect(keyval, modifier, Gtk.AccelFlags.VISIBLE, self.on_mainwindow_undo) @@ -450,14 +452,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() == matemenu.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: @@ -640,6 +645,12 @@ class MainWindow: pass GLib.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_updated(self, *args): self.loadUpdates() diff --git a/data/mozo.ui b/data/mozo.ui index c9e1e30..a01bf4e 100644 --- a/data/mozo.ui +++ b/data/mozo.ui @@ -1,5 +1,4 @@ - @@ -160,8 +159,6 @@ True True - automatic - automatic in @@ -381,6 +378,36 @@ 2 + + + gtk-properties + True + True + True + True + + + + False + False + 3 + + + + + gtk-delete + True + True + True + True + + + + False + False + 4 + + False -- cgit v1.2.1