/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 notify.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:
16
16
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
17
"""Notification area icon and notification for Bazaar."""
18
18
 
19
 
try:
20
 
    import pygtk
21
 
    pygtk.require("2.0")
22
 
except:
23
 
    pass
24
 
 
25
19
import gtk
26
 
import bzrlib
27
 
 
28
 
 
29
 
def has_dbus():
30
 
    return (getattr(bzrlib.plugins, "dbus", None) is not None)
31
 
 
32
 
 
33
 
def has_avahi():
34
 
    return (getattr(bzrlib.plugins, "avahi", None) is not None)
35
 
 
36
20
 
37
21
class NotifyPopupMenu(gtk.Menu):
38
22
    def __init__(self):
40
24
        self.create_items()
41
25
 
42
26
    def create_items(self):
43
 
        item = gtk.CheckMenuItem('_Gateway to LAN')
44
 
        item.connect('toggled', self.toggle_lan_gateway)
45
 
        self.append(item)
46
 
        self.append(gtk.SeparatorMenuItem())
47
27
        try:
48
28
            from bzrlib.plugins.dbus.activity import LanGateway
49
29
            self.langateway = LanGateway()
 
30
            item = gtk.CheckMenuItem('_Gateway to LAN')
 
31
            item.connect('toggled', self.toggle_lan_gateway)
 
32
            self.append(item)
 
33
            self.append(gtk.SeparatorMenuItem())
50
34
        except ImportError:
51
 
            item.set_sensitive(False)
 
35
            pass
52
36
 
53
 
        item = gtk.CheckMenuItem('Announce _branches on LAN')
54
 
        item.connect('toggled', self.toggle_announce_branches)
55
 
        self.append(item)
56
 
        self.append(gtk.SeparatorMenuItem())
57
37
        try:
58
38
            from bzrlib.plugins.avahi.share import ZeroConfServer
59
39
            from bzrlib import urlutils
60
40
            self.zeroconfserver = ZeroConfServer(urlutils.normalize_url('.'))
 
41
            item = gtk.CheckMenuItem('Announce _branches on LAN')
 
42
            item.connect('toggled', self.toggle_announce_branches)
 
43
            self.append(item)
 
44
            self.append(gtk.SeparatorMenuItem())
61
45
        except ImportError:
62
 
            item.set_sensitive(False)
 
46
            pass
63
47
 
64
48
        item = gtk.ImageMenuItem(gtk.STOCK_PREFERENCES, None)
65
49
        item.connect('activate', self.show_preferences)
90
74
            self.zeroconfserver.close()
91
75
 
92
76
    def show_about(self, item):
93
 
        from bzrlib.plugins.gtk.about import AboutDialog
 
77
        from about import AboutDialog
94
78
        dialog = AboutDialog()
95
79
        dialog.run()
96
80
 
97
81
    def show_preferences(self, item):
98
 
        from bzrlib.plugins.gtk.preferences import PreferencesWindow
 
82
        from preferences import PreferencesWindow
99
83
        prefs = PreferencesWindow()
100
84
        prefs.run()
101
85