/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: Curtis Hovey
  • Date: 2011-07-31 15:52:43 UTC
  • mto: This revision was merged to the branch mainline in revision 741.
  • Revision ID: sinzui.is@verizon.net-20110731155243-ln8istmxbryhb4pz
Mechanical changes made by pygi.convert.sh.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
except:
23
23
    pass
24
24
 
25
 
import gtk
 
25
from gi.repository import Gtk
26
26
import bzrlib
27
27
 
28
28
 
34
34
    return (getattr(bzrlib.plugins, "avahi", None) is not None)
35
35
 
36
36
 
37
 
class NotifyPopupMenu(gtk.Menu):
 
37
class NotifyPopupMenu(Gtk.Menu):
38
38
 
39
39
    def __init__(self):
40
40
        super(NotifyPopupMenu, self).__init__()
42
42
 
43
43
    def create_items(self):
44
44
        from bzrlib import errors
45
 
        item = gtk.CheckMenuItem('_Gateway to LAN')
 
45
        item = Gtk.CheckMenuItem('_Gateway to LAN')
46
46
        item.connect('toggled', self.toggle_lan_gateway)
47
47
        self.append(item)
48
 
        self.append(gtk.SeparatorMenuItem())
 
48
        self.append(Gtk.SeparatorMenuItem())
49
49
        try:
50
50
            from bzrlib.plugins.dbus.activity import LanGateway
51
51
            self.langateway = LanGateway()
56
56
            # process is already running.
57
57
            item.set_sensitive(False)
58
58
 
59
 
        item = gtk.CheckMenuItem('Announce _branches on LAN')
 
59
        item = Gtk.CheckMenuItem('Announce _branches on LAN')
60
60
        item.connect('toggled', self.toggle_announce_branches)
61
61
        self.append(item)
62
 
        self.append(gtk.SeparatorMenuItem())
 
62
        self.append(Gtk.SeparatorMenuItem())
63
63
        try:
64
64
            from bzrlib.plugins.avahi.share import ZeroConfServer
65
65
            from bzrlib import urlutils
67
67
        except ImportError:
68
68
            item.set_sensitive(False)
69
69
 
70
 
        item = gtk.ImageMenuItem(gtk.STOCK_PREFERENCES, None)
 
70
        item = Gtk.ImageMenuItem(Gtk.STOCK_PREFERENCES, None)
71
71
        item.connect('activate', self.show_preferences)
72
72
        self.append(item)
73
 
        item = gtk.ImageMenuItem(gtk.STOCK_ABOUT, None)
 
73
        item = Gtk.ImageMenuItem(Gtk.STOCK_ABOUT, None)
74
74
        item.connect('activate', self.show_about)
75
75
        self.append(item)
76
 
        self.append(gtk.SeparatorMenuItem())
77
 
        item = gtk.ImageMenuItem(gtk.STOCK_QUIT, None)
78
 
        item.connect('activate', gtk.main_quit)
 
76
        self.append(Gtk.SeparatorMenuItem())
 
77
        item = Gtk.ImageMenuItem(Gtk.STOCK_QUIT, None)
 
78
        item.connect('activate', Gtk.main_quit)
79
79
        self.append(item)
80
80
        self.show_all()
81
81
 
82
82
    def display(self, icon, event_button, event_time):
83
 
        self.popup(None, None, gtk.status_icon_position_menu, 
 
83
        self.popup(None, None, Gtk.status_icon_position_menu, 
84
84
               event_button, event_time, icon)
85
85
 
86
86
    def toggle_lan_gateway(self, item):