summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Jorde <[email protected]>2011-08-23 20:58:10 +0200
committerAlexei Sorokin <[email protected]>2016-08-23 00:17:03 +0300
commitc39ea786f9bfff1eef4962b8a8bbb700ffb34de5 (patch)
tree144a9c0875399117561438a45c0ec56c31fd07ee
parent2256cf36835b904670606972fb4d6bb5f26ea5dc (diff)
downloadmozo-c39ea786f9bfff1eef4962b8a8bbb700ffb34de5.tar.bz2
mozo-c39ea786f9bfff1eef4962b8a8bbb700ffb34de5.tar.xz
add properties and a delete button
https://bugzilla.gnome.org/show_bug.cgi?id=518251
-rw-r--r--Mozo/MainWindow.py11
-rw-r--r--data/mozo.ui33
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('<Ctrl>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 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.19.0 -->
<interface>
<requires lib="gtk+" version="3.14"/>
<object class="GtkUIManager" id="uimanager1">
@@ -160,8 +159,6 @@
<object class="GtkScrolledWindow" id="scrolledwindow3">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="hscrollbar_policy">automatic</property>
- <property name="vscrollbar_policy">automatic</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkTreeView" id="menu_tree">
@@ -381,6 +378,36 @@
<property name="position">2</property>
</packing>
</child>
+ <child>
+ <object class="GtkButton" id="properties_button">
+ <property name="label">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 name="clicked" handler="on_properties_button_clicked" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="delete_button">
+ <property name="label">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 name="clicked" handler="on_delete_button_clicked" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">False</property>