/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: Jelmer Vernooij
  • Date: 2011-12-20 16:16:57 UTC
  • Revision ID: jelmer@canonical.com-20111220161657-zjn6rqjrw8ouehf8
Drop support for old bencode location.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 
31
31
class NotifyPopupMenu(Gtk.Menu):
32
32
 
33
 
    SHOW_WIDGETS = True
34
 
 
35
33
    def __init__(self):
36
34
        super(NotifyPopupMenu, self).__init__()
37
35
        self.create_items()
48
46
        except ImportError:
49
47
            item.set_sensitive(False)
50
48
        except errors.BzrError:
51
 
            # FIXME: Should only catch errors that indicate a lan-notify
 
49
            # FIXME: Should only catch errors that indicate a lan-notify 
52
50
            # process is already running.
53
51
            item.set_sensitive(False)
54
52
 
64
62
        except ImportError:
65
63
            item.set_sensitive(False)
66
64
 
67
 
        item = Gtk.ImageMenuItem.new_from_stock(Gtk.STOCK_PREFERENCES, None)
 
65
        item = Gtk.ImageMenuItem(Gtk.STOCK_PREFERENCES, None)
68
66
        item.connect('activate', self.show_preferences)
69
67
        self.append(item)
70
 
        item = Gtk.ImageMenuItem.new_from_stock(Gtk.STOCK_ABOUT, None)
 
68
        item = Gtk.ImageMenuItem(Gtk.STOCK_ABOUT, None)
71
69
        item.connect('activate', self.show_about)
72
70
        self.append(item)
73
71
        self.append(Gtk.SeparatorMenuItem())
74
 
        item = Gtk.ImageMenuItem.new_from_stock(Gtk.STOCK_QUIT, None)
 
72
        item = Gtk.ImageMenuItem(Gtk.STOCK_QUIT, None)
75
73
        item.connect('activate', Gtk.main_quit)
76
74
        self.append(item)
77
 
        if self.SHOW_WIDGETS:
78
 
            self.show_all()
 
75
        self.show_all()
79
76
 
80
77
    def display(self, icon, event_button, event_time):
81
 
        self.popup(None, None, Gtk.status_icon_position_menu,
 
78
        self.popup(None, None, Gtk.status_icon_position_menu, 
82
79
               event_button, event_time, icon)
83
80
 
84
81
    def toggle_lan_gateway(self, item):
102
99
        from bzrlib.plugins.gtk.preferences import PreferencesWindow
103
100
        prefs = PreferencesWindow()
104
101
        prefs.run()
 
102