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.
29
34
def __init__(self, config=None):
30
35
""" Initialize the Status window. """
31
36
super(PreferencesWindow, self).__init__(flags=gtk.DIALOG_MODAL)
47
52
table.attach(align, 0, 1, 0, 1, gtk.FILL, gtk.FILL)
49
align = gtk.Alignment(0.0, 0.5)
50
54
self.username = gtk.Entry()
51
align.add(self.username)
52
55
self.username.set_text(self.config.username())
53
table.attach(align, 1, 2, 0, 1, gtk.EXPAND | gtk.FILL, gtk.FILL)
56
table.attach(self.username, 1, 2, 0, 1, gtk.EXPAND | gtk.FILL, gtk.FILL)
55
58
align = gtk.Alignment(1.0, 0.5)
56
59
label = gtk.Label()
59
62
table.attach(align, 0, 1, 1, 2, gtk.FILL, gtk.FILL)
61
align = gtk.Alignment(0.0, 0.5)
62
64
self.email = gtk.Entry()
63
65
self.email.set_text(self.config.gpg_signing_command())
65
table.attach(align, 1, 2, 1, 2, gtk.EXPAND | gtk.FILL, gtk.FILL)
66
table.attach(self.email, 1, 2, 1, 2, gtk.EXPAND | gtk.FILL, gtk.FILL)
67
68
align = gtk.Alignment(1.0, 0.5)
68
69
label = gtk.Label()
71
72
table.attach(align, 0, 1, 2, 3, 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)
75
self.check_sigs_if_possible = gtk.RadioButton(None,
77
sigvals.pack_start(self.check_sigs_if_possible)
78
self.check_sigs_always = gtk.RadioButton(self.check_sigs_if_possible,
80
sigvals.pack_start(self.check_sigs_always)
81
self.check_sigs_never = gtk.RadioButton(self.check_sigs_if_possible,
83
sigvals.pack_start(self.check_sigs_never)
85
table.attach(sigvals, 1, 2, 2, 3, gtk.EXPAND | gtk.FILL, gtk.FILL)
79
87
align = gtk.Alignment(1.0, 0.5)
80
88
label = gtk.Label()
83
91
table.attach(align, 0, 1, 3, 4, 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)
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)
104
table.attach(create_sigs, 1, 2, 3, 4, gtk.EXPAND | gtk.FILL, gtk.FILL)
95
108
def _create_pluginpage(self):
96
vbox = gtk.VBox(False, 2)
97
vbox.set_border_width(6)
99
110
scrolledwindow = gtk.ScrolledWindow()
100
111
scrolledwindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
101
112
model = gtk.ListStore(str, str)
102
113
treeview = gtk.TreeView()
103
114
scrolledwindow.add(treeview)
115
paned.pack1(scrolledwindow, resize=True, shrink=False)
105
117
table = gtk.Table(columns=2)
106
118
table.set_row_spacings(6)
107
119
table.set_col_spacings(6)
110
121
def row_selected(tv, path, tvc):
111
p = bzrlib.plugin.all_plugins()[model[path][0]]
122
p = bzrlib.plugin.plugins()[model[path][0]]
112
123
from inspect import getdoc
114
125
for w in table.get_children():
173
184
treeview.append_column(column)
175
186
import bzrlib.plugin
176
plugins = bzrlib.plugin.all_plugins()
187
plugins = bzrlib.plugin.plugins()
177
188
plugin_names = plugins.keys()
178
189
plugin_names.sort()
179
190
for name in plugin_names:
180
191
model.append([name, getattr(plugins[name], '__file__', None)])
182
vbox.pack_start(scrolledwindow, expand=True, fill=True)
184
vbox.pack_start(table)
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)
188
201
def _create(self):
189
202
self.set_default_size(600, 600)
199
212
def close(self, widget=None):
200
213
self.window.destroy()
215
class BranchPreferencesWindow(gtk.Dialog):
216
"""Displays global preferences windows."""
217
def __init__(self, config=None):
218
super(BranchPreferencesWindow, self).__init__(config)