diff --git a/src/actions.c b/src/actions.c index a5597793..bcb77003 100644 --- a/src/actions.c +++ b/src/actions.c @@ -297,6 +297,14 @@ indicator_session_actions_bug (IndicatorSessionActions * self) INDICATOR_SESSION_ACTIONS_GET_CLASS (self)->bug (self); } +void +indicator_session_actions_take_screenshot (IndicatorSessionActions * self) +{ + g_return_if_fail (INDICATOR_IS_SESSION_ACTIONS (self)); + + INDICATOR_SESSION_ACTIONS_GET_CLASS (self)->take_screenshot (self); +} + void indicator_session_actions_about (IndicatorSessionActions * self) { diff --git a/src/actions.h b/src/actions.h index cc8bb383..6ec51b6a 100644 --- a/src/actions.h +++ b/src/actions.h @@ -77,6 +77,7 @@ struct _IndicatorSessionActionsClass void (*power_off) (IndicatorSessionActions * self); void (*help) (IndicatorSessionActions * self); void (*bug) (IndicatorSessionActions * self); + void (*take_screenshot) (IndicatorSessionActions * self); void (*about) (IndicatorSessionActions * self); void (*settings) (IndicatorSessionActions * self); void (*online_accounts) (IndicatorSessionActions * self); @@ -122,6 +123,7 @@ void indicator_session_actions_power_off (IndicatorSession void indicator_session_actions_help (IndicatorSessionActions * self); void indicator_session_actions_bug (IndicatorSessionActions * self); +void indicator_session_actions_take_screenshot (IndicatorSessionActions * self); void indicator_session_actions_about (IndicatorSessionActions * self); void indicator_session_actions_settings (IndicatorSessionActions * self); void indicator_session_actions_online_accounts (IndicatorSessionActions * self); diff --git a/src/backend-dbus/actions.c b/src/backend-dbus/actions.c index c50c7894..28308a69 100644 --- a/src/backend-dbus/actions.c +++ b/src/backend-dbus/actions.c @@ -846,6 +846,12 @@ my_bug (IndicatorSessionActions * self G_GNUC_UNUSED) run_outside_app ("firefox https://github.com/ubports/ubports-touch/issues"); } +static void +my_take_screenshot (IndicatorSessionActions * self G_GNUC_UNUSED) +{ + +} + static gboolean have_unity_control_center (void) { @@ -1076,6 +1082,7 @@ indicator_session_actions_dbus_class_init (IndicatorSessionActionsDbusClass * kl actions_class->online_accounts = my_online_accounts; actions_class->help = my_help; actions_class->bug = my_bug; + actions_class->take_screenshot = my_take_screenshot; actions_class->about = my_about; actions_class->switch_to_screensaver = my_switch_to_screensaver; actions_class->switch_to_greeter = my_switch_to_greeter; diff --git a/src/service.c b/src/service.c index e0dcd576..20fb58c5 100644 --- a/src/service.c +++ b/src/service.c @@ -464,6 +464,7 @@ create_admin_section (IndicatorSessionService * self) g_menu_append (menu, help_label, "indicator.help"); g_free (help_label); g_menu_append (menu, _("Report a bug"), "indicator.bug"); + g_menu_append (menu, _("Take a screenshot"), "indicator.take_screenshot"); if (p->usage_mode_action && g_getenv ("MIR_SOCKET") != NULL) // only under unity8 { @@ -955,6 +956,14 @@ on_bug_activated (GSimpleAction * a G_GNUC_UNUSED, indicator_session_actions_bug (get_backend_actions(gself)); } +static void +on_take_screenshot_activated (GSimpleAction * a G_GNUC_UNUSED, + GVariant * param G_GNUC_UNUSED, + gpointer gself) +{ + indicator_session_actions_take_screenshot (get_backend_actions(gself)); +} + static void on_settings_activated (GSimpleAction * a G_GNUC_UNUSED, GVariant * param G_GNUC_UNUSED, @@ -1048,6 +1057,7 @@ init_gactions (IndicatorSessionService * self) { "about", on_about_activated }, { "help", on_help_activated }, { "bug", on_bug_activated }, + { "take-screenshot", on_take_screenshot_activated }, { "hibernate", on_hibernate_activated }, { "logout", on_logout_activated }, { "online-accounts", on_online_accounts_activated },