/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-08-27 18:35:08 UTC
  • mto: This revision was merged to the branch mainline in revision 741.
  • Revision ID: sinzui.is@verizon.net-20110827183508-ugqbp58na4mtt1no
Updated the pixbuf calls to gtk3.

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