Description: Use pre-installed Ubuntu Desktop Guide instead of GNOME help when
 running Unity
Forwarded: not-needed
Author: Jeremy Bicha <jbicha@ubuntu.com>
Index: gnome-control-center-3.6.2/panels/bluetooth/cc-bluetooth-panel.c
===================================================================
--- gnome-control-center-3.6.2.orig/panels/bluetooth/cc-bluetooth-panel.c	2012-11-02 19:29:55.031315523 -0400
+++ gnome-control-center-3.6.2/panels/bluetooth/cc-bluetooth-panel.c	2012-11-02 19:29:57.639315414 -0400
@@ -72,7 +72,10 @@
 static const char *
 cc_bluetooth_panel_get_help_uri (CcPanel *panel)
 {
-  return "help:gnome-help/bluetooth";
+  if (!g_strcmp0(g_getenv("XDG_CURRENT_DESKTOP"), "Unity"))
+    return "help:ubuntu-help/bluetooth";
+  else
+    return "help:gnome-help/bluetooth";
 }
 
 static void
Index: gnome-control-center-3.6.2/panels/color/cc-color-panel.c
===================================================================
--- gnome-control-center-3.6.2.orig/panels/color/cc-color-panel.c	2012-11-02 19:29:55.031315523 -0400
+++ gnome-control-center-3.6.2/panels/color/cc-color-panel.c	2012-11-02 19:30:52.679313112 -0400
@@ -2285,7 +2285,10 @@
 static const char *
 cc_color_panel_get_help_uri (CcPanel *panel)
 {
-  return "help:gnome-help/color";
+  if (!g_strcmp0(g_getenv("XDG_CURRENT_DESKTOP"), "Unity"))
+    return "help:ubuntu-help/color";
+  else
+    return "help:gnome-help/color";
 }
 
 static void
@@ -2567,6 +2570,12 @@
   g_signal_connect (widget, "realize",
                     G_CALLBACK (gcm_prefs_window_realize_cb),
                     prefs);
+
+  widget = WID (priv->builder, "linkbutton_help");
+  if (!g_strcmp0(g_getenv("XDG_CURRENT_DESKTOP"), "Unity"))
+    g_object_set (G_OBJECT (widget),
+              "uri", "help:ubuntu-help/color-whyimportant",
+              NULL);
 }
 
 void
Index: gnome-control-center-3.6.2/panels/datetime/cc-datetime-panel.c
===================================================================
--- gnome-control-center-3.6.2.orig/panels/datetime/cc-datetime-panel.c	2012-11-02 19:29:55.031315523 -0400
+++ gnome-control-center-3.6.2/panels/datetime/cc-datetime-panel.c	2012-11-02 19:29:57.639315414 -0400
@@ -178,7 +178,10 @@
 static const char *
 cc_date_time_panel_get_help_uri (CcPanel *panel)
 {
-  return "help:gnome-help/clock";
+  if (!g_strcmp0(g_getenv("XDG_CURRENT_DESKTOP"), "Unity"))
+    return "help:ubuntu-help/clock";
+  else
+    return "help:gnome-help/clock";
 }
 
 static void
Index: gnome-control-center-3.6.2/panels/display/cc-display-panel.c
===================================================================
--- gnome-control-center-3.6.2.orig/panels/display/cc-display-panel.c	2012-11-02 19:29:55.031315523 -0400
+++ gnome-control-center-3.6.2/panels/display/cc-display-panel.c	2012-11-02 19:29:57.643315414 -0400
@@ -205,7 +205,10 @@
 static const char *
 cc_display_panel_get_help_uri (CcPanel *panel)
 {
-  return "help:gnome-help/prefs-display";
+  if (!g_strcmp0(g_getenv("XDG_CURRENT_DESKTOP"), "Unity"))
+    return "help:ubuntu-help/prefs-display";
+  else
+    return "help:gnome-help/prefs-display";
 }
 
 static void
Index: gnome-control-center-3.6.2/panels/mouse/cc-mouse-panel.c
===================================================================
--- gnome-control-center-3.6.2.orig/panels/mouse/cc-mouse-panel.c	2012-11-02 19:29:55.031315523 -0400
+++ gnome-control-center-3.6.2/panels/mouse/cc-mouse-panel.c	2012-11-02 19:29:57.643315414 -0400
@@ -107,7 +107,10 @@
 static const char *
 cc_mouse_panel_get_help_uri (CcPanel *panel)
 {
-  return "help:gnome-help/mouse";
+  if (!g_strcmp0(g_getenv("XDG_CURRENT_DESKTOP"), "Unity"))
+    return "help:ubuntu-help/mouse";
+  else
+    return "help:gnome-help/mouse";
 }
 
 static void
Index: gnome-control-center-3.6.2/panels/network/cc-network-panel.c
===================================================================
--- gnome-control-center-3.6.2.orig/panels/network/cc-network-panel.c	2012-11-02 19:29:55.031315523 -0400
+++ gnome-control-center-3.6.2/panels/network/cc-network-panel.c	2012-11-02 19:29:57.643315414 -0400
@@ -232,7 +232,10 @@
 static const char *
 cc_network_panel_get_help_uri (CcPanel *panel)
 {
-	return "help:gnome-help/net";
+        if (!g_strcmp0(g_getenv("XDG_CURRENT_DESKTOP"), "Unity"))
+            return "help:ubuntu-help/net";
+        else
+            return "help:gnome-help/net";
 }
 
 static void
Index: gnome-control-center-3.6.2/panels/online-accounts/cc-online-accounts-panel.c
===================================================================
--- gnome-control-center-3.6.2.orig/panels/online-accounts/cc-online-accounts-panel.c	2012-11-02 19:29:55.031315523 -0400
+++ gnome-control-center-3.6.2/panels/online-accounts/cc-online-accounts-panel.c	2012-11-02 19:29:57.643315414 -0400
@@ -256,7 +256,10 @@
 static const char *
 goa_panel_get_help_uri (CcPanel *panel)
 {
-  return "help:gnome-help/accounts";
+  if (!g_strcmp0(g_getenv("XDG_CURRENT_DESKTOP"), "Unity"))
+    return "help:ubuntu-help/accounts";
+  else
+    return "help:gnome-help/accounts";
 }
 
 static void
Index: gnome-control-center-3.6.2/panels/power/cc-power-panel.c
===================================================================
--- gnome-control-center-3.6.2.orig/panels/power/cc-power-panel.c	2012-11-02 19:29:55.031315523 -0400
+++ gnome-control-center-3.6.2/panels/power/cc-power-panel.c	2012-11-02 19:29:57.647315413 -0400
@@ -124,7 +124,10 @@
 static const char *
 cc_power_panel_get_help_uri (CcPanel *panel)
 {
-  return "help:gnome-help/power";
+  if (!g_strcmp0(g_getenv("XDG_CURRENT_DESKTOP"), "Unity"))
+    return "help:ubuntu-help/power";
+  else
+    return "help:gnome-help/power";
 }
 
 static void
Index: gnome-control-center-3.6.2/panels/printers/cc-printers-panel.c
===================================================================
--- gnome-control-center-3.6.2.orig/panels/printers/cc-printers-panel.c	2012-11-02 19:29:55.031315523 -0400
+++ gnome-control-center-3.6.2/panels/printers/cc-printers-panel.c	2012-11-02 19:29:57.647315413 -0400
@@ -251,7 +251,10 @@
 static const char *
 cc_printers_panel_get_help_uri (CcPanel *panel)
 {
-  return "help:gnome-help/printing";
+  if (!g_strcmp0(g_getenv("XDG_CURRENT_DESKTOP"), "Unity"))
+    return "help:ubuntu-help/printing";
+  else
+    return "help:gnome-help/printing";
 }
 
 static void
Index: gnome-control-center-3.6.2/panels/screen/cc-screen-panel.c
===================================================================
--- gnome-control-center-3.6.2.orig/panels/screen/cc-screen-panel.c	2012-11-02 19:29:55.031315523 -0400
+++ gnome-control-center-3.6.2/panels/screen/cc-screen-panel.c	2012-11-02 19:29:57.647315413 -0400
@@ -146,7 +146,10 @@
 static const char *
 cc_screen_panel_get_help_uri (CcPanel *panel)
 {
-  return "help:gnome-help/prefs-display";
+  if (!g_strcmp0(g_getenv("XDG_CURRENT_DESKTOP"), "Unity"))
+    return "help:ubuntu-help/prefs-display";
+  else
+    return "help:gnome-help/prefs-display";
 }
 
 static void
Index: gnome-control-center-3.6.2/panels/sound/cc-sound-panel.c
===================================================================
--- gnome-control-center-3.6.2.orig/panels/sound/cc-sound-panel.c	2012-11-02 19:29:55.031315523 -0400
+++ gnome-control-center-3.6.2/panels/sound/cc-sound-panel.c	2012-11-02 19:29:57.647315413 -0400
@@ -70,7 +70,10 @@
 static const char *
 cc_sound_panel_get_help_uri (CcPanel *panel)
 {
-  return "help:gnome-help/media#sound";
+  if (!g_strcmp0(g_getenv("XDG_CURRENT_DESKTOP"), "Unity"))
+    return "help:ubuntu-help/media#sound";
+  else
+    return "help:gnome-help/media#sound";
 }
 
 static void
Index: gnome-control-center-3.6.2/panels/universal-access/cc-ua-panel.c
===================================================================
--- gnome-control-center-3.6.2.orig/panels/universal-access/cc-ua-panel.c	2012-11-02 19:29:55.031315523 -0400
+++ gnome-control-center-3.6.2/panels/universal-access/cc-ua-panel.c	2012-11-02 19:29:57.651315413 -0400
@@ -159,7 +159,10 @@
 static const char *
 cc_ua_panel_get_help_uri (CcPanel *panel)
 {
-  return "help:gnome-help/a11y";
+  if (!g_strcmp0(g_getenv("XDG_CURRENT_DESKTOP"), "Unity"))
+    return "help:ubuntu-help/a11y";
+  else
+    return "help:gnome-help/a11y";
 }
 
 static void
Index: gnome-control-center-3.6.2/panels/user-accounts/um-password-dialog.c
===================================================================
--- gnome-control-center-3.6.2.orig/panels/user-accounts/um-password-dialog.c	2012-11-02 19:29:55.031315523 -0400
+++ gnome-control-center-3.6.2/panels/user-accounts/um-password-dialog.c	2012-11-02 19:29:57.651315413 -0400
@@ -523,9 +523,14 @@
 
         widget = (GtkWidget *) gtk_builder_get_object (builder, "password-normal-strength-hints-label");
         old_label = gtk_label_get_label (GTK_LABEL (widget));
-        label = g_strdup_printf ("<a href=\"%s\">%s</a>",
-                                 "help:gnome-help/user-goodpassword",
-                                 old_label);
+        if (!g_strcmp0(g_getenv("XDG_CURRENT_DESKTOP"), "Unity"))
+            label = g_strdup_printf ("<a href=\"%s\">%s</a>",
+                                 "help:ubuntu-help/user-goodpassword",
+                                  old_label);
+        else
+            label = g_strdup_printf ("<a href=\"%s\">%s</a>",
+                                  "help:gnome-help/user-goodpassword",
+                                  old_label);
         gtk_label_set_markup (GTK_LABEL (widget), label);
         g_free (label);
 
Index: gnome-control-center-3.6.2/panels/user-accounts/um-user-panel.c
===================================================================
--- gnome-control-center-3.6.2.orig/panels/user-accounts/um-user-panel.c	2012-11-02 19:29:55.031315523 -0400
+++ gnome-control-center-3.6.2/panels/user-accounts/um-user-panel.c	2012-11-02 19:29:57.651315413 -0400
@@ -1372,7 +1372,10 @@
 static const char *
 um_user_panel_get_help_uri (CcPanel *panel)
 {
-	return "help:gnome-help/user-accounts";
+ if (!g_strcmp0(g_getenv("XDG_CURRENT_DESKTOP"), "Unity"))
+   return "help:ubuntu-help/user-accounts";
+ else
+ return "help:gnome-help/user-accounts";
 }
 
 static void
Index: gnome-control-center-3.6.2/panels/wacom/cc-wacom-panel.c
===================================================================
--- gnome-control-center-3.6.2.orig/panels/wacom/cc-wacom-panel.c	2012-11-02 19:29:55.031315523 -0400
+++ gnome-control-center-3.6.2/panels/wacom/cc-wacom-panel.c	2012-11-02 19:29:57.651315413 -0400
@@ -123,7 +123,10 @@
 static const char *
 cc_wacom_panel_get_help_uri (CcPanel *panel)
 {
-  return "help:gnome-help/wacom";
+  if (!g_strcmp0(g_getenv("XDG_CURRENT_DESKTOP"), "Unity"))
+    return "help:ubuntu-help/wacom";
+  else
+    return "help:gnome-help/wacom";
 }
 
 static void
Index: gnome-control-center-3.6.2/shell/control-center.c
===================================================================
--- gnome-control-center-3.6.2.orig/shell/control-center.c	2012-11-02 19:29:55.031315523 -0400
+++ gnome-control-center-3.6.2/shell/control-center.c	2012-11-02 19:30:16.431314628 -0400
@@ -175,8 +175,12 @@
 
   if (panel)
     uri = cc_panel_get_help_uri (panel);
-
-  gtk_show_uri (gtk_widget_get_screen (window),
+    if (!g_strcmp0(g_getenv("XDG_CURRENT_DESKTOP"), "Unity"))
+      gtk_show_uri (gtk_widget_get_screen (window),
+                uri ? uri : "help:ubuntu-help/prefs",
+                GDK_CURRENT_TIME, NULL);
+    else
+      gtk_show_uri (gtk_widget_get_screen (window),
                 uri ? uri : "help:gnome-help/prefs",
                 GDK_CURRENT_TIME, NULL);
 }
