/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: Jelmer Vernooij
  • Date: 2008-06-29 15:47:30 UTC
  • mto: This revision was merged to the branch mainline in revision 519.
  • Revision ID: jelmer@samba.org-20080629154730-xfsotoxwkiytf0ph
Pass graph object rather than full repository to linegraph.

Show diffs side-by-side

added added

removed removed

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