/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.py

  • Committer: Szilveszter Farkas (Phanatic)
  • Date: 2007-05-17 16:12:27 UTC
  • mto: This revision was merged to the branch mainline in revision 201.
  • Revision ID: szilveszter.farkas@gmail.com-20070517161227-9e37lj2rm2t0cwj6
Some small modifications to Branch, Checkout and Info to support remote branches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 
27
27
class PreferencesWindow(gtk.Dialog):
28
28
    """Displays global preferences windows."""
29
 
    # Note that we don't allow configuration of aliases or 
30
 
    # default log formats. This is because doing so wouldn't make 
31
 
    # a lot of sense to pure GUI users. Users that need these settings 
32
 
    # will already be familiar with the configuration file.
33
 
 
34
29
    def __init__(self, config=None):
35
30
        """ Initialize the Status window. """
36
31
        super(PreferencesWindow, self).__init__(flags=gtk.DIALOG_MODAL)
51
46
        align.add(label)
52
47
        table.attach(align, 0, 1, 0, 1, gtk.FILL, gtk.FILL)
53
48
 
 
49
        align = gtk.Alignment(0.0, 0.5)
54
50
        self.username = gtk.Entry()
 
51
        align.add(self.username)
55
52
        self.username.set_text(self.config.username())
56
 
        table.attach(self.username, 1, 2, 0, 1, gtk.EXPAND | gtk.FILL, gtk.FILL)
 
53
        table.attach(align, 1, 2, 0, 1, gtk.EXPAND | gtk.FILL, gtk.FILL)
57
54
 
58
55
        align = gtk.Alignment(1.0, 0.5)
59
56
        label = gtk.Label()
61
58
        align.add(label)
62
59
        table.attach(align, 0, 1, 1, 2, gtk.FILL, gtk.FILL)
63
60
 
 
61
        align = gtk.Alignment(0.0, 0.5)
64
62
        self.email = gtk.Entry()
65
63
        self.email.set_text(self.config.gpg_signing_command())
66
 
        table.attach(self.email, 1, 2, 1, 2, gtk.EXPAND | gtk.FILL, gtk.FILL)
 
64
        align.add(self.email)
 
65
        table.attach(align, 1, 2, 1, 2, gtk.EXPAND | gtk.FILL, gtk.FILL)
67
66
 
68
67
        align = gtk.Alignment(1.0, 0.5)
69
68
        label = gtk.Label()
71
70
        align.add(label)
72
71
        table.attach(align, 0, 1, 2, 3, gtk.FILL, gtk.FILL)
73
72
 
74
 
        sigvals = gtk.VBox()
75
 
        self.check_sigs_if_possible = gtk.RadioButton(None, 
76
 
                                                      "_Check if possible")
77
 
        sigvals.pack_start(self.check_sigs_if_possible)
78
 
        self.check_sigs_always = gtk.RadioButton(self.check_sigs_if_possible, 
79
 
                                                 "Check _always")
80
 
        sigvals.pack_start(self.check_sigs_always)
81
 
        self.check_sigs_never = gtk.RadioButton(self.check_sigs_if_possible,
82
 
                                                "Check _never")
83
 
        sigvals.pack_start(self.check_sigs_never)
84
 
        # FIXME: Set default
85
 
        table.attach(sigvals, 1, 2, 2, 3, gtk.EXPAND | gtk.FILL, gtk.FILL)
 
73
        align = gtk.Alignment(0.0, 0.5)
 
74
        self.check_sigs = gtk.Entry()
 
75
        #self.check_sigs.set_text(self.config.signature_checking())
 
76
        align.add(self.check_sigs)
 
77
        table.attach(align, 1, 2, 2, 3, gtk.EXPAND | gtk.FILL, gtk.FILL)
86
78
 
87
79
        align = gtk.Alignment(1.0, 0.5)
88
80
        label = gtk.Label()
90
82
        align.add(label)
91
83
        table.attach(align, 0, 1, 3, 4, gtk.FILL, gtk.FILL)
92
84
 
93
 
        create_sigs = gtk.VBox()
94
 
        self.create_sigs_when_required = gtk.RadioButton(None, 
95
 
                                                         "Sign When _Required")
96
 
        create_sigs.pack_start(self.create_sigs_when_required)
97
 
        self.create_sigs_always = gtk.RadioButton(
98
 
            self.create_sigs_when_required, "Sign _Always")
99
 
        create_sigs.pack_start(self.create_sigs_always)
100
 
        self.create_sigs_never = gtk.RadioButton(
101
 
            self.create_sigs_when_required, "Sign _Never")
102
 
        create_sigs.pack_start(self.create_sigs_never)
103
 
        # FIXME: Set default
104
 
        table.attach(create_sigs, 1, 2, 3, 4, gtk.EXPAND | gtk.FILL, gtk.FILL)
 
85
        align = gtk.Alignment(0.0, 0.5)
 
86
        self.create_sigs = gtk.Entry()
 
87
        #self.create_sigs.set_text(self.config.signing_policy())
 
88
        align.add(self.create_sigs)
 
89
        table.attach(align, 1, 2, 3, 4, gtk.EXPAND | gtk.FILL, gtk.FILL)
105
90
 
106
91
        return table
107
92
 
 
93
 
 
94
 
108
95
    def _create_pluginpage(self):
109
 
        paned = gtk.VPaned()
 
96
        vbox = gtk.VBox(False, 2)
 
97
        vbox.set_border_width(6)
 
98
 
110
99
        scrolledwindow = gtk.ScrolledWindow()
111
100
        scrolledwindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
112
101
        model = gtk.ListStore(str, str)
113
102
        treeview = gtk.TreeView()
114
103
        scrolledwindow.add(treeview)
115
 
        paned.pack1(scrolledwindow, resize=True, shrink=False)
116
104
 
117
105
        table = gtk.Table(columns=2)
118
106
        table.set_row_spacings(6)
119
107
        table.set_col_spacings(6)
120
108
 
 
109
 
121
110
        def row_selected(tv, path, tvc):
122
 
            p = bzrlib.plugin.plugins()[model[path][0]]
 
111
            p = bzrlib.plugin.all_plugins()[model[path][0]]
123
112
            from inspect import getdoc
124
113
 
125
114
            for w in table.get_children():
184
173
        treeview.append_column(column)
185
174
        
186
175
        import bzrlib.plugin
187
 
        plugins = bzrlib.plugin.plugins()
 
176
        plugins = bzrlib.plugin.all_plugins()
188
177
        plugin_names = plugins.keys()
189
178
        plugin_names.sort()
190
179
        for name in plugin_names:
191
180
            model.append([name, getattr(plugins[name], '__file__', None)])
192
181
                 
193
 
        scrolledwindow = gtk.ScrolledWindow()
194
 
        scrolledwindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
195
 
        scrolledwindow.add_with_viewport(table)
196
 
        paned.pack2(scrolledwindow, resize=False, shrink=True)
197
 
        paned.show()
198
 
 
199
 
        return paned
 
182
        vbox.pack_start(scrolledwindow, expand=True, fill=True)
 
183
 
 
184
        vbox.pack_start(table)
 
185
 
 
186
        return vbox
200
187
 
201
188
    def _create(self):
202
189
        self.set_default_size(600, 600)
211
198
 
212
199
    def close(self, widget=None):
213
200
        self.window.destroy()
214
 
 
215
 
class BranchPreferencesWindow(gtk.Dialog):
216
 
    """Displays global preferences windows."""
217
 
    def __init__(self, config=None):
218
 
        super(BranchPreferencesWindow, self).__init__(config)
219