1
0
mirror of https://github.com/gryf/wicd.git synced 2026-01-06 13:54:17 +01:00

added support for disabling notifications in setup.py

This commit is contained in:
Adam Blackburn
2009-05-05 10:34:44 +08:00
parent ff3d627c55
commit 45b5c4718c
4 changed files with 18 additions and 3 deletions

View File

@@ -156,6 +156,12 @@ class PreferencesDialog(object):
except ImportError:
self.notificationscheckbox.set_active(False)
self.notificationscheckbox.set_sensitive(False)
# if notifications were disabled with the configure flag
if wpath.no_use_notifications:
self.notificationscheckbox.set_active(False)
self.notificationscheckbox.hide()
self.wTree.get_widget('label2').hide()
self.wTree.get_widget("notebook2").set_current_page(0)

View File

@@ -75,6 +75,9 @@ if not hasattr(gtk, "StatusIcon"):
print "Has notifications support", HAS_NOTIFY
if wpath.no_use_notifications:
print 'Notifications disabled during setup.py configure'
misc.RenameProcess("wicd-client")
if __name__ == '__main__':
@@ -266,8 +269,11 @@ class TrayIcon(object):
if not state or not info:
[state, info] = daemon.GetConnectionStatus()
self.should_notify = (self.last_state != state) and \
HAS_NOTIFY and self.use_notify
# should this state change display a notification?
self.should_notify = not wpath.no_use_notifications and \
(self.last_state != state) and \
HAS_NOTIFY and \
self.use_notify
self.last_state = state