/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to preferences/plugins.py

  • Committer: Vincent Ladeuil
  • Date: 2009-05-07 11:48:03 UTC
  • Revision ID: v.ladeuil+lp@free.fr-20090507114803-sxykmkuzrkdj2pr3
Fix bug #373157 by properly setting the default values.

* tests/test_annotate_config.py:
(TestConfig.test_create_initial_config): Urgh, remove pdb breakpoint.

* annotate/config.py:
(gannotate_configspec): Deleted, can't be used for default values
and not used for validation: useless.
(gannotate_config_filename): Turned into a function so that tests
get proper isolated result (evaluating the path at load time
forbids the test framework overriding).
(GAnnotateConfig.__init__): Add default values *only* if the
'window' section doesn't exist. Assigning them unconditionally
defeats the config file purpose... Also delete the 'spans' section
since nobody use it.
(GAnnotateConfig.apply): Coerce config values when we use them.
(Gannotateconfig._save_custom_spans): Deleted (dead code).

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
class PluginsPage(gtk.VPaned):
26
26
    def __init__(self):
27
27
        gtk.VPaned.__init__(self)
 
28
        self.set_border_width(12)
 
29
        self.set_position(216)
 
30
 
28
31
        scrolledwindow = gtk.ScrolledWindow()
29
32
        scrolledwindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
 
33
        scrolledwindow.set_shadow_type(gtk.SHADOW_IN)
30
34
        self.model = gtk.ListStore(str, str)
31
35
        treeview = gtk.TreeView()
32
36
        scrolledwindow.add(treeview)
33
37
        self.pack1(scrolledwindow, resize=True, shrink=False)
34
38
 
35
39
        self.table = gtk.Table(columns=2)
 
40
        self.table.set_border_width(12)
36
41
        self.table.set_row_spacings(6)
37
42
        self.table.set_col_spacings(6)
38
43
 
67
72
 
68
73
    def row_selected(self, tv, path, tvc):
69
74
        import bzrlib
70
 
        p = bzrlib.plugin.plugins()[self.model[path][0]]
 
75
        p = bzrlib.plugin.plugins()[self.model[path][0]].module
71
76
        from inspect import getdoc
72
77
 
73
78
        for w in self.table.get_children():
74
79
            self.table.remove(w)
75
80
 
76
81
        if getattr(p, '__author__', None) is not None:
77
 
            align = gtk.Alignment(1.0, 0.5)
 
82
            align = gtk.Alignment(0.0, 0.5)
78
83
            label = gtk.Label()
79
84
            label.set_markup("<b>Author:</b>")
80
85
            align.add(label)
90
95
            self.table.attach(align, 1, 2, 0, 1, gtk.EXPAND | gtk.FILL, gtk.FILL)
91
96
 
92
97
        if getattr(p, '__version__', None) is not None:
93
 
            align = gtk.Alignment(1.0, 0.5)
 
98
            align = gtk.Alignment(0.0, 0.5)
94
99
            label = gtk.Label()
95
100
            label.set_markup("<b>Version:</b>")
96
101
            align.add(label)