diff options
author | Robert Ancell <robert.ancell@canonical.com> | 2014-01-22 17:47:22 +0000 |
---|---|---|
committer | Tarmac <Unknown> | 2014-01-22 17:47:22 +0000 |
commit | 590627a06eec781ad43fdd0a35ccb6333864e7c1 (patch) | |
tree | ccb8ba23913022c761ba0ab2b43e525188462e4b /src/backend-dbus | |
parent | cf046c6cc7707602f3e5d0a51c6d2152f06849f9 (diff) | |
parent | 610119bccb3d0db6f2c5920ad25c9736032fe477 (diff) | |
download | ayatana-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.
Diffstat (limited to 'src/backend-dbus')
-rw-r--r-- | src/backend-dbus/actions.c | 31 |
1 files changed, 28 insertions, 3 deletions
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"); } /*** |