diff --git a/autoshutdown/data/config.glade b/autoshutdown/data/config.glade index 1f0a9b5..b81f5ba 100644 --- a/autoshutdown/data/config.glade +++ b/autoshutdown/data/config.glade @@ -1,6 +1,6 @@ - + False @@ -26,6 +26,7 @@ False 10 True + True True button_shutdown @@ -43,7 +44,6 @@ False 10 True - True True diff --git a/autoshutdown/gtkui.py b/autoshutdown/gtkui.py index 0b05b65..f1d7355 100644 --- a/autoshutdown/gtkui.py +++ b/autoshutdown/gtkui.py @@ -82,10 +82,17 @@ def on_show_prefs(self): def cb_get_config(self, config): "callback for on show_prefs" log.debug("callback for on show_prefs") - self.glade.get_widget("button_shutdown").set_active("shutdown" in config["system_state"]) - self.glade.get_widget("button_hibernate").set_active("hibernate" in config["system_state"]) - self.glade.get_widget("button_suspend").set_active("suspend" in config["system_state"]) + + self.glade.get_widget("button_shutdown").set_active( + "shutdown" == config["system_state"]) + self.glade.get_widget("button_hibernate").set_active( + "hibernate" == config["system_state"]) + self.glade.get_widget("button_suspend").set_active( + "suspend" == config["system_state"]) self.glade.get_widget("once_check").set_active(config["once"]) - self.glade.get_widget("button_disable").set_active(not config["enabled"]) - self.glade.get_widget("button_hibernate").set_sensitive(config["can_hibernate"]) - self.glade.get_widget("button_suspend").set_sensitive(config["can_suspend"]) + self.glade.get_widget("button_disable").set_active( + not config["enabled"] or not config["system_state"]) + self.glade.get_widget("button_hibernate").set_sensitive( + config["can_hibernate"]) + self.glade.get_widget("button_suspend").set_sensitive( + config["can_suspend"])