From 4d9589837e532df1015f7579439703c0af0164ca Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Mon, 12 Mar 2018 14:03:05 +0100 Subject: Revert "Drop unnecessary dependency on Ubuntu's url-dispatcher." This reverts commit 0a9cc2a474ff583c928e109468f20330aae0603c. --- src/service.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/service.c') diff --git a/src/service.c b/src/service.c index 22b8dfb..cf7d808 100644 --- a/src/service.c +++ b/src/service.c @@ -20,6 +20,7 @@ #include #include +#include #include "brightness.h" #include "dbus-shared.h" @@ -815,7 +816,12 @@ on_settings_activated (GSimpleAction * a G_GNUC_UNUSED, if (control_center_cmd == NULL) { - if ((!g_strcmp0 (g_getenv ("DESKTOP_SESSION"), "xubuntu")) || (!g_strcmp0 (g_getenv ("DESKTOP_SESSION"), "xfce"))) + if (g_getenv ("MIR_SOCKET") != NULL) + { + url_dispatch_send("settings:///system/battery", NULL, NULL); + return; + } + else if ((!g_strcmp0 (g_getenv ("DESKTOP_SESSION"), "xubuntu")) || (!g_strcmp0 (g_getenv ("DESKTOP_SESSION"), "xfce"))) { control_center_cmd = "xfce4-power-manager-settings"; } @@ -865,6 +871,14 @@ on_statistics_activated (GSimpleAction * a G_GNUC_UNUSED, } } +static void +on_phone_settings_activated (GSimpleAction * a G_GNUC_UNUSED, + GVariant * param G_GNUC_UNUSED, + gpointer gself G_GNUC_UNUSED) +{ + url_dispatch_send("settings:///system/battery", NULL, NULL); +} + /*** **** ***/ @@ -901,6 +915,7 @@ init_gactions (IndicatorPowerService * self) GActionEntry entries[] = { { "activate-settings", on_settings_activated }, + { "activate-phone-settings", on_phone_settings_activated }, { "activate-statistics", on_statistics_activated, "s" } }; -- cgit v1.2.3