25
25
from bzrlib.config import GlobalConfig
26
from identity import IdentityPage
27
from plugins import PluginsPage
26
from bzrlib.plugins.gtk.preferences.identity import IdentityPage
27
from bzrlib.plugins.gtk.preferences.plugins import PluginsPage
28
from bzrlib.plugins.gtk.preferences.notifications import NotificationsPage
29
30
class PreferencesWindow(gtk.Dialog):
30
31
"""Displays global preferences windows."""
31
# Note that we don't allow configuration of aliases or
32
# default log formats. This is because doing so wouldn't make
33
# a lot of sense to pure GUI users. Users that need these settings
32
# Note that we don't allow configuration of aliases or
33
# default log formats. This is because doing so wouldn't make
34
# a lot of sense to pure GUI users. Users that need these settings
34
35
# will already be familiar with the configuration file.
36
37
def __init__(self, config=None):
37
38
""" Initialize the Status window. """
38
39
super(PreferencesWindow, self).__init__(flags=gtk.DIALOG_MODAL)
39
40
self.set_title("Bazaar Preferences")
41
self.set_has_separator(False)
40
42
self.config = config
41
43
if self.config is None:
42
44
self.config = GlobalConfig()
48
self.set_default_size(600, 600)
48
self.set_default_size(320, 480)
49
self.set_border_width(0)
49
51
notebook = gtk.Notebook()
52
notebook.set_border_width(12)
50
53
for (label, page) in self._create_pages():
51
notebook.insert_page(page, gtk.Label(label))
54
notebook.append_page(page, gtk.Label(label))
56
notebook.set_current_page(0)
57
self.vbox.set_border_width(0)
52
58
self.vbox.pack_start(notebook, True, True)
53
59
self.vbox.show_all()
60
self.action_area.set_border_width(12)
55
62
def _create_pages(self):
56
return [("Identity", IdentityPage(self.config)),
57
("Plugins", PluginsPage())]
63
return [("Identity", IdentityPage(self.config)),
64
("Plugins", PluginsPage()),
65
("Notifications", NotificationsPage(self.config))]
60
68
self.window.show_all()