diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2014-01-27 11:08:35 -0600 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2014-01-27 11:08:35 -0600 |
commit | e9eb4115d28afa01e54e9460791657753a25ef13 (patch) | |
tree | 5c798cbe99c2bfc2c40c6d49f663b2d9891c6805 | |
parent | ef84548e3025184c4f631a23fceefb008dd6968b (diff) | |
parent | 012768daf0bd8bb92a5fe525af359ff659e02134 (diff) | |
download | ayatana-indicator-datetime-e9eb4115d28afa01e54e9460791657753a25ef13.tar.gz ayatana-indicator-datetime-e9eb4115d28afa01e54e9460791657753a25ef13.tar.bz2 ayatana-indicator-datetime-e9eb4115d28afa01e54e9460791657753a25ef13.zip |
merge lp:~robert-ancell/indicator-datetime/call-ucc into lp:indicator-datetime
-rw-r--r-- | data/unity-datetime-panel.desktop.in | 4 | ||||
-rw-r--r-- | src/actions-live.cpp | 15 | ||||
-rw-r--r-- | src/service.c | 16 |
3 files changed, 29 insertions, 6 deletions
diff --git a/data/unity-datetime-panel.desktop.in b/data/unity-datetime-panel.desktop.in index 6e7b252..f3f7c22 100644 --- a/data/unity-datetime-panel.desktop.in +++ b/data/unity-datetime-panel.desktop.in @@ -4,10 +4,10 @@ _Name=Time & Date _Comment=Change your clock and date settings Icon=preferences-system-time TryExec=unity-control-center -Exec=unity-control-center indicator-datetime +Exec=unity-control-center datetime StartupNotify=true Type=Application Categories=GNOME;GTK;Utility;DesktopSettings;Settings;X-GNOME-SystemSettings;X-Unity-Settings-Panel; -X-Unity-Settings-Panel=indicator-datetime +X-Unity-Settings-Panel=datetime OnlyShowIn=Unity; X-Ubuntu-Gettext-Domain=indicator-datetime diff --git a/src/actions-live.cpp b/src/actions-live.cpp index d5f7180..afd83f4 100644 --- a/src/actions-live.cpp +++ b/src/actions-live.cpp @@ -55,11 +55,22 @@ void LiveActions::dispatch_url(const std::string& url) void LiveActions::open_desktop_settings() { + auto path = g_find_program_in_path("unity-control-center"); + + if ((path != nullptr) && (g_strcmp0 (g_getenv ("XDG_CURRENT_DESKTOP"), "Unity") == 0)) + { + execute_command("unity-control-center datetime"); + } + else + { #ifdef HAVE_CCPANEL - execute_command("gnome-control-center indicator-datetime"); + execute_command("gnome-control-center indicator-datetime"); #else - execute_command("gnome-control-center datetime"); + execute_command("gnome-control-center datetime"); #endif + } + + g_free (path); } void LiveActions::open_planner() diff --git a/src/service.c b/src/service.c index 246ea70..746ced9 100644 --- a/src/service.c +++ b/src/service.c @@ -1466,11 +1466,23 @@ on_desktop_settings_activated (GSimpleAction * a G_GNUC_UNUSED, GVariant * param G_GNUC_UNUSED, gpointer gself G_GNUC_UNUSED) { + gchar *path; + + path = g_find_program_in_path ("unity-control-center"); + if (path != NULL && g_strcmp0 (g_getenv ("XDG_CURRENT_DESKTOP"), "Unity") == 0) + { + execute_command ("unity-control-center datetime"); + } + else + { #ifdef HAVE_CCPANEL - execute_command ("gnome-control-center indicator-datetime"); + execute_command ("gnome-control-center indicator-datetime"); #else - execute_command ("gnome-control-center datetime"); + execute_command ("gnome-control-center datetime"); #endif + } + + g_free (path); } static void |