[network-manager-applet/lr/gapplication: 4/4] connection-editor: add "New connection" to the app menu
- From: Lubomir Rintel <lkundrak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-applet/lr/gapplication: 4/4] connection-editor: add "New connection" to the app menu
- Date: Thu, 17 May 2018 16:15:32 +0000 (UTC)
commit 0b19b4b60fa707f909cc447f02ed10e7e08833cb
Author: Lubomir Rintel <lkundrak v3 sk>
Date: Thu May 17 17:29:00 2018 +0200
connection-editor: add "New connection" to the app menu
Just so that the Quit action is not lonely. Also, we can now use the
Ctrl+N accelerator.
src/connection-editor/gtk/menus-appmenu.ui | 7 +++++++
src/connection-editor/main.c | 9 +++++++++
2 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/src/connection-editor/gtk/menus-appmenu.ui b/src/connection-editor/gtk/menus-appmenu.ui
index 8f9750a..5ce2537 100644
--- a/src/connection-editor/gtk/menus-appmenu.ui
+++ b/src/connection-editor/gtk/menus-appmenu.ui
@@ -3,6 +3,13 @@
<menu id="app-menu">
<section>
<item>
+ <attribute name="label" translatable="yes">_New Connection</attribute>
+ <attribute name="action">app.create</attribute>
+ <attribute name="accel"><Primary>n</attribute>
+ </item>
+ </section>
+ <section>
+ <item>
<attribute name="label" translatable="yes">_Quit</attribute>
<attribute name="action">app.quit</attribute>
<attribute name="accel"><Primary>q</attribute>
diff --git a/src/connection-editor/main.c b/src/connection-editor/main.c
index 3d743b6..29facda 100644
--- a/src/connection-editor/main.c
+++ b/src/connection-editor/main.c
@@ -167,6 +167,14 @@ signal_handler (gpointer user_data)
}
static void
+create_activated (GSimpleAction *action, GVariant *parameter, gpointer user_data)
+{
+ GApplication *application = G_APPLICATION (user_data);
+
+ handle_arguments (application, NULL, TRUE, FALSE, NULL, NULL, FALSE);
+}
+
+static void
quit_activated (GSimpleAction *action, GVariant *parameter, gpointer user_data)
{
GApplication *application = G_APPLICATION (user_data);
@@ -176,6 +184,7 @@ quit_activated (GSimpleAction *action, GVariant *parameter, gpointer user_data)
static GActionEntry app_entries[] =
{
+ { "create", create_activated, NULL, NULL, NULL },
{ "quit", quit_activated, NULL, NULL, NULL },
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]