/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: Vincent Ladeuil
  • Date: 2008-05-05 18:16:46 UTC
  • mto: (487.1.1 gtk)
  • mto: This revision was merged to the branch mainline in revision 490.
  • Revision ID: v.ladeuil+lp@free.fr-20080505181646-n95l8ltw2u6jtr26
Fix bug #187283 fix replacing _() by _i18n().

* genpot.sh 
Remove duplication. Add the ability to specify the genrated pot
file on command-line for debugging purposes.

* po/olive-gtk.pot:
Regenerated.

* __init__.py, branch.py, branchview/treeview.py, checkout.py,
commit.py, conflicts.py, diff.py, errors.py, initialize.py,
merge.py, nautilus-bzr.py, olive/__init__.py, olive/add.py,
olive/bookmark.py, olive/guifiles.py, olive/info.py,
olive/menu.py, olive/mkdir.py, olive/move.py, olive/remove.py,
olive/rename.py, push.py, revbrowser.py, status.py, tags.py:
Replace all calls to _() by calls to _i18n(), the latter being
defined in __init__.py and imported in the other modules from
there. This fix the problem encountered countless times when
running bzr selftest and getting silly error messages about
boolean not being callables.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
16
16
 
17
 
from gi.repository import Gtk
 
17
try:
 
18
    import pygtk
 
19
    pygtk.require("2.0")
 
20
except:
 
21
    pass
 
22
 
 
23
import gtk
18
24
 
19
25
from bzrlib.config import GlobalConfig
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
 
26
from identity import IdentityPage
 
27
from plugins import PluginsPage
23
28
 
24
 
class PreferencesWindow(Gtk.Dialog):
 
29
class PreferencesWindow(gtk.Dialog):
25
30
    """Displays global preferences windows."""
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
 
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 
29
34
    # will already be familiar with the configuration file.
30
35
 
31
36
    def __init__(self, config=None):
32
37
        """ Initialize the Status window. """
33
 
        super(PreferencesWindow, self).__init__(flags=Gtk.DialogFlags.MODAL)
 
38
        super(PreferencesWindow, self).__init__(flags=gtk.DIALOG_MODAL)
34
39
        self.set_title("Bazaar Preferences")
35
40
        self.config = config
36
41
        if self.config is None:
37
42
            self.config = GlobalConfig()
38
43
        self._create()
 
44
        self._create_pages()
 
45
 
39
46
 
40
47
    def _create(self):
41
 
        self.set_default_size(320, 480)
42
 
        self.set_border_width(0)
43
 
 
44
 
        notebook = Gtk.Notebook()
45
 
        notebook.set_border_width(12)
 
48
        self.set_default_size(600, 600)
 
49
        notebook = gtk.Notebook()
46
50
        for (label, page) in self._create_pages():
47
 
            notebook.append_page(page, Gtk.Label(label=label))
48
 
 
49
 
        notebook.set_current_page(0)
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)
 
51
            notebook.insert_page(page, gtk.Label(label))
 
52
        self.vbox.pack_start(notebook, True, True)
 
53
        self.vbox.show_all()
55
54
 
56
55
    def _create_pages(self):
57
 
        return [("Identity", IdentityPage(self.config)),
58
 
                ("Plugins", PluginsPage()),
59
 
                ("Notifications", NotificationsPage(self.config))]
 
56
        return [("Identity", IdentityPage(self.config)), 
 
57
                ("Plugins", PluginsPage())]
60
58
 
61
59
    def display(self):
62
60
        self.window.show_all()
64
62
    def close(self, widget=None):
65
63
        self.window.destroy()
66
64
 
67
 
 
68
 
class BranchPreferencesWindow(Gtk.Dialog):
 
65
class BranchPreferencesWindow(gtk.Dialog):
69
66
    """Displays global preferences windows."""
70
67
    def __init__(self, config=None):
71
68
        super(BranchPreferencesWindow, self).__init__(config)