~bzr/ubuntu/karmic/bzr-gtk/bzr-ppa

« back to all changes in this revision

Viewing changes to notify.py

  • Committer: Jelmer Vernooij
  • Date: 2010-03-03 14:10:25 UTC
  • mto: (0.274.35 trunk)
  • mto: This revision was merged to the branch mainline in revision 58.
  • Revision ID: jelmer@samba.org-20100303141025-rz53ongyh8miv3q5
Don't crash when there is already a lan-notify instance running.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
        self.create_items()
41
41
 
42
42
    def create_items(self):
 
43
        from bzrlib import errors
43
44
        item = gtk.CheckMenuItem('_Gateway to LAN')
44
45
        item.connect('toggled', self.toggle_lan_gateway)
45
46
        self.append(item)
49
50
            self.langateway = LanGateway()
50
51
        except ImportError:
51
52
            item.set_sensitive(False)
 
53
        except errors.BzrError:
 
54
            # FIXME: Should only catch errors that indicate a lan-notify 
 
55
            # process is already running.
 
56
            item.set_sensitive(False)
52
57
 
53
58
        item = gtk.CheckMenuItem('Announce _branches on LAN')
54
59
        item.connect('toggled', self.toggle_announce_branches)