hamster-applet r896 - in trunk: data hamster



Author: tbaugis
Date: Tue Apr 14 15:25:30 2009
New Revision: 896
URL: http://svn.gnome.org/viewvc/hamster-applet?rev=896&view=rev

Log:
minor cleanup:
put month/week icons back, moved report button to toolbar and removed
totals label since info is now in the graph itself.

Modified:
   trunk/data/stats.ui
   trunk/hamster/stats.py

Modified: trunk/data/stats.ui
==============================================================================
--- trunk/data/stats.ui	(original)
+++ trunk/data/stats.ui	Tue Apr 14 15:25:30 2009
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <interface>
-  <requires lib="gtk+" version="2.16"/>
+  <!-- interface-requires gtk+ 2.12 -->
   <!-- interface-naming-policy toplevel-contextual -->
   <!-- interface-local-resource-path /home/toms/cvs/hamster/data/art -->
   <object class="GtkWindow" id="stats_window">
@@ -155,6 +155,29 @@
                 <property name="homogeneous">True</property>
               </packing>
             </child>
+            <child>
+              <object class="GtkSeparatorToolItem" id="&lt;separator&gt;">
+                <property name="visible">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="homogeneous">True</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkToolButton" id="report_button">
+                <property name="visible">True</property>
+                <property name="tooltip_text" translatable="yes">Save as HTML</property>
+                <property name="label" translatable="yes">Save as HTML</property>
+                <property name="use_underline">True</property>
+                <property name="stock_id">gtk-save</property>
+                <signal name="clicked" handler="on_report_button_clicked"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="homogeneous">True</property>
+              </packing>
+            </child>
           </object>
           <packing>
             <property name="expand">False</property>
@@ -191,52 +214,23 @@
             <property name="border_width">12</property>
             <property name="position">300</property>
             <child>
-              <object class="GtkVBox" id="vbox3">
+              <object class="GtkScrolledWindow" id="scrolledwindow1">
+                <property name="width_request">300</property>
                 <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                <property name="hscrollbar_policy">automatic</property>
+                <property name="vscrollbar_policy">automatic</property>
+                <property name="shadow_type">in</property>
                 <child>
-                  <object class="GtkScrolledWindow" id="scrolledwindow1">
-                    <property name="width_request">300</property>
+                  <object class="GtkTreeView" id="facts">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                    <property name="hscrollbar_policy">automatic</property>
-                    <property name="vscrollbar_policy">automatic</property>
-                    <property name="shadow_type">in</property>
-                    <child>
-                      <object class="GtkTreeView" id="facts">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                        <property name="enable_search">False</property>
-                        <signal name="key_press_event" handler="on_key_pressed"/>
-                        <signal name="row_activated" handler="on_facts_row_activated"/>
-                      </object>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkAlignment" id="alignment2">
-                    <property name="visible">True</property>
-                    <property name="xalign">0</property>
-                    <property name="xscale">0</property>
-                    <property name="top_padding">6</property>
-                    <child>
-                      <object class="GtkButton" id="report_button">
-                        <property name="label" translatable="yes">Generate Report</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">True</property>
-                        <signal name="clicked" handler="on_report_button_clicked"/>
-                      </object>
-                    </child>
+                    <property name="enable_search">False</property>
+                    <signal name="key_press_event" handler="on_key_pressed"/>
+                    <signal name="row_activated" handler="on_facts_row_activated"/>
                   </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="position">1</property>
-                  </packing>
                 </child>
               </object>
               <packing>
@@ -245,106 +239,72 @@
               </packing>
             </child>
             <child>
-              <object class="GtkVBox" id="vbox2">
+              <object class="GtkScrolledWindow" id="scrolledwindow2">
                 <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="GtkScrolledWindow" id="scrolledwindow2">
+                  <object class="GtkEventBox" id="graph_frame">
                     <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="GtkEventBox" id="graph_frame">
+                      <object class="GtkVBox" id="vbox4">
                         <property name="visible">True</property>
+                        <property name="orientation">vertical</property>
                         <child>
-                          <object class="GtkVBox" id="vbox4">
+                          <object class="GtkVBox" id="graphs">
+                            <property name="width_request">390</property>
                             <property name="visible">True</property>
+                            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                            <property name="border_width">4</property>
+                            <property name="orientation">vertical</property>
+                            <property name="spacing">24</property>
+                            <property name="homogeneous">True</property>
                             <child>
-                              <object class="GtkVBox" id="graphs">
-                                <property name="width_request">390</property>
+                              <object class="GtkFrame" id="fram1">
                                 <property name="visible">True</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                <property name="border_width">4</property>
-                                <property name="spacing">24</property>
-                                <property name="homogeneous">True</property>
+                                <property name="label_xalign">0</property>
+                                <property name="shadow_type">none</property>
                                 <child>
-                                  <object class="GtkFrame" id="fram1">
+                                  <object class="GtkHBox" id="hbox1">
                                     <property name="visible">True</property>
-                                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                    <property name="label_xalign">0</property>
-                                    <property name="shadow_type">none</property>
+                                    <property name="border_width">9</property>
+                                    <property name="spacing">36</property>
                                     <child>
-                                      <object class="GtkHBox" id="hbox1">
+                                      <object class="GtkEventBox" id="totals_by_category">
+                                        <property name="width_request">50</property>
                                         <property name="visible">True</property>
-                                        <property name="border_width">9</property>
-                                        <property name="spacing">36</property>
                                         <child>
-                                          <object class="GtkEventBox" id="totals_by_category">
-                                            <property name="width_request">50</property>
-                                            <property name="visible">True</property>
-                                            <child>
-                                              <placeholder/>
-                                            </child>
-                                          </object>
-                                          <packing>
-                                            <property name="expand">False</property>
-                                            <property name="position">0</property>
-                                          </packing>
-                                        </child>
-                                        <child>
-                                          <object class="GtkEventBox" id="totals_by_day">
-                                            <property name="visible">True</property>
-                                            <child>
-                                              <placeholder/>
-                                            </child>
-                                          </object>
-                                          <packing>
-                                            <property name="position">1</property>
-                                          </packing>
+                                          <placeholder/>
                                         </child>
                                       </object>
+                                      <packing>
+                                        <property name="expand">False</property>
+                                        <property name="position">0</property>
+                                      </packing>
                                     </child>
-                                    <child type="label">
-                                      <object class="GtkLabel" id="dayview_caption">
-                                        <property name="visible">True</property>
-                                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                        <property name="label" translatable="yes">Week</property>
-                                        <property name="use_markup">True</property>
-                                      </object>
-                                    </child>
-                                  </object>
-                                  <packing>
-                                    <property name="position">0</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkFrame" id="frame39">
-                                    <property name="visible">True</property>
-                                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                    <property name="label_xalign">0</property>
-                                    <property name="shadow_type">none</property>
                                     <child>
-                                      <object class="GtkEventBox" id="totals_by_activity">
+                                      <object class="GtkEventBox" id="totals_by_day">
                                         <property name="visible">True</property>
-                                        <property name="border_width">12</property>
                                         <child>
                                           <placeholder/>
                                         </child>
                                       </object>
-                                    </child>
-                                    <child type="label">
-                                      <object class="GtkLabel" id="label3">
-                                        <property name="visible">True</property>
-                                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                        <property name="label" translatable="yes">Activity</property>
-                                        <property name="use_markup">True</property>
-                                      </object>
+                                      <packing>
+                                        <property name="position">1</property>
+                                      </packing>
                                     </child>
                                   </object>
-                                  <packing>
-                                    <property name="position">1</property>
-                                  </packing>
+                                </child>
+                                <child type="label">
+                                  <object class="GtkLabel" id="dayview_caption">
+                                    <property name="visible">True</property>
+                                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                                    <property name="label" translatable="yes">Week</property>
+                                    <property name="use_markup">True</property>
+                                  </object>
                                 </child>
                               </object>
                               <packing>
@@ -352,39 +312,49 @@
                               </packing>
                             </child>
                             <child>
-                              <object class="GtkLabel" id="no_data_label">
-                                <property name="label" translatable="yes">No data for this interval</property>
+                              <object class="GtkFrame" id="frame39">
+                                <property name="visible">True</property>
+                                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                                <property name="label_xalign">0</property>
+                                <property name="shadow_type">none</property>
+                                <child>
+                                  <object class="GtkEventBox" id="totals_by_activity">
+                                    <property name="visible">True</property>
+                                    <property name="border_width">12</property>
+                                    <child>
+                                      <placeholder/>
+                                    </child>
+                                  </object>
+                                </child>
+                                <child type="label">
+                                  <object class="GtkLabel" id="label3">
+                                    <property name="visible">True</property>
+                                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                                    <property name="label" translatable="yes">Activity</property>
+                                    <property name="use_markup">True</property>
+                                  </object>
+                                </child>
                               </object>
                               <packing>
                                 <property name="position">1</property>
                               </packing>
                             </child>
                           </object>
+                          <packing>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="no_data_label">
+                            <property name="label" translatable="yes">No data for this interval</property>
+                          </object>
+                          <packing>
+                            <property name="position">1</property>
+                          </packing>
                         </child>
                       </object>
                     </child>
                   </object>
-                  <packing>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkAlignment" id="alignment3">
-                    <property name="visible">True</property>
-                    <property name="xalign">1</property>
-                    <property name="xscale">0</property>
-                    <property name="top_padding">18</property>
-                    <child>
-                      <object class="GtkLabel" id="totals">
-                        <property name="visible">True</property>
-                        <property name="label">Something: 20:00, Food: 12:13</property>
-                      </object>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="position">1</property>
-                  </packing>
                 </child>
               </object>
               <packing>
@@ -402,10 +372,10 @@
   </object>
   <object class="GtkImage" id="week_icon">
     <property name="visible">True</property>
-    <property name="pixbuf">stock_calendar-view-week.png</property>
+    <property name="pixbuf">art/stock_calendar-view-week.png</property>
   </object>
   <object class="GtkImage" id="month_icon">
     <property name="visible">True</property>
-    <property name="pixbuf">stock_calendar-view-month.png</property>
+    <property name="pixbuf">art/stock_calendar-view-month.png</property>
   </object>
 </interface>

Modified: trunk/hamster/stats.py
==============================================================================
--- trunk/hamster/stats.py	(original)
+++ trunk/hamster/stats.py	Tue Apr 14 15:25:30 2009
@@ -379,7 +379,6 @@
         if not fact_list:
             self.get_widget("graphs").hide()
             self.get_widget("no_data_label").show()
-            self.get_widget("totals").set_text("");
             return 
         else:
             self.get_widget("graphs").show()
@@ -418,20 +417,6 @@
         self.category_chart.plot([_("Total")], category_totals,
                                   stack_keys = category_keys)
 
-        
-        
-        #total string in right bottom corner, maybe temporar
-        total_string = ""
-        for i in range(len(day_category_totals['keys'])):
-            if category_totals[0][i] > 0:
-                total_string += _("%(category)s: %(duration).1f, ") % \
-                                ({'category': day_category_totals['keys'][i],
-                                  'duration': category_totals[0][i]})
-
-        total_string = total_string.rstrip(", ") # trailing slash
-        self.get_widget("totals").set_text(total_string);
-        
-
 
     def get_widget(self, name):
         """ skip one variable (huh) """



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