aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2014-01-22 17:47:22 +0000
committerTarmac <Unknown>2014-01-22 17:47:22 +0000
commit590627a06eec781ad43fdd0a35ccb6333864e7c1 (patch)
treeccb8ba23913022c761ba0ab2b43e525188462e4b
parentcf046c6cc7707602f3e5d0a51c6d2152f06849f9 (diff)
parent610119bccb3d0db6f2c5920ad25c9736032fe477 (diff)
downloadayatana-indicator-session-590627a06eec781ad43fdd0a35ccb6333864e7c1.tar.gz
ayatana-indicator-session-590627a06eec781ad43fdd0a35ccb6333864e7c1.tar.bz2
ayatana-indicator-session-590627a06eec781ad43fdd0a35ccb6333864e7c1.zip
Use unity-control-center if it is available. Fixes: https://bugs.launchpad.net/bugs/1257505.
Approved by Ted Gould, PS Jenkins bot, Sebastien Bacher.
-rw-r--r--debian/control4
-rw-r--r--src/backend-dbus/actions.c31
2 files changed, 30 insertions, 5 deletions
diff --git a/debian/control b/debian/control
index ae76274..f9be310 100644
--- a/debian/control
+++ b/debian/control
@@ -28,8 +28,8 @@ Depends: ${shlibs:Depends},
Recommends: indicator-applet (>= 0.2) | indicator-renderer,
gnome-screensaver,
yelp,
- gnome-control-center,
- gnome-control-center-signon
+ unity-control-center | gnome-control-center,
+ unity-control-center-signon | gnome-control-center-signon
Suggests: lightdm,
zenity
Description: indicator showing session management, status and user switching
diff --git a/src/backend-dbus/actions.c b/src/backend-dbus/actions.c
index fcf850d..b1fa8ac 100644
--- a/src/backend-dbus/actions.c
+++ b/src/backend-dbus/actions.c
@@ -711,22 +711,47 @@ my_help (IndicatorSessionActions * self G_GNUC_UNUSED)
run_outside_app ("yelp");
}
+static gboolean
+have_unity_control_center (void)
+{
+ gchar *path;
+ gboolean have_ucc;
+
+ if (g_strcmp0 (g_getenv ("XDG_CURRENT_DESKTOP"), "Unity") != 0)
+ return FALSE;
+
+ path = g_find_program_in_path ("unity-control-center");
+ have_ucc = path != NULL;
+ g_free (path);
+
+ return have_ucc;
+}
+
static void
my_settings (IndicatorSessionActions * self G_GNUC_UNUSED)
{
- run_outside_app ("gnome-control-center");
+ if (have_unity_control_center ())
+ run_outside_app ("unity-control-center");
+ else
+ run_outside_app ("gnome-control-center");
}
static void
my_online_accounts (IndicatorSessionActions * self G_GNUC_UNUSED)
{
- run_outside_app ("gnome-control-center credentials");
+ if (have_unity_control_center ())
+ run_outside_app ("unity-control-center credentials");
+ else
+ run_outside_app ("gnome-control-center credentials");
}
static void
my_about (IndicatorSessionActions * self G_GNUC_UNUSED)
{
- run_outside_app ("gnome-control-center info");
+ if (have_unity_control_center ())
+ run_outside_app ("unity-control-center info");
+ else
+ run_outside_app ("gnome-control-center info");
}
/***