diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2017-03-06 17:54:11 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2017-03-06 18:27:27 +0000 |
commit | 1163ed404c64ac2cecf082f2034442a352d69e0f (patch) | |
tree | 4016236d0208a2b07197ebe4efb0d48a6b0c74ec /src | |
parent | 063818c8b0036f7fca00234af544264ac3bb1443 (diff) | |
download | gnome-dictionary-1163ed404c64ac2cecf082f2034442a352d69e0f.tar.gz |
Use gtk_show_uri_on_window() with newer GTK+
The gtk_show_uri() function won't work correctly inside a sandbox, and
has been deprecated in GTK+ 3.22.
Diffstat (limited to 'src')
-rw-r--r-- | src/gdict-app.c | 9 | ||||
-rw-r--r-- | src/gdict-source-dialog.c | 7 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/gdict-app.c b/src/gdict-app.c index e8a6a93..eed2994 100644 --- a/src/gdict-app.c +++ b/src/gdict-app.c @@ -121,9 +121,18 @@ gdict_app_cmd_help (GSimpleAction *action, g_return_if_fail (GTK_IS_APPLICATION (app)); window = GDICT_WINDOW (gtk_application_get_windows (app)->data); + +#if GTK_CHECK_VERSION (3, 22, 0) + gtk_show_uri_on_window (GTK_WINDOW (window), + "help:gnome-dictionary", + gtk_get_current_event_time (), + &err); +#else gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (window)), "help:gnome-dictionary", gtk_get_current_event_time (), &err); +#endif + if (err) { gdict_show_gerror_dialog (GTK_WINDOW (window), diff --git a/src/gdict-source-dialog.c b/src/gdict-source-dialog.c index 10cf0f9..0a01fa6 100644 --- a/src/gdict-source-dialog.c +++ b/src/gdict-source-dialog.c @@ -443,9 +443,16 @@ on_dialog_response (GtkDialog *dialog, break; case GTK_RESPONSE_HELP: +#if GTK_CHECK_VERSION (3, 22, 0) + gtk_show_uri_on_window (GTK_WINDOW (dialog), + "help:gnome-dictionary/gnome-dictionary-add-source", + gtk_get_current_event_time (), &err); +#else gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (dialog)), "help:gnome-dictionary/gnome-dictionary-add-source", gtk_get_current_event_time (), &err); +#endif + if (err) { gdict_show_gerror_dialog (GTK_WINDOW (dialog), |