aboutsummaryrefslogtreecommitdiffstats
path: root/src/redshift-gtk/statusicon.py
diff options
context:
space:
mode:
authorJon Lund Steffensen <jonlst@gmail.com>2017-07-30 20:17:19 -0700
committerJon Lund Steffensen <jonlst@gmail.com>2017-07-30 20:21:52 -0700
commitd84e7b1b3ff871891665e63aaad66ae4ed670aa4 (patch)
tree85f2d31e2c70fdfedd1d7f8f5eaddb03e6c61eec /src/redshift-gtk/statusicon.py
parentcontroller: Emit signal when stopped (diff)
downloadredshift-ng-d84e7b1b3ff871891665e63aaad66ae4ed670aa4.tar.gz
redshift-ng-d84e7b1b3ff871891665e63aaad66ae4ed670aa4.tar.bz2
redshift-ng-d84e7b1b3ff871891665e63aaad66ae4ed670aa4.tar.xz
statusicon: Only add autostart control when supported
Diffstat (limited to 'src/redshift-gtk/statusicon.py')
-rw-r--r--src/redshift-gtk/statusicon.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/redshift-gtk/statusicon.py b/src/redshift-gtk/statusicon.py
index 1dd8970..a6bbf7f 100644
--- a/src/redshift-gtk/statusicon.py
+++ b/src/redshift-gtk/statusicon.py
@@ -87,16 +87,17 @@ class RedshiftStatusIcon(object):
self.status_menu.append(suspend_menu_item)
# Add autostart option
- autostart_item = Gtk.CheckMenuItem.new_with_label(_('Autostart'))
- try:
- autostart_item.set_active(utils.get_autostart())
- except IOError as strerror:
- print(strerror)
- autostart_item.set_property('sensitive', False)
- else:
- autostart_item.connect('toggled', self.autostart_cb)
- finally:
- self.status_menu.append(autostart_item)
+ if utils.supports_autostart():
+ autostart_item = Gtk.CheckMenuItem.new_with_label(_('Autostart'))
+ try:
+ autostart_item.set_active(utils.get_autostart())
+ except IOError as strerror:
+ print(strerror)
+ autostart_item.set_property('sensitive', False)
+ else:
+ autostart_item.connect('toggled', self.autostart_cb)
+ finally:
+ self.status_menu.append(autostart_item)
# Add info action
info_item = Gtk.MenuItem.new_with_label(_('Info'))