[hamster-applet] knits. there is something strange about window positions



commit 07d606b8434bb3e9e4f68c20ace62689407a32c3
Author: Toms Bauģis <toms baugis gmail com>
Date:   Thu Jan 14 21:26:32 2010 +0000

    knits. there is something strange about window positions

 data/stats_stats.ui      |    1 +
 hamster/configuration.py |    4 ++--
 hamster/stats_stats.py   |    6 ++++--
 3 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/data/stats_stats.ui b/data/stats_stats.ui
index 0a44675..68bc10d 100644
--- a/data/stats_stats.ui
+++ b/data/stats_stats.ui
@@ -8,6 +8,7 @@
     <property name="title" translatable="yes">Statistics</property>
     <property name="window_position">center</property>
     <property name="default_width">800</property>
+    <property name="default_height">550</property>
     <property name="icon_name">hamster-applet</property>
     <signal name="key_press_event" handler="on_window_key_pressed"/>
     <signal name="delete_event" handler="on_close"/>
diff --git a/hamster/configuration.py b/hamster/configuration.py
index 72b9075..9c1a974 100644
--- a/hamster/configuration.py
+++ b/hamster/configuration.py
@@ -162,8 +162,8 @@ class Dialogs(Singleton):
         self.overview = OneWindow(get_overview_class)
 
         def get_stats_class():
-            from stats_stats import StatsViewer
-            return StatsViewer
+            from stats_stats import StatsViewer2
+            return StatsViewer2
         self.stats = OneWindow(get_stats_class)
 
         def get_about_class():
diff --git a/hamster/stats_stats.py b/hamster/stats_stats.py
index 72c058b..ffb1919 100644
--- a/hamster/stats_stats.py
+++ b/hamster/stats_stats.py
@@ -35,7 +35,7 @@ from configuration import runtime
 
 from hamster.i18n import C_
 
-class StatsViewer(object):
+class StatsViewer2(object):
     def __init__(self, parent = None):
         self._gui = stuff.load_ui_file("stats_stats.ui")
         self.report_chooser = None
@@ -53,6 +53,8 @@ class StatsViewer(object):
         runtime.dispatcher.add_handler('day_updated', self.after_fact_update)
 
         self.init_stats()
+
+        self.window.set_position(gtk.WIN_POS_CENTER)
         self.window.show_all()
         self.stats()
 
@@ -419,5 +421,5 @@ than 15 minutes you seem to be a busy bee." % ("<b>%d</b>" % short_percent))
 
 
 if __name__ == "__main__":
-    stats_viewer = StatsViewer()
+    stats_viewer = StatsViewer2()
     gtk.main()



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