diff --git a/in/wicd=wpath.py.in b/in/wicd=wpath.py.in index a4f17ef..d1fbbc1 100755 --- a/in/wicd=wpath.py.in +++ b/in/wicd=wpath.py.in @@ -71,6 +71,7 @@ no_install_kde = %NO_INSTALL_KDE% no_install_acpi = %NO_INSTALL_ACPI% no_install_docs = %NO_INSTALL_DOCS% no_install_ncurses = %NO_INSTALL_NCURSES% +no_use_notifications = %NO_USE_NOTIFICATIONS% def chdir(file): """Change directory to the location of the specified file. diff --git a/setup.py b/setup.py index 4ebc6aa..fdee577 100755 --- a/setup.py +++ b/setup.py @@ -92,7 +92,8 @@ class configure(Command): ('no-install-acpi', None, 'do not install the suspend.d and resume.d acpi scripts'), ('no-install-pmutils', None, 'do not install the pm-utils hooks'), ('no-install-docs', None, 'do not install the auxiliary documentation'), - ('no-install-ncurses', None, 'do not install the ncurses client') + ('no-install-ncurses', None, 'do not install the ncurses client'), + ('no-use-notifications', None, 'do not ever allow the use of libnotify notifications') ] def initialize_options(self): @@ -127,6 +128,7 @@ class configure(Command): self.no_install_pmutils = False self.no_install_docs = False self.no_install_ncurses = False + self.no_use_notifications = False # Determine the default init file location on several different distros diff --git a/wicd/prefs.py b/wicd/prefs.py index 0066a1b..a8da776 100644 --- a/wicd/prefs.py +++ b/wicd/prefs.py @@ -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) diff --git a/wicd/wicd-client.py b/wicd/wicd-client.py index e692612..dc306de 100755 --- a/wicd/wicd-client.py +++ b/wicd/wicd-client.py @@ -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