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
29
class PreferencesWindow(gtk.Dialog):
30
"""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
34
# will already be familiar with the configuration file.
36
def __init__(self, config=None):
37
""" Initialize the Status window. """
38
super(PreferencesWindow, self).__init__(flags=gtk.DIALOG_MODAL)
39
self.set_title("Bazaar Preferences")
41
if self.config is None:
42
self.config = GlobalConfig()
48
self.set_default_size(600, 600)
49
notebook = gtk.Notebook()
50
for (label, page) in self._create_pages():
51
notebook.insert_page(page, gtk.Label(label))
52
self.vbox.pack_start(notebook, True, True)
55
def _create_pages(self):
56
return [("Identity", IdentityPage(self.config)),
57
("Plugins", PluginsPage())]
60
self.window.show_all()
62
def close(self, widget=None):
65
class BranchPreferencesWindow(gtk.Dialog):
66
"""Displays global preferences windows."""
67
def __init__(self, config=None):
68
super(BranchPreferencesWindow, self).__init__(config)