[gnome-tweak-tool] Stop GUI resize at startup



commit 4e85bcc331f261d4b9925812d69d329da6869a65
Author: John Stowers <john stowers gmail com>
Date:   Fri Mar 18 16:06:34 2011 +1300

    Stop GUI resize at startup

 gnome-tweak-tool    |   10 ++--------
 gtweak/tweakview.py |   10 ++++++++++
 2 files changed, 12 insertions(+), 8 deletions(-)
---
diff --git a/gnome-tweak-tool b/gnome-tweak-tool
index ebfd1a7..892261b 100755
--- a/gnome-tweak-tool
+++ b/gnome-tweak-tool
@@ -30,14 +30,8 @@ class MainWindow:
                     model)
         builder.get_object('overview_sw').add(view.treeview)
 
-        window = builder.get_object('main_window')
-        window.set_size_request(640, 480)
-        window.connect('destroy', Gtk.main_quit)
-        window.show_all()
+        view.run()
         
-    def run(self):
-        Gtk.main()
-
 if __name__ == '__main__':
     parser = optparse.OptionParser()
     parser.add_option("-t", "--test", action="store_true",
@@ -62,5 +56,5 @@ if __name__ == '__main__':
     gtweak.PKG_DATA_DIR = PKG_DATA_DIR
     gtweak.ENABLE_TEST = options.test
 
-    MainWindow().run()
+    MainWindow()
 
diff --git a/gtweak/tweakview.py b/gtweak/tweakview.py
index 2a8b92f..6c1f1e3 100644
--- a/gtweak/tweakview.py
+++ b/gtweak/tweakview.py
@@ -7,6 +7,11 @@ class TweakView:
     def __init__(self, builder, model):
         self._notebook = builder.get_object('notebook')
         self._detail_vbox = builder.get_object('detail_vbox')
+        self._main_window = builder.get_object('main_window')
+
+        self._main_window.set_size_request(640, 480)
+        self._main_window.connect('destroy', Gtk.main_quit)
+
         self._entry_manager = EntryManager(
             builder.get_object('search_entry'),
             self._on_search,
@@ -42,6 +47,11 @@ class TweakView:
             tweak_box.pack_start(t.widget, False, False, 0)
             t.set_notify_cb(self._on_tweak_notify)
 
+    def run(self):
+        self._main_window.show_all()
+        self.hide_tweaks(self._model.tweaks)
+        Gtk.main()
+
     def show_tweaks(self, tweaks):
         map(Gtk.Widget.show_all, [t.widget for t in tweaks])
 



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