/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to preferences/__init__.py

  • Committer: Jelmer Vernooij
  • Date: 2011-04-10 18:44:39 UTC
  • mto: This revision was merged to the branch mainline in revision 730.
  • Revision ID: jelmer@samba.org-20110410184439-g7hqaacexqtviq13
Move i18n support to a separate file, so gettext files aren't loaded unless bzr-gtk is used.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
import gtk
24
24
 
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
28
29
 
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.
35
36
 
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()
43
45
        self._create()
44
 
        self._create_pages()
45
 
 
46
46
 
47
47
    def _create(self):
48
 
        self.set_default_size(600, 600)
 
48
        self.set_default_size(320, 480)
 
49
        self.set_border_width(0)
 
50
 
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))
 
55
 
 
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)
54
61
 
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))]
58
66
 
59
67
    def display(self):
60
68
        self.window.show_all()