Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

Start adding new menu entry #9

Draft
wants to merge 1 commit into
base: xenial
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/actions.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 2 additions & 0 deletions src/actions.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
7 changes: 7 additions & 0 deletions src/backend-dbus/actions.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;
Expand Down
10 changes: 10 additions & 0 deletions src/service.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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 },
Expand Down