1
# Copyright (C) 2007 Jelmer Vernooij <jelmer@samba.org>
3
# This program is free software; you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation; either version 2 of the License, or
6
# (at your option) any later version.
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
# GNU General Public License for more details.
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25
from bzrlib.config import GlobalConfig
26
from identity import IdentityPage
27
from plugins import PluginsPage
28
from notifications import NotificationsPage
30
class PreferencesWindow(gtk.Dialog):
31
"""Displays global preferences windows."""
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
35
# will already be familiar with the configuration file.
37
def __init__(self, config=None):
38
""" Initialize the Status window. """
39
super(PreferencesWindow, self).__init__(flags=gtk.DIALOG_MODAL)
40
self.set_title("Bazaar Preferences")
41
self.set_has_separator(False)
43
if self.config is None:
44
self.config = GlobalConfig()
48
self.set_default_size(320, 480)
49
self.set_border_width(0)
51
notebook = gtk.Notebook()
52
notebook.set_border_width(12)
53
for (label, page) in self._create_pages():
54
notebook.append_page(page, gtk.Label(label))
56
notebook.set_current_page(0)
57
self.vbox.set_border_width(0)
58
self.vbox.pack_start(notebook, True, True)
60
self.action_area.set_border_width(12)
62
def _create_pages(self):
63
return [("Identity", IdentityPage(self.config)),
64
("Plugins", PluginsPage()),
65
("Notifications", NotificationsPage(self.config))]
68
self.window.show_all()
70
def close(self, widget=None):
73
class BranchPreferencesWindow(gtk.Dialog):
74
"""Displays global preferences windows."""
75
def __init__(self, config=None):
76
super(BranchPreferencesWindow, self).__init__(config)