[eog] Use unity-control-center if in Unity



commit be3689eb49cdd2b8cd810a7f6eb5b6c7318108f1
Author: Rober Ancell <robert ancell canonical com>
Date:   Wed Jan 15 15:44:59 2014 +1300

    Use unity-control-center if in Unity

 src/eog-window.c |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/src/eog-window.c b/src/eog-window.c
index bc3c876..c5fdd36 100644
--- a/src/eog-window.c
+++ b/src/eog-window.c
@@ -2711,12 +2711,21 @@ wallpaper_info_bar_response (GtkInfoBar *bar, gint response, EogWindow *window)
 {
        if (response == GTK_RESPONSE_YES) {
                GAppInfo *app_info;
+               gchar *path;
                GError *error = NULL;
 
-               app_info = g_app_info_create_from_commandline ("gnome-control-center background",
-                                                              "System Settings",
-                                                              G_APP_INFO_CREATE_NONE,
-                                                              &error);
+               path = g_find_program_in_path ("unity-control-center");
+               if (path && g_strcmp0 (g_getenv ("XDG_CURRENT_DESKTOP"), "Unity") == 0)
+                       app_info = g_app_info_create_from_commandline ("unity-control-center appearance",
+                                                                      "System Settings",
+                                                                      G_APP_INFO_CREATE_NONE,
+                                                                      &error);
+               else
+                       app_info = g_app_info_create_from_commandline ("gnome-control-center background",
+                                                                      "System Settings",
+                                                                      G_APP_INFO_CREATE_NONE,
+                                                                      &error);
+               g_free (path);
 
                if (error != NULL) {
                        g_warning ("%s%s", _("Error launching System Settings: "),


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]