From a19955f3f81b1a5eb8fc928bc5dcf8a24bb6833f Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Fri, 12 Jul 2013 07:42:07 -0500 Subject: add the online-accounts action and unit tests for it --- src/actions.c | 8 ++++++++ src/actions.h | 2 ++ src/backend-dbus/actions.c | 10 ++++++++++ src/service.c | 29 +++++++++++++++++++---------- 4 files changed, 39 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/actions.c b/src/actions.c index ca086b7..563f626 100644 --- a/src/actions.c +++ b/src/actions.c @@ -249,6 +249,14 @@ indicator_session_actions_has_online_account_error (IndicatorSessionActions * se **** ***/ +void +indicator_session_actions_online_accounts (IndicatorSessionActions * self) +{ + g_return_if_fail (INDICATOR_IS_SESSION_ACTIONS (self)); + + INDICATOR_SESSION_ACTIONS_GET_CLASS (self)->online_accounts (self); +} + void indicator_session_actions_settings (IndicatorSessionActions * self) { diff --git a/src/actions.h b/src/actions.h index 0f8aa1d..e31685e 100644 --- a/src/actions.h +++ b/src/actions.h @@ -78,6 +78,7 @@ struct _IndicatorSessionActionsClass void (*help) (IndicatorSessionActions * self); void (*about) (IndicatorSessionActions * self); void (*settings) (IndicatorSessionActions * self); + void (*online_accounts) (IndicatorSessionActions * self); void (*switch_to_greeter) (IndicatorSessionActions * self); void (*switch_to_screensaver) (IndicatorSessionActions * self); @@ -121,6 +122,7 @@ void indicator_session_actions_power_off (IndicatorSession void indicator_session_actions_help (IndicatorSessionActions * self); void indicator_session_actions_about (IndicatorSessionActions * self); void indicator_session_actions_settings (IndicatorSessionActions * self); +void indicator_session_actions_online_accounts (IndicatorSessionActions * self); void indicator_session_actions_switch_to_screensaver (IndicatorSessionActions * self); void indicator_session_actions_switch_to_greeter (IndicatorSessionActions * self); diff --git a/src/backend-dbus/actions.c b/src/backend-dbus/actions.c index ed1e708..9030ca7 100644 --- a/src/backend-dbus/actions.c +++ b/src/backend-dbus/actions.c @@ -311,6 +311,9 @@ on_webcredentials_proxy_ready (GObject * o G_GNUC_UNUSED, GAsyncResult * res, gp g_signal_connect_swapped (webcredentials, "notify::error-status", G_CALLBACK(indicator_session_actions_notify_has_online_account_error), gself); + + if (webcredentials_get_error_status (webcredentials)) + indicator_session_actions_notify_has_online_account_error (gself); } log_and_clear_error (&err, G_STRLOC, G_STRFUNC); @@ -714,6 +717,12 @@ my_settings (IndicatorSessionActions * self G_GNUC_UNUSED) run_outside_app ("gnome-control-center"); } +static void +my_online_accounts (IndicatorSessionActions * self G_GNUC_UNUSED) +{ + run_outside_app ("gnome-control-center credentials"); +} + static void my_about (IndicatorSessionActions * self G_GNUC_UNUSED) { @@ -855,6 +864,7 @@ indicator_session_actions_dbus_class_init (IndicatorSessionActionsDbusClass * kl actions_class->reboot = my_reboot; actions_class->power_off = my_power_off; actions_class->settings = my_settings; + actions_class->online_accounts = my_online_accounts; actions_class->help = my_help; actions_class->about = my_about; actions_class->switch_to_screensaver = my_switch_to_screensaver; diff --git a/src/service.c b/src/service.c index 3de37e3..74acd89 100644 --- a/src/service.c +++ b/src/service.c @@ -622,6 +622,14 @@ on_about_activated (GSimpleAction * a G_GNUC_UNUSED, indicator_session_actions_about (get_backend_actions(gself)); } +static void +on_online_accounts_activated (GSimpleAction * a G_GNUC_UNUSED, + GVariant * param G_GNUC_UNUSED, + gpointer gself) +{ + indicator_session_actions_online_accounts (get_backend_actions(gself)); +} + static void on_help_activated (GSimpleAction * a G_GNUC_UNUSED, GVariant * param G_GNUC_UNUSED, @@ -720,16 +728,17 @@ init_gactions (IndicatorSessionService * self) priv_t * p = self->priv; GActionEntry entries[] = { - { "about", on_about_activated }, - { "help", on_help_activated }, - { "settings", on_settings_activated }, - { "logout", on_logout_activated }, - { "suspend", on_suspend_activated }, - { "hibernate", on_hibernate_activated }, - { "reboot", on_reboot_activated }, - { "power-off", on_power_off_activated }, - { "switch-to-screensaver", on_screensaver_activated }, - { "switch-to-greeter", on_greeter_activated } + { "about", on_about_activated }, + { "help", on_help_activated }, + { "hibernate", on_hibernate_activated }, + { "logout", on_logout_activated }, + { "online-accounts", on_online_accounts_activated }, + { "reboot", on_reboot_activated }, + { "settings", on_settings_activated }, + { "switch-to-screensaver", on_screensaver_activated }, + { "switch-to-greeter", on_greeter_activated }, + { "suspend", on_suspend_activated }, + { "power-off", on_power_off_activated } }; p->actions = g_simple_action_group_new (); -- cgit v1.2.3