Commit 5d0fcdfa authored by Jeremy Bicha's avatar Jeremy Bicha 🎹 Committed by Daniel García Moreno

Fix loading help

This should fix the Help link for Linux (& BSD).

The help loading code is overly complex for Linux
and might not help much for Windows and OS X.
I expect Windows and OS X are still broken after
this change but I don't have the ability to check there.

Closes: https://bugzilla.gnome.org/697406
parent 52bee94b
......@@ -57,7 +57,6 @@ set_defines = [
# package
['PACKAGE', meson.project_name()],
['PACKAGE_DATADIR', gtr_datadir],
['PACKAGE_HELPDIR', join_paths(gtr_datadir, 'gnome', 'help')],
['PACKAGE_LIBDIR', gtr_libdir],
['PACKAGE_LOCALEDIR', gtr_localedir],
['PACKAGE_URL', 'https://wiki.gnome.org/Apps/Gtranslator'],
......
......@@ -37,7 +37,7 @@
void
gtr_show_help (GtrWindow *window)
{
gtr_utils_help_display (GTK_WINDOW (window), "gtranslator", "gtranslator.xml");
gtr_utils_help_display (GTK_WINDOW (window), "gtranslator", "");
}
/* Creates and shows the about box for gtranslator */
......
......@@ -76,7 +76,7 @@ gtr_dirs_init ()
if (gtr_data_dir == NULL)
{
gtr_data_dir = g_build_filename (PACKAGE_DATADIR, "gtranslator", NULL);
gtr_help_dir = g_build_filename (PACKAGE_HELPDIR, "gnome", "help", NULL);
gtr_help_dir = g_build_filename (PACKAGE_DATADIR, "help", NULL);
gtr_locale_dir = g_build_filename (PACKAGE_LOCALEDIR, "locale", NULL);
gtr_lib_dir = g_build_filename (PACKAGE_LIBDIR, "gtranslator", NULL);
}
......
......@@ -494,8 +494,8 @@ gtr_utils_help_display (GtkWindow * parent,
continue;
path = gtr_dirs_get_gtr_help_dir ();
uri = g_build_filename (path, doc_id,
lang, file_name, NULL);
uri = g_build_filename (path, lang,
doc_id, file_name, NULL);
if (g_file_test (uri, G_FILE_TEST_EXISTS))
{
......@@ -522,7 +522,9 @@ gtr_utils_help_display (GtkWindow * parent,
return;
}
command = g_strconcat ("gnome-help help://", uri, NULL);
/* Should be updated to use gtk_show_uri instead, see
* https://wiki.gnome.org/Initiatives/GnomeGoals/RemoveGnomeOpenGnomeHelp */
command = g_strconcat ("yelp ", uri, NULL);
g_free (uri);
g_spawn_command_line_async (command, &error);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment