[file-roller] app menu: added 'New Archive'
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [file-roller] app menu: added 'New Archive'
- Date: Fri, 10 Aug 2012 11:37:25 +0000 (UTC)
commit c459d1904fcfe925a01a8f44398fad33b475b1e7
Author: Paolo Bacchilega <paobac src gnome org>
Date: Fri Aug 10 13:27:35 2012 +0200
app menu: added 'New Archive'
src/main.c | 15 +++++++++++++++
src/ui/app-menu.ui | 8 +++++++-
2 files changed, 22 insertions(+), 1 deletions(-)
---
diff --git a/src/main.c b/src/main.c
index 895732f..46a695f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -113,6 +113,20 @@ static const GOptionEntry options[] = {
static void
+activate_new (GSimpleAction *action,
+ GVariant *parameter,
+ gpointer user_data)
+{
+ GApplication *application = user_data;
+ GList *windows;
+
+ windows = gtk_application_get_windows (GTK_APPLICATION (application));
+ if (windows != NULL)
+ activate_action_new (NULL, windows->data);
+}
+
+
+static void
activate_help (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
@@ -150,6 +164,7 @@ activate_quit (GSimpleAction *action,
static const GActionEntry app_menu_entries[] = {
+ { "new", activate_new },
{ "help", activate_help },
{ "about", activate_about },
{ "quit", activate_quit }
diff --git a/src/ui/app-menu.ui b/src/ui/app-menu.ui
index 47c6027..ab10fb3 100644
--- a/src/ui/app-menu.ui
+++ b/src/ui/app-menu.ui
@@ -2,6 +2,12 @@
<menu id="app-menu">
<section>
<item>
+ <attribute name="action">app.new</attribute>
+ <attribute name="label" translatable="yes">_New Archive</attribute>
+ </item>
+ </section>
+ <section>
+ <item>
<attribute name="action">app.help</attribute>
<attribute name="label" translatable="yes">_Help</attribute>
</item>
@@ -15,4 +21,4 @@
</item>
</section>
</menu>
-</interface>
\ No newline at end of file
+</interface>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]