[gtk/wip/sadiq/fixes] examples: Define Ctrl+Q shortcut in .ui file
- From: Mohammed Sadiq <pksadiq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/sadiq/fixes] examples: Define Ctrl+Q shortcut in .ui file
- Date: Tue, 8 May 2018 12:24:43 +0000 (UTC)
commit 4a542b9bd36989de6c38f6bb498592cb94bdb74f
Author: Mohammed Sadiq <sadiq sadiqpk org>
Date: Tue May 8 17:51:26 2018 +0530
examples: Define Ctrl+Q shortcut in .ui file
examples/application10/app-menu.ui | 1 +
examples/application10/exampleapp.c | 4 ----
examples/application4/app-menu.ui | 1 +
examples/application4/exampleapp.c | 4 ----
examples/application5/app-menu.ui | 1 +
examples/application5/exampleapp.c | 4 ----
examples/application6/app-menu.ui | 1 +
examples/application6/exampleapp.c | 4 ----
examples/application7/app-menu.ui | 1 +
examples/application7/exampleapp.c | 4 ----
examples/application8/app-menu.ui | 1 +
examples/application8/exampleapp.c | 4 ----
examples/application9/app-menu.ui | 1 +
examples/application9/exampleapp.c | 4 ----
14 files changed, 7 insertions(+), 28 deletions(-)
---
diff --git a/examples/application10/app-menu.ui b/examples/application10/app-menu.ui
index e1e131cfca..80da9b1de4 100644
--- a/examples/application10/app-menu.ui
+++ b/examples/application10/app-menu.ui
@@ -12,6 +12,7 @@
<item>
<attribute name="label" translatable="yes">_Quit</attribute>
<attribute name="action">app.quit</attribute>
+ <attribute name="accel"><Primary>Q</attribute>
</item>
</section>
</menu>
diff --git a/examples/application10/exampleapp.c b/examples/application10/exampleapp.c
index 64a3ceb100..bb0abaf161 100644
--- a/examples/application10/exampleapp.c
+++ b/examples/application10/exampleapp.c
@@ -48,16 +48,12 @@ example_app_startup (GApplication *app)
{
GtkBuilder *builder;
GMenuModel *app_menu;
- const gchar *quit_accels[2] = { "<Ctrl>Q", NULL };
G_APPLICATION_CLASS (example_app_parent_class)->startup (app);
g_action_map_add_action_entries (G_ACTION_MAP (app),
app_entries, G_N_ELEMENTS (app_entries),
app);
- gtk_application_set_accels_for_action (GTK_APPLICATION (app),
- "app.quit",
- quit_accels);
builder = gtk_builder_new_from_resource ("/org/gtk/exampleapp/app-menu.ui");
app_menu = G_MENU_MODEL (gtk_builder_get_object (builder, "appmenu"));
diff --git a/examples/application4/app-menu.ui b/examples/application4/app-menu.ui
index e1e131cfca..80da9b1de4 100644
--- a/examples/application4/app-menu.ui
+++ b/examples/application4/app-menu.ui
@@ -12,6 +12,7 @@
<item>
<attribute name="label" translatable="yes">_Quit</attribute>
<attribute name="action">app.quit</attribute>
+ <attribute name="accel"><Primary>Q</attribute>
</item>
</section>
</menu>
diff --git a/examples/application4/exampleapp.c b/examples/application4/exampleapp.c
index 0f01fb388a..818c645702 100644
--- a/examples/application4/exampleapp.c
+++ b/examples/application4/exampleapp.c
@@ -41,16 +41,12 @@ example_app_startup (GApplication *app)
{
GtkBuilder *builder;
GMenuModel *app_menu;
- const gchar *quit_accels[2] = { "<Ctrl>Q", NULL };
G_APPLICATION_CLASS (example_app_parent_class)->startup (app);
g_action_map_add_action_entries (G_ACTION_MAP (app),
app_entries, G_N_ELEMENTS (app_entries),
app);
- gtk_application_set_accels_for_action (GTK_APPLICATION (app),
- "app.quit",
- quit_accels);
builder = gtk_builder_new_from_resource ("/org/gtk/exampleapp/app-menu.ui");
app_menu = G_MENU_MODEL (gtk_builder_get_object (builder, "appmenu"));
diff --git a/examples/application5/app-menu.ui b/examples/application5/app-menu.ui
index e1e131cfca..80da9b1de4 100644
--- a/examples/application5/app-menu.ui
+++ b/examples/application5/app-menu.ui
@@ -12,6 +12,7 @@
<item>
<attribute name="label" translatable="yes">_Quit</attribute>
<attribute name="action">app.quit</attribute>
+ <attribute name="accel"><Primary>Q</attribute>
</item>
</section>
</menu>
diff --git a/examples/application5/exampleapp.c b/examples/application5/exampleapp.c
index 0f01fb388a..818c645702 100644
--- a/examples/application5/exampleapp.c
+++ b/examples/application5/exampleapp.c
@@ -41,16 +41,12 @@ example_app_startup (GApplication *app)
{
GtkBuilder *builder;
GMenuModel *app_menu;
- const gchar *quit_accels[2] = { "<Ctrl>Q", NULL };
G_APPLICATION_CLASS (example_app_parent_class)->startup (app);
g_action_map_add_action_entries (G_ACTION_MAP (app),
app_entries, G_N_ELEMENTS (app_entries),
app);
- gtk_application_set_accels_for_action (GTK_APPLICATION (app),
- "app.quit",
- quit_accels);
builder = gtk_builder_new_from_resource ("/org/gtk/exampleapp/app-menu.ui");
app_menu = G_MENU_MODEL (gtk_builder_get_object (builder, "appmenu"));
diff --git a/examples/application6/app-menu.ui b/examples/application6/app-menu.ui
index e1e131cfca..80da9b1de4 100644
--- a/examples/application6/app-menu.ui
+++ b/examples/application6/app-menu.ui
@@ -12,6 +12,7 @@
<item>
<attribute name="label" translatable="yes">_Quit</attribute>
<attribute name="action">app.quit</attribute>
+ <attribute name="accel"><Primary>Q</attribute>
</item>
</section>
</menu>
diff --git a/examples/application6/exampleapp.c b/examples/application6/exampleapp.c
index 64a3ceb100..bb0abaf161 100644
--- a/examples/application6/exampleapp.c
+++ b/examples/application6/exampleapp.c
@@ -48,16 +48,12 @@ example_app_startup (GApplication *app)
{
GtkBuilder *builder;
GMenuModel *app_menu;
- const gchar *quit_accels[2] = { "<Ctrl>Q", NULL };
G_APPLICATION_CLASS (example_app_parent_class)->startup (app);
g_action_map_add_action_entries (G_ACTION_MAP (app),
app_entries, G_N_ELEMENTS (app_entries),
app);
- gtk_application_set_accels_for_action (GTK_APPLICATION (app),
- "app.quit",
- quit_accels);
builder = gtk_builder_new_from_resource ("/org/gtk/exampleapp/app-menu.ui");
app_menu = G_MENU_MODEL (gtk_builder_get_object (builder, "appmenu"));
diff --git a/examples/application7/app-menu.ui b/examples/application7/app-menu.ui
index e1e131cfca..80da9b1de4 100644
--- a/examples/application7/app-menu.ui
+++ b/examples/application7/app-menu.ui
@@ -12,6 +12,7 @@
<item>
<attribute name="label" translatable="yes">_Quit</attribute>
<attribute name="action">app.quit</attribute>
+ <attribute name="accel"><Primary>Q</attribute>
</item>
</section>
</menu>
diff --git a/examples/application7/exampleapp.c b/examples/application7/exampleapp.c
index 64a3ceb100..bb0abaf161 100644
--- a/examples/application7/exampleapp.c
+++ b/examples/application7/exampleapp.c
@@ -48,16 +48,12 @@ example_app_startup (GApplication *app)
{
GtkBuilder *builder;
GMenuModel *app_menu;
- const gchar *quit_accels[2] = { "<Ctrl>Q", NULL };
G_APPLICATION_CLASS (example_app_parent_class)->startup (app);
g_action_map_add_action_entries (G_ACTION_MAP (app),
app_entries, G_N_ELEMENTS (app_entries),
app);
- gtk_application_set_accels_for_action (GTK_APPLICATION (app),
- "app.quit",
- quit_accels);
builder = gtk_builder_new_from_resource ("/org/gtk/exampleapp/app-menu.ui");
app_menu = G_MENU_MODEL (gtk_builder_get_object (builder, "appmenu"));
diff --git a/examples/application8/app-menu.ui b/examples/application8/app-menu.ui
index e1e131cfca..80da9b1de4 100644
--- a/examples/application8/app-menu.ui
+++ b/examples/application8/app-menu.ui
@@ -12,6 +12,7 @@
<item>
<attribute name="label" translatable="yes">_Quit</attribute>
<attribute name="action">app.quit</attribute>
+ <attribute name="accel"><Primary>Q</attribute>
</item>
</section>
</menu>
diff --git a/examples/application8/exampleapp.c b/examples/application8/exampleapp.c
index 64a3ceb100..bb0abaf161 100644
--- a/examples/application8/exampleapp.c
+++ b/examples/application8/exampleapp.c
@@ -48,16 +48,12 @@ example_app_startup (GApplication *app)
{
GtkBuilder *builder;
GMenuModel *app_menu;
- const gchar *quit_accels[2] = { "<Ctrl>Q", NULL };
G_APPLICATION_CLASS (example_app_parent_class)->startup (app);
g_action_map_add_action_entries (G_ACTION_MAP (app),
app_entries, G_N_ELEMENTS (app_entries),
app);
- gtk_application_set_accels_for_action (GTK_APPLICATION (app),
- "app.quit",
- quit_accels);
builder = gtk_builder_new_from_resource ("/org/gtk/exampleapp/app-menu.ui");
app_menu = G_MENU_MODEL (gtk_builder_get_object (builder, "appmenu"));
diff --git a/examples/application9/app-menu.ui b/examples/application9/app-menu.ui
index e1e131cfca..80da9b1de4 100644
--- a/examples/application9/app-menu.ui
+++ b/examples/application9/app-menu.ui
@@ -12,6 +12,7 @@
<item>
<attribute name="label" translatable="yes">_Quit</attribute>
<attribute name="action">app.quit</attribute>
+ <attribute name="accel"><Primary>Q</attribute>
</item>
</section>
</menu>
diff --git a/examples/application9/exampleapp.c b/examples/application9/exampleapp.c
index 64a3ceb100..bb0abaf161 100644
--- a/examples/application9/exampleapp.c
+++ b/examples/application9/exampleapp.c
@@ -48,16 +48,12 @@ example_app_startup (GApplication *app)
{
GtkBuilder *builder;
GMenuModel *app_menu;
- const gchar *quit_accels[2] = { "<Ctrl>Q", NULL };
G_APPLICATION_CLASS (example_app_parent_class)->startup (app);
g_action_map_add_action_entries (G_ACTION_MAP (app),
app_entries, G_N_ELEMENTS (app_entries),
app);
- gtk_application_set_accels_for_action (GTK_APPLICATION (app),
- "app.quit",
- quit_accels);
builder = gtk_builder_new_from_resource ("/org/gtk/exampleapp/app-menu.ui");
app_menu = G_MENU_MODEL (gtk_builder_get_object (builder, "appmenu"));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]