From 98d1379784757b63e317bcd9ac7af69836e473d9 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Fri, 12 Jul 2013 02:03:13 -0500 Subject: Add a 'can-reboot' property to the Actions class. This is used for handling a couple of pathological cases where features and states mix and match: 1. unity has the same dialog for 'reboot' and 'power off', so remove the duplicate menuitem, EXCEPT: 2. if the unity prompt isn't available (such as in the greeter), show both menuitems, OR 3. if the user has prompting disabled we need both, OR 4. if the user has the 'power off' button disabled, don't treat 'reboot' as redundant. --- tests/backend-mock-actions.c | 7 +++++++ tests/com.canonical.indicator.session.backendmock.gschema.xml | 4 ++++ 2 files changed, 11 insertions(+) (limited to 'tests') diff --git a/tests/backend-mock-actions.c b/tests/backend-mock-actions.c index d5a506b..af4afd9 100644 --- a/tests/backend-mock-actions.c +++ b/tests/backend-mock-actions.c @@ -43,6 +43,12 @@ my_can_logout (IndicatorSessionActions * self G_GNUC_UNUSED) return g_settings_get_boolean (mock_settings, "can-logout"); } +static gboolean +my_can_reboot (IndicatorSessionActions * self G_GNUC_UNUSED) +{ + return g_settings_get_boolean (mock_settings, "can-reboot"); +} + static gboolean my_can_switch (IndicatorSessionActions * self G_GNUC_UNUSED) { @@ -177,6 +183,7 @@ indicator_session_actions_mock_class_init (IndicatorSessionActionsMockClass * kl actions_class = INDICATOR_SESSION_ACTIONS_CLASS (klass); actions_class->can_lock = my_can_lock; actions_class->can_logout = my_can_logout; + actions_class->can_reboot = my_can_reboot; actions_class->can_switch = my_can_switch; actions_class->can_suspend = my_can_suspend; actions_class->can_hibernate = my_can_hibernate; diff --git a/tests/com.canonical.indicator.session.backendmock.gschema.xml b/tests/com.canonical.indicator.session.backendmock.gschema.xml index 34479df..79d0c02 100644 --- a/tests/com.canonical.indicator.session.backendmock.gschema.xml +++ b/tests/com.canonical.indicator.session.backendmock.gschema.xml @@ -21,6 +21,10 @@ true Is logging out allowed? + + true + Is rebooting allowed? + true Is locking the session allowed? -- cgit v1.2.3