14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
from gi.repository import Gtk
25
19
from bzrlib.config import GlobalConfig
26
from identity import IdentityPage
27
from plugins import PluginsPage
28
from notifications import NotificationsPage
20
from bzrlib.plugins.gtk.preferences.identity import IdentityPage
21
from bzrlib.plugins.gtk.preferences.plugins import PluginsPage
22
from bzrlib.plugins.gtk.preferences.notifications import NotificationsPage
30
class PreferencesWindow(gtk.Dialog):
24
class PreferencesWindow(Gtk.Dialog):
31
25
"""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
26
# Note that we don't allow configuration of aliases or
27
# default log formats. This is because doing so wouldn't make
28
# a lot of sense to pure GUI users. Users that need these settings
35
29
# will already be familiar with the configuration file.
37
31
def __init__(self, config=None):
38
32
""" Initialize the Status window. """
39
super(PreferencesWindow, self).__init__(flags=gtk.DIALOG_MODAL)
33
super(PreferencesWindow, self).__init__(flags=Gtk.DialogFlags.MODAL)
40
34
self.set_title("Bazaar Preferences")
41
self.set_has_separator(False)
42
35
self.config = config
43
36
if self.config is None:
44
37
self.config = GlobalConfig()
48
41
self.set_default_size(320, 480)
49
42
self.set_border_width(0)
51
notebook = gtk.Notebook()
44
notebook = Gtk.Notebook()
52
45
notebook.set_border_width(12)
53
46
for (label, page) in self._create_pages():
54
notebook.append_page(page, gtk.Label(label))
47
notebook.append_page(page, Gtk.Label(label=label))
56
49
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)
50
content_area = self.get_content_area()
51
content_area.set_border_width(0)
52
content_area.pack_start(notebook, True, True, 0)
53
content_area.show_all()
54
self.get_action_area().set_border_width(12)
62
56
def _create_pages(self):
63
return [("Identity", IdentityPage(self.config)),
57
return [("Identity", IdentityPage(self.config)),
64
58
("Plugins", PluginsPage()),
65
59
("Notifications", NotificationsPage(self.config))]
70
64
def close(self, widget=None):
71
65
self.window.destroy()
73
class BranchPreferencesWindow(gtk.Dialog):
68
class BranchPreferencesWindow(Gtk.Dialog):
74
69
"""Displays global preferences windows."""
75
70
def __init__(self, config=None):
76
71
super(BranchPreferencesWindow, self).__init__(config)