[Xfce4-commits] [xfce/thunar-volman] 01/01: Use new show help function instead of thunar help (bug #10204)

noreply at xfce.org noreply at xfce.org
Thu Feb 26 16:16:53 CET 2015


This is an automated email from the git hooks/post-receive script.

hjudt pushed a commit to branch master
in repository xfce/thunar-volman.

commit 8d3cc36034cefa5f4f5edd0b90d0a8cbedbadf8f
Author: Harald Judt <h.judt at gmx.at>
Date:   Thu Feb 26 16:15:12 2015 +0100

    Use new show help function instead of thunar help (bug #10204)
---
 configure.ac.in                                 |   10 +++
 thunar-volman-settings/tvm-preferences-dialog.c |   75 +++--------------------
 2 files changed, 18 insertions(+), 67 deletions(-)

diff --git a/configure.ac.in b/configure.ac.in
index 9b4e33f..bcfd2e8 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -108,6 +108,16 @@ dnl *******************************************************
 XDT_CHECK_OPTIONAL_PACKAGE([LIBNOTIFY], [libnotify], [0.4.0], [notifications], 
                            [Notifications support], [yes])
 
+dnl ***************************************************
+dnl *** define a version string for the help dialog ***
+dnl ***************************************************
+m4_append([tvm_version_help], ["])
+m4_append([tvm_version_help], [tvm_version_major])
+m4_append([tvm_version_help], [.])
+m4_append([tvm_version_help], [tvm_version_minor])
+m4_append([tvm_version_help], ["])
+AC_DEFINE([TVM_VERSION_HELP], [tvm_version_help], [Version string for help dialog])
+
 dnl ***********************************
 dnl *** Check for debugging support ***
 dnl ***********************************
diff --git a/thunar-volman-settings/tvm-preferences-dialog.c b/thunar-volman-settings/tvm-preferences-dialog.c
index fb82ce4..62646f6 100644
--- a/thunar-volman-settings/tvm-preferences-dialog.c
+++ b/thunar-volman-settings/tvm-preferences-dialog.c
@@ -692,76 +692,17 @@ static void
 tvm_preferences_dialog_help_clicked (GtkWidget            *button,
                                      TvmPreferencesDialog *dialog)
 {
-  GtkWidget *message;
-  GError    *err = NULL;
-  gchar    **argv;
-  gchar     *bindir;
-  gchar     *prefix;
-  gchar     *path;
-
   g_return_if_fail (GTK_IS_BUTTON (button));
   g_return_if_fail (TVM_IS_PREFERENCES_DIALOG (dialog));
 
-  /* try to locate Thunar in the $PATH */
-  path = g_find_program_in_path ("Thunar");
-  if (G_UNLIKELY (path == NULL))
-    path = g_find_program_in_path ("thunar");
-  if (G_LIKELY (path != NULL))
-    {
-      bindir = g_path_get_dirname (path);
-      prefix = g_path_get_dirname (bindir);
-      g_free (bindir);
-      g_free (path);
-
-      /* now check if ThunarHelp is in $prefix/libexec */
-      path = g_build_filename (prefix, "libexec", "ThunarHelp", NULL);
-      if (!g_file_test (path, G_FILE_TEST_IS_EXECUTABLE))
-        {
-          /* release path */
-          g_free (path);
-
-          /* try to support Debian weirdness */
-          path = g_build_filename (prefix, "lib", "thunar", "ThunarHelp", NULL);
-          if (!g_file_test (path, G_FILE_TEST_IS_EXECUTABLE))
-            {
-              /* release path */
-              g_free (path);
-              path = NULL;
-            }
-        }
-    }
-
-  /* no ThunarHelp, weird! */
-  if (G_UNLIKELY (path == NULL))
-    path = g_strdup ("ThunarHelp");
-
-  /* prepare command to run help */
-  argv = g_new (gchar *, 4);
-  argv[0] = path;
-  argv[1] = g_strdup ("using-removable-media");
-  argv[2] = g_strdup ("management-of-removable-drives-and-media");
-  argv[3] = NULL;
-
-  /* try to open the user manual */
-  if (!gdk_spawn_on_screen (gtk_widget_get_screen (button), NULL, argv, NULL, 
-                            G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &err))
-    {
-      /* display an error message to the user */
-      message = gtk_message_dialog_new (GTK_WINDOW (dialog),
-                                        GTK_DIALOG_DESTROY_WITH_PARENT
-                                        | GTK_DIALOG_MODAL,
-                                        GTK_MESSAGE_ERROR,
-                                        GTK_BUTTONS_CLOSE,
-                                        _("Failed to open the documentation browser"));
-      gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (message), "%s", 
-                                                err->message);
-      gtk_dialog_run (GTK_DIALOG (message));
-      gtk_widget_destroy (message);
-      g_error_free (err);
-    }
-
-  /* cleanup */
-  g_strfreev (argv);
+#if LIBXFCE4UI_CHECK_VERSION(4, 11, 1)
+  xfce_dialog_show_help_with_version (GTK_WINDOW (dialog), "thunar",
+                                      "using-removable-media", NULL,
+                                      TVM_VERSION_HELP);
+#else
+  xfce_dialog_show_help (GTK_WINDOW (dialog), "thunar",
+                         "using-removable-media", NULL);
+#endif
 }
 
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list