[devhelp] App: use automatic GtkApplication resource for the help-overlay
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [devhelp] App: use automatic GtkApplication resource for the help-overlay
- Date: Sun, 17 Dec 2017 19:16:23 +0000 (UTC)
commit 8eb9bb3ead32efdf3c230f16fdf24e77c2e4e313
Author: Sébastien Wilmet <swilmet gnome org>
Date: Sun Dec 17 19:13:43 2017 +0100
App: use automatic GtkApplication resource for the help-overlay
src/dh-app.c | 40 ----------------------------------------
src/dh-window.ui | 2 +-
src/dh.gresource.xml | 2 +-
src/help-overlay.ui | 2 +-
src/menus.ui | 2 +-
5 files changed, 4 insertions(+), 44 deletions(-)
---
diff --git a/src/dh-app.c b/src/dh-app.c
index 4965c91..09552dd 100644
--- a/src/dh-app.c
+++ b/src/dh-app.c
@@ -73,42 +73,6 @@ preferences_cb (GSimpleAction *action,
}
static void
-shortcuts_cb (GSimpleAction *action,
- GVariant *parameter,
- gpointer user_data)
-{
- DhApp *app = DH_APP (user_data);
- static GtkWidget *shortcuts_window;
- GtkWindow *window;
-
- window = dh_app_peek_first_window (app);
-
- if (shortcuts_window == NULL)
- {
- GtkBuilder *builder;
-
- builder = gtk_builder_new_from_resource ("/org/gnome/devhelp/help-overlay.ui");
- shortcuts_window = GTK_WIDGET (gtk_builder_get_object (builder, "help_overlay"));
-
- g_signal_connect (shortcuts_window,
- "destroy",
- G_CALLBACK (gtk_widget_destroyed),
- &shortcuts_window);
-
- g_object_unref (builder);
- }
-
- if (GTK_WINDOW (window) != gtk_window_get_transient_for (GTK_WINDOW (shortcuts_window)))
- {
- gtk_window_set_transient_for (GTK_WINDOW (shortcuts_window), GTK_WINDOW (window));
- }
-
- gtk_widget_show_all (shortcuts_window);
- gtk_window_present (GTK_WINDOW (shortcuts_window));
-}
-
-
-static void
about_cb (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
@@ -243,7 +207,6 @@ add_action_entries (DhApp *app)
/* General actions */
{ "new-window", new_window_cb },
{ "preferences", preferences_cb },
- { "shortcuts", shortcuts_cb },
{ "about", about_cb },
{ "quit", quit_cb },
@@ -302,9 +265,6 @@ setup_accelerators (GtkApplication *app)
accels[0] = "F10";
gtk_application_set_accels_for_action (app, "win.gear-menu", accels);
- accels[0] = "<Primary>F1";
- gtk_application_set_accels_for_action (app, "app.shortcuts", accels);
-
accels[0] = "<Alt>Right";
accels[1] = "Forward";
gtk_application_set_accels_for_action (app, "win.go-forward", accels);
diff --git a/src/dh-window.ui b/src/dh-window.ui
index 2846a01..7163714 100644
--- a/src/dh-window.ui
+++ b/src/dh-window.ui
@@ -93,7 +93,7 @@
<section>
<item>
<attribute name="label" translatable="yes">_Keyboard Shortcuts</attribute>
- <attribute name="action">app.shortcuts</attribute>
+ <attribute name="action">win.show-help-overlay</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_About Devhelp</attribute>
diff --git a/src/dh.gresource.xml b/src/dh.gresource.xml
index f5e9d32..6f58d06 100644
--- a/src/dh.gresource.xml
+++ b/src/dh.gresource.xml
@@ -4,9 +4,9 @@
<file preprocess="xml-stripblanks">dh-assistant.ui</file>
<file preprocess="xml-stripblanks">dh-preferences.ui</file>
<file preprocess="xml-stripblanks">dh-window.ui</file>
- <file compressed="true" preprocess="xml-stripblanks">help-overlay.ui</file>
</gresource>
<gresource prefix="/org/gnome/devhelp/gtk">
+ <file preprocess="xml-stripblanks">help-overlay.ui</file>
<file preprocess="xml-stripblanks">menus.ui</file>
</gresource>
</gresources>
diff --git a/src/help-overlay.ui b/src/help-overlay.ui
index a68b6f4..7c9b8cc 100644
--- a/src/help-overlay.ui
+++ b/src/help-overlay.ui
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
- <requires lib="gtk+" version="3.19"/>
+ <requires lib="gtk+" version="3.20"/>
<object class="GtkShortcutsWindow" id="help_overlay">
<property name="modal">1</property>
<child>
diff --git a/src/menus.ui b/src/menus.ui
index 79018dc..13a5f4d 100644
--- a/src/menus.ui
+++ b/src/menus.ui
@@ -41,7 +41,7 @@
<section>
<item>
<attribute name="label" translatable="yes">_Keyboard Shortcuts</attribute>
- <attribute name="action">app.shortcuts</attribute>
+ <attribute name="action">win.show-help-overlay</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_About</attribute>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]