[gnome-latex] App: implement "help" action in the liblatexila
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-latex] App: implement "help" action in the liblatexila
- Date: Tue, 28 Apr 2020 16:38:08 +0000 (UTC)
commit bb69f22c32a425bf46f2af21cc874c799447b92d
Author: Sébastien Wilmet <swilmet gnome org>
Date: Tue Apr 28 18:32:18 2020 +0200
App: implement "help" action in the liblatexila
src/glatex_app.vala | 15 ---------------
src/liblatexila/latexila-app.c | 27 +++++++++++++++++++++++++++
2 files changed, 27 insertions(+), 15 deletions(-)
---
diff --git a/src/glatex_app.vala b/src/glatex_app.vala
index 185abca..db8143a 100644
--- a/src/glatex_app.vala
+++ b/src/glatex_app.vala
@@ -28,7 +28,6 @@ public class GlatexApp : Latexila.App
{ "new-document", new_document_cb },
{ "preferences", preferences_cb },
{ "manage-build-tools", manage_build_tools_cb },
- { "help", help_cb },
{ "quit", quit_cb }
};
@@ -165,20 +164,6 @@ public class GlatexApp : Latexila.App
new BuildToolsPreferences (get_active_main_window ());
}
- private void help_cb ()
- {
- MainWindow? window = get_active_main_window ();
-
- try
- {
- Latexila.utils_show_uri (window, "help:gnome-latex", Gdk.CURRENT_TIME);
- }
- catch (Error e)
- {
- warning ("Impossible to open the documentation: %s", e.message);
- }
- }
-
private void quit_cb ()
{
hold ();
diff --git a/src/liblatexila/latexila-app.c b/src/liblatexila/latexila-app.c
index 90fafa3..d5053c8 100644
--- a/src/liblatexila/latexila-app.c
+++ b/src/liblatexila/latexila-app.c
@@ -69,12 +69,39 @@ about_activate_cb (GSimpleAction *about_action,
NULL);
}
+static void
+help_activate_cb (GSimpleAction *help_action,
+ GVariant *parameter,
+ gpointer user_data)
+{
+ LatexilaApp *app = LATEXILA_APP (user_data);
+ TeplApplication *tepl_app = tepl_application_get_from_gtk_application (GTK_APPLICATION (app));
+ GtkApplicationWindow *active_main_window;
+ GError *error = NULL;
+
+ active_main_window = tepl_application_get_active_main_window (tepl_app);
+
+ gtk_show_uri_on_window (GTK_WINDOW (active_main_window),
+ "help:gnome-latex",
+ GDK_CURRENT_TIME,
+ &error);
+
+ if (error != NULL)
+ {
+ tepl_utils_show_warning_dialog (GTK_WINDOW (active_main_window),
+ _("Impossible to open the documentation: %s"),
+ error->message);
+ g_clear_error (&error);
+ }
+}
+
static void
add_action_entries (LatexilaApp *app)
{
const GActionEntry app_entries[] =
{
{ "about", about_activate_cb },
+ { "help", help_activate_cb },
};
amtk_action_map_add_action_entries_check_dups (G_ACTION_MAP (app),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]