Rev 237: Some UI improvements for preferences dialog. in file:///data/jelmer/bzr-gtk/trunk/

Jelmer Vernooij jelmer at samba.org
Thu Jul 19 13:17:01 BST 2007


At file:///data/jelmer/bzr-gtk/trunk/

------------------------------------------------------------
revno: 237
revision-id: jelmer at samba.org-20070719121700-zmlw9u41y2ow8es9
parent: jelmer at samba.org-20070717025514-w0phtodu6o8x5ifh
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Thu 2007-07-19 14:17:00 +0200
message:
  Some UI improvements for preferences dialog.
modified:
  preferences.py                 preferences.py-20070313153956-vcdqjrfal0wuk0vb-1
=== modified file 'preferences.py'
--- a/preferences.py	2007-07-13 21:59:53 +0000
+++ b/preferences.py	2007-07-19 12:17:00 +0000
@@ -46,11 +46,9 @@
         align.add(label)
         table.attach(align, 0, 1, 0, 1, gtk.FILL, gtk.FILL)
 
-        align = gtk.Alignment(0.0, 0.5)
         self.username = gtk.Entry()
-        align.add(self.username)
         self.username.set_text(self.config.username())
-        table.attach(align, 1, 2, 0, 1, gtk.EXPAND | gtk.FILL, gtk.FILL)
+        table.attach(self.username, 1, 2, 0, 1, gtk.EXPAND | gtk.FILL, gtk.FILL)
 
         align = gtk.Alignment(1.0, 0.5)
         label = gtk.Label()
@@ -58,11 +56,9 @@
         align.add(label)
         table.attach(align, 0, 1, 1, 2, gtk.FILL, gtk.FILL)
 
-        align = gtk.Alignment(0.0, 0.5)
         self.email = gtk.Entry()
         self.email.set_text(self.config.gpg_signing_command())
-        align.add(self.email)
-        table.attach(align, 1, 2, 1, 2, gtk.EXPAND | gtk.FILL, gtk.FILL)
+        table.attach(self.email, 1, 2, 1, 2, gtk.EXPAND | gtk.FILL, gtk.FILL)
 
         align = gtk.Alignment(1.0, 0.5)
         label = gtk.Label()
@@ -70,7 +66,6 @@
         align.add(label)
         table.attach(align, 0, 1, 2, 3, gtk.FILL, gtk.FILL)
 
-        align = gtk.Alignment(0.0, 0.5)
         sigvals = gtk.VBox()
         self.check_sigs_if_possible = gtk.RadioButton(None, 
                                                       "_Check if possible")
@@ -82,8 +77,7 @@
                                                 "Check _never")
         sigvals.pack_start(self.check_sigs_never)
         # FIXME: Set default
-        align.add(sigvals)
-        table.attach(align, 1, 2, 2, 3, gtk.EXPAND | gtk.FILL, gtk.FILL)
+        table.attach(sigvals, 1, 2, 2, 3, gtk.EXPAND | gtk.FILL, gtk.FILL)
 
         align = gtk.Alignment(1.0, 0.5)
         label = gtk.Label()
@@ -91,7 +85,6 @@
         align.add(label)
         table.attach(align, 0, 1, 3, 4, gtk.FILL, gtk.FILL)
 
-        align = gtk.Alignment(0.0, 0.5)
         create_sigs = gtk.VBox()
         self.create_sigs_when_required = gtk.RadioButton(None, 
                                                          "Sign When _Required")
@@ -103,26 +96,23 @@
             self.create_sigs_when_required, "Sign _Never")
         create_sigs.pack_start(self.create_sigs_never)
         # FIXME: Set default
-        align.add(create_sigs)
-        table.attach(align, 1, 2, 3, 4, gtk.EXPAND | gtk.FILL, gtk.FILL)
+        table.attach(create_sigs, 1, 2, 3, 4, gtk.EXPAND | gtk.FILL, gtk.FILL)
 
         return table
 
     def _create_pluginpage(self):
-        vbox = gtk.VBox(False, 2)
-        vbox.set_border_width(6)
-
+        paned = gtk.VPaned()
         scrolledwindow = gtk.ScrolledWindow()
         scrolledwindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
         model = gtk.ListStore(str, str)
         treeview = gtk.TreeView()
         scrolledwindow.add(treeview)
+        paned.pack1(scrolledwindow, resize=True, shrink=False)
 
         table = gtk.Table(columns=2)
         table.set_row_spacings(6)
         table.set_col_spacings(6)
 
-
         def row_selected(tv, path, tvc):
             p = bzrlib.plugin.all_plugins()[model[path][0]]
             from inspect import getdoc
@@ -195,11 +185,13 @@
         for name in plugin_names:
             model.append([name, getattr(plugins[name], '__file__', None)])
                  
-        vbox.pack_start(scrolledwindow, expand=True, fill=True)
-
-        vbox.pack_start(table)
-
-        return vbox
+        scrolledwindow = gtk.ScrolledWindow()
+        scrolledwindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
+        scrolledwindow.add_with_viewport(table)
+        paned.pack2(scrolledwindow, resize=False, shrink=True)
+        paned.show()
+
+        return paned
 
     def _create(self):
         self.set_default_size(600, 600)




More information about the bazaar-commits mailing list