diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2018-03-21 09:49:31 +0000 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2018-03-21 09:59:35 +0000 |
commit | 46ddf4f5d96974d5129567a4c94a311ed586121d (patch) | |
tree | 67ab81cfb07fe2299a0d9edb43094034332ee01f /src/backend-dbus | |
parent | 5a695ecb884f2c97ba1065e95d8d2ee28d8671f7 (diff) | |
download | ayatana-indicator-session-46ddf4f5d96974d5129567a4c94a311ed586121d.tar.gz ayatana-indicator-session-46ddf4f5d96974d5129567a4c94a311ed586121d.tar.bz2 ayatana-indicator-session-46ddf4f5d96974d5129567a4c94a311ed586121d.zip |
my_desktop_help(): Don't always fallback to empty yelp call, rather show a warning that we don't know how to access the currently running desktop's user guide or help center.
Diffstat (limited to 'src/backend-dbus')
-rw-r--r-- | src/backend-dbus/actions.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/backend-dbus/actions.c b/src/backend-dbus/actions.c index a8699de..1b104cf 100644 --- a/src/backend-dbus/actions.c +++ b/src/backend-dbus/actions.c @@ -100,6 +100,19 @@ prompt_status_t; static gboolean +have_gnome_program (const gchar *program) +{ + g_auto(GStrv) desktop_names = NULL; + + if (is_gnome()) { + g_autofree gchar *path = g_find_program_in_path (program); + return path != NULL; + } + + return FALSE; +} + +static gboolean have_mate_program (const gchar *program) { g_auto(GStrv) desktop_names = NULL; @@ -974,7 +987,9 @@ my_desktop_help (IndicatorSessionActions * self G_GNUC_UNUSED) { static char * browser = NULL; - if (have_mate_program ("yelp")) + if (have_gnome_program ("yelp")) + run_outside_app ("yelp help:gnome-user-guide"); + else if (have_mate_program ("yelp")) run_outside_app ("yelp help:mate-user-guide"); else if (is_xfce()) { @@ -984,7 +999,9 @@ my_desktop_help (IndicatorSessionActions * self G_GNUC_UNUSED) run_outside_app(g_strdup_printf("%s '%s'", browser, "https://docs.xfce.org/")); } else - run_outside_app ("yelp"); + zenity_warning ("dialog-warning", + _("Warning"), + _("The Ayatana Session Indicator does not know yet, how to show\nthe currently running desktop's user guide or help center.\n\nPlease report this to the developers at:\nhttps://github.com/ArcticaProject/ayatana-indicator-session/issues")); } static void |