[hamster-applet] glued report and close buttons back



commit 4716d5f98e196ec442b36cfa5c29356c797f4adc
Author: Toms Bauģis <toms baugis gmail com>
Date:   Sat Jun 12 19:09:14 2010 +0100

    glued report and close buttons back

 data/overview.ui        |   22 ++++++++++++++++++----
 src/hamster/overview.py |    4 ++--
 2 files changed, 20 insertions(+), 6 deletions(-)
---
diff --git a/data/overview.ui b/data/overview.ui
index 04fcdfb..b1cae07 100644
--- a/data/overview.ui
+++ b/data/overview.ui
@@ -3,6 +3,22 @@
   <requires lib="gtk+" version="2.16"/>
   <!-- interface-naming-policy project-wide -->
   <!-- interface-local-resource-path /home/toms/cvs/hamster/data/art -->
+  <object class="GtkActionGroup" id="overview">
+    <child>
+      <object class="GtkAction" id="export">
+        <property name="label" translatable="yes">Export data...</property>
+        <property name="icon_name">document-save</property>
+        <signal name="activate" handler="on_export_activate" swapped="no"/>
+      </object>
+    </child>
+    <child>
+      <object class="GtkAction" id="close">
+        <property name="stock_id">gtk-close</property>
+        <signal name="activate" handler="on_close_activate" swapped="no"/>
+      </object>
+      <accelerator key="w" modifiers="GDK_CONTROL_MASK"/>
+    </child>
+  </object>
   <object class="GtkActionGroup" id="view">
     <child>
       <object class="GtkAction" id="day">
@@ -46,15 +62,13 @@
                     <child>
                       <object class="GtkMenuItem" id="report_button">
                         <property name="visible">True</property>
-                        <property name="label" translatable="yes">Export data...</property>
-                        <property name="use_underline">True</property>
+                        <property name="related_action">export</property>
                       </object>
                     </child>
                     <child>
                       <object class="GtkImageMenuItem" id="imagemenuitem5">
-                        <property name="label">gtk-close</property>
                         <property name="visible">True</property>
-                        <property name="use_underline">True</property>
+                        <property name="related_action">close</property>
                         <property name="use_stock">True</property>
                       </object>
                     </child>
diff --git a/src/hamster/overview.py b/src/hamster/overview.py
index ca70c51..2087273 100644
--- a/src/hamster/overview.py
+++ b/src/hamster/overview.py
@@ -129,7 +129,7 @@ class Overview(object):
         search_terms = self.get_widget("search").get_text().decode("utf8", "replace")
         self.facts = runtime.storage.get_facts(self.start_date, self.end_date, search_terms)
 
-        self.get_widget("report_button").set_sensitive(len(self.facts) > 0)
+        self.get_widget("export").set_sensitive(len(self.facts) > 0)
 
         self.set_title()
 
@@ -183,7 +183,7 @@ class Overview(object):
         has_text = len(widget.get_text()) > 0
         widget.set_icon_sensitive(gtk.ENTRY_ICON_SECONDARY, has_text)
 
-    def on_report_button_clicked(self, widget):
+    def on_export_activate(self, widget):
         def on_report_chosen(widget, format, path):
             self.report_chooser = None
             reports.simple(self.facts, self.start_date, self.end_date, format, path)



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