/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz
171 by Jelmer Vernooij
Initial work on a preferences dialog in GTK+, including a list of plugins with metadata browser.
1
# Copyright (C) 2007 Jelmer Vernooij <jelmer@samba.org>
2
#
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.
7
#
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.
12
#
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
16
734.1.1 by Curtis Hovey
Mechanical changes made by pygi.convert.sh.
17
from gi.repository import Gtk
171 by Jelmer Vernooij
Initial work on a preferences dialog in GTK+, including a list of plugins with metadata browser.
18
19
from bzrlib.config import GlobalConfig
713 by Jelmer Vernooij
Remove some unused imports, fix some formatting.
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
171 by Jelmer Vernooij
Initial work on a preferences dialog in GTK+, including a list of plugins with metadata browser.
23
734.1.1 by Curtis Hovey
Mechanical changes made by pygi.convert.sh.
24
class PreferencesWindow(Gtk.Dialog):
171 by Jelmer Vernooij
Initial work on a preferences dialog in GTK+, including a list of plugins with metadata browser.
25
    """Displays global preferences windows."""
724 by Jelmer Vernooij
Fix formatting, imports.
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
239 by Jelmer Vernooij
Add note about what should and should not be in the preferences dialog.
29
    # will already be familiar with the configuration file.
30
171 by Jelmer Vernooij
Initial work on a preferences dialog in GTK+, including a list of plugins with metadata browser.
31
    def __init__(self, config=None):
32
        """ Initialize the Status window. """
734.1.1 by Curtis Hovey
Mechanical changes made by pygi.convert.sh.
33
        super(PreferencesWindow, self).__init__(flags=Gtk.DialogFlags.MODAL)
171 by Jelmer Vernooij
Initial work on a preferences dialog in GTK+, including a list of plugins with metadata browser.
34
        self.set_title("Bazaar Preferences")
35
        self.config = config
36
        if self.config is None:
37
            self.config = GlobalConfig()
38
        self._create()
39
40
    def _create(self):
615 by rodney.dawes at canonical
* preferences/__init__.py:
41
        self.set_default_size(320, 480)
42
        self.set_border_width(0)
43
734.1.1 by Curtis Hovey
Mechanical changes made by pygi.convert.sh.
44
        notebook = Gtk.Notebook()
615 by rodney.dawes at canonical
* preferences/__init__.py:
45
        notebook.set_border_width(12)
450.3.3 by Jelmer Vernooij
Split identity settings out of main preferences window.
46
        for (label, page) in self._create_pages():
734.1.1 by Curtis Hovey
Mechanical changes made by pygi.convert.sh.
47
            notebook.append_page(page, Gtk.Label(label=label))
615 by rodney.dawes at canonical
* preferences/__init__.py:
48
49
        notebook.set_current_page(0)
734.1.16 by Curtis Hovey
Updated gpreferences to gtk3.
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)
171 by Jelmer Vernooij
Initial work on a preferences dialog in GTK+, including a list of plugins with metadata browser.
55
450.3.3 by Jelmer Vernooij
Split identity settings out of main preferences window.
56
    def _create_pages(self):
724 by Jelmer Vernooij
Fix formatting, imports.
57
        return [("Identity", IdentityPage(self.config)),
619 by Jelmer Vernooij
Add notifications tab in preferences dialog.
58
                ("Plugins", PluginsPage()),
59
                ("Notifications", NotificationsPage(self.config))]
450.3.3 by Jelmer Vernooij
Split identity settings out of main preferences window.
60
171 by Jelmer Vernooij
Initial work on a preferences dialog in GTK+, including a list of plugins with metadata browser.
61
    def display(self):
62
        self.window.show_all()
63
64
    def close(self, widget=None):
65
        self.window.destroy()
213 by Jelmer Vernooij
Show preferences dialog from notify area icon, fix GPG display.
66
734.1.52 by Curtis Hovey
Fixed long lines created by conversion script. removed checks for obsolete methods.
67
734.1.1 by Curtis Hovey
Mechanical changes made by pygi.convert.sh.
68
class BranchPreferencesWindow(Gtk.Dialog):
213 by Jelmer Vernooij
Show preferences dialog from notify area icon, fix GPG display.
69
    """Displays global preferences windows."""
70
    def __init__(self, config=None):
71
        super(BranchPreferencesWindow, self).__init__(config)
72