[shotwell] Use AppMenu
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [shotwell] Use AppMenu
- Date: Thu, 1 Dec 2016 00:35:27 +0000 (UTC)
commit 6e6a51b3a5b939322e0a40c2f2766367969721c2
Author: Jens Georg <mail jensge org>
Date: Sat Nov 26 10:14:59 2016 +0100
Use AppMenu
Signed-off-by: Jens Georg <mail jensge org>
https://bugzilla.gnome.org/show_bug.cgi?id=719279
src/Application.vala | 4 ++
src/direct/DirectWindow.vala | 2 +
src/library/LibraryWindow.vala | 3 ++
src/org.gnome.Shotwell.gresource.xml | 1 +
ui/appmenu.ui | 67 ++++++++++++++++++++++++++++++++++
ui/direct.ui | 31 ----------------
ui/event.ui | 30 ---------------
ui/events_directory.ui | 37 -------------------
ui/import.ui | 37 -------------------
ui/import_queue.ui | 13 -------
ui/media.ui | 37 -------------------
ui/offline.ui | 37 -------------------
ui/photo.ui | 37 -------------------
ui/tags.ui | 37 -------------------
ui/trash.ui | 37 -------------------
15 files changed, 77 insertions(+), 333 deletions(-)
---
diff --git a/src/Application.vala b/src/Application.vala
index 4a24fd4..6e6ba85 100644
--- a/src/Application.vala
+++ b/src/Application.vala
@@ -103,6 +103,10 @@ public class Application {
get_instance().system_app.set_menubar (model);
}
+ public static void set_appmenu (GLib.MenuModel? model) {
+ get_instance().system_app.set_app_menu (model);
+ }
+
/**
* @brief Signal handler for GApplication's 'command-line' signal.
*
diff --git a/src/direct/DirectWindow.vala b/src/direct/DirectWindow.vala
index e1cbf75..ee1995a 100644
--- a/src/direct/DirectWindow.vala
+++ b/src/direct/DirectWindow.vala
@@ -24,7 +24,9 @@ public class DirectWindow : AppWindow {
layout.pack_start(direct_photo_page, true, true, 0);
layout.pack_end(direct_photo_page.get_toolbar(), false, false, 0);
+ var builder = new Gtk.Builder.from_resource ("/org/gnome/Shotwell/appmenu.ui");
Application.set_menubar (direct_photo_page.get_menubar ());
+ Application.set_appmenu (builder.get_object ("direct-appmenu") as GLib.Menu);
add(layout);
}
diff --git a/src/library/LibraryWindow.vala b/src/library/LibraryWindow.vala
index e6313df..9b71a78 100644
--- a/src/library/LibraryWindow.vala
+++ b/src/library/LibraryWindow.vala
@@ -1187,6 +1187,9 @@ public class LibraryWindow : AppWindow {
add(layout);
+ var builder = new Gtk.Builder.from_resource ("/org/gnome/Shotwell/appmenu.ui");
+ Application.set_appmenu (builder.get_object ("appmenu") as GLib.Menu);
+
switch_to_page(start_page);
start_page.grab_focus();
}
diff --git a/src/org.gnome.Shotwell.gresource.xml b/src/org.gnome.Shotwell.gresource.xml
index abf7eb2..fb9dde9 100644
--- a/src/org.gnome.Shotwell.gresource.xml
+++ b/src/org.gnome.Shotwell.gresource.xml
@@ -6,5 +6,6 @@
<file>tag_sidebar_context.ui</file>
<file>sidebar_default_context.ui</file>
<file>search_bar.ui</file>
+ <file>appmenu.ui</file>
</gresource>
</gresources>
diff --git a/ui/appmenu.ui b/ui/appmenu.ui
new file mode 100644
index 0000000..72e5424
--- /dev/null
+++ b/ui/appmenu.ui
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.20.0 -->
+<interface domain="shotwell">
+ <requires lib="gtk+" version="3.14"/>
+ <menu id="appmenu">
+ <section>
+ <item>
+ <attribute name="label" translatable="yes">_Preferences</attribute>
+ <attribute name="action">win.CommonPreferences</attribute>
+ </item>
+ </section>
+ <section>
+ <item>
+ <attribute name="label" translatable="yes">_Help</attribute>
+ <attribute name="accel">F1</attribute>
+ <attribute name="action">win.CommonHelpContents</attribute>
+ </item>
+ <item>
+ <attribute name="label" translatable="yes">_Frequently Asked Questions</attribute>
+ <attribute name="action">win.CommonHelpFAQ</attribute>
+ </item>
+ <item>
+ <attribute name="label" translatable="yes">_Report a Problem…</attribute>
+ <attribute name="action">win.CommonHelpReportProblem</attribute>
+ </item>
+ <item>
+ <attribute name="label" translatable="yes">_About</attribute>
+ <attribute name="action">win.CommonAbout</attribute>
+ </item>
+ </section>
+ <section>
+ <item>
+ <attribute name="label" translatable="yes">_Quit</attribute>
+ <attribute name="accel"><Primary>q</attribute>
+ <attribute name="action">win.CommonQuit</attribute>
+ </item>
+ </section>
+ </menu>
+ <menu id="direct-appmenu">
+ <section>
+ <item>
+ <attribute name="label" translatable="yes">_Help</attribute>
+ <attribute name="accel">F1</attribute>
+ <attribute name="action">win.CommonHelpContents</attribute>
+ </item>
+ <item>
+ <attribute name="label" translatable="yes">_Frequently Asked Questions</attribute>
+ <attribute name="action">win.CommonHelpFAQ</attribute>
+ </item>
+ <item>
+ <attribute name="label" translatable="yes">_Report a Problem…</attribute>
+ <attribute name="action">win.CommonHelpReportProblem</attribute>
+ </item>
+ <item>
+ <attribute name="label" translatable="yes">_About</attribute>
+ <attribute name="action">win.CommonAbout</attribute>
+ </item>
+ </section>
+ <section>
+ <item>
+ <attribute name="label" translatable="yes">_Quit</attribute>
+ <attribute name="accel"><Primary>q</attribute>
+ <attribute name="action">win.CommonQuit</attribute>
+ </item>
+ </section>
+ </menu>
+</interface>
diff --git a/ui/direct.ui b/ui/direct.ui
index 75acb0f..6053967 100644
--- a/ui/direct.ui
+++ b/ui/direct.ui
@@ -32,13 +32,6 @@
<attribute name="action">win.CommonJumpToFile</attribute>
</item>
</section>
- <section>
- <item>
- <attribute name="label" translatable="yes">_Quit</attribute>
- <attribute name="accel"><Primary>q</attribute>
- <attribute name="action">win.CommonQuit</attribute>
- </item>
- </section>
</submenu>
<submenu>
<attribute name="label" translatable="yes">_Edit</attribute>
@@ -169,29 +162,5 @@
</item>
</section>
</submenu>
- <submenu>
- <attribute name="label" translatable="yes">_Help</attribute>
- <section>
- <item>
- <attribute name="label" translatable="yes">_Help</attribute>
- <attribute name="accel">F1</attribute>
- <attribute name="action">win.CommonHelpContents</attribute>
- </item>
- <item>
- <attribute name="label" translatable="yes">_Frequently Asked Questions</attribute>
- <attribute name="action">win.CommonHelpFAQ</attribute>
- </item>
- <item>
- <attribute name="label" translatable="yes">_Report a Problem…</attribute>
- <attribute name="action">win.CommonHelpReportProblem</attribute>
- </item>
- </section>
- <section>
- <item>
- <attribute name="label" translatable="yes">_About</attribute>
- <attribute name="action">win.CommonAbout</attribute>
- </item>
- </section>
- </submenu>
</menu>
</interface>
diff --git a/ui/event.ui b/ui/event.ui
index 11d9b74..c2bc6cb 100644
--- a/ui/event.ui
+++ b/ui/event.ui
@@ -88,12 +88,6 @@
<attribute name="action">win.CommonSelectAll</attribute>
</item>
</section>
- <section>
- <item>
- <attribute name="label" translatable="yes">_Preferences</attribute>
- <attribute name="action">win.CommonPreferences</attribute>
- </item>
- </section>
</submenu>
<submenu>
<attribute name="label" translatable="yes">_View</attribute>
@@ -414,30 +408,6 @@
</section>
</submenu>
<!-- Faces menu goes here FacesMenuPlaceholder -->
- <submenu>
- <attribute name="label" translatable="yes">_Help</attribute>
- <section>
- <item>
- <attribute name="label" translatable="yes">_Help</attribute>
- <attribute name="accel">F1</attribute>
- <attribute name="action">win.CommonHelpContents</attribute>
- </item>
- <item>
- <attribute name="label" translatable="yes">_Frequently Asked Questions</attribute>
- <attribute name="action">win.CommonHelpFAQ</attribute>
- </item>
- <item>
- <attribute name="label" translatable="yes">_Report a Problem…</attribute>
- <attribute name="action">win.CommonHelpReportProblem</attribute>
- </item>
- </section>
- <section>
- <item>
- <attribute name="label" translatable="yes">_About</attribute>
- <attribute name="action">win.CommonAbout</attribute>
- </item>
- </section>
- </submenu>
</menu>
<menu id="CollectionContextMenu">
<section>
diff --git a/ui/events_directory.ui b/ui/events_directory.ui
index 380da0a..ad4135e 100644
--- a/ui/events_directory.ui
+++ b/ui/events_directory.ui
@@ -20,13 +20,6 @@
<attribute name="action">win.CommonEmptyTrash</attribute>
</item>
</section>
- <section>
- <item>
- <attribute name="label" translatable="yes">_Quit</attribute>
- <attribute name="accel"><Primary>q</attribute>
- <attribute name="action">win.CommonQuit</attribute>
- </item>
- </section>
</submenu>
<submenu>
<attribute name="label" translatable="yes">_Edit</attribute>
@@ -60,12 +53,6 @@
<attribute name="action">win.CommonSelectAll</attribute>
</item>
</section>
- <section>
- <item>
- <attribute name="label" translatable="yes">_Preferences</attribute>
- <attribute name="action">win.CommonPreferences</attribute>
- </item>
- </section>
</submenu>
<submenu>
<attribute name="label" translatable="yes">_View</attribute>
@@ -146,30 +133,6 @@
</item>
</section>
</submenu>
- <submenu>
- <attribute name="label" translatable="yes">_Help</attribute>
- <section>
- <item>
- <attribute name="label" translatable="yes">_Help</attribute>
- <attribute name="accel">F1</attribute>
- <attribute name="action">win.CommonHelpContents</attribute>
- </item>
- <item>
- <attribute name="label" translatable="yes">_Frequently Asked Questions</attribute>
- <attribute name="action">win.CommonHelpFAQ</attribute>
- </item>
- <item>
- <attribute name="label" translatable="yes">_Report a Problem…</attribute>
- <attribute name="action">win.CommonHelpReportProblem</attribute>
- </item>
- </section>
- <section>
- <item>
- <attribute name="label" translatable="yes">_About</attribute>
- <attribute name="action">win.CommonAbout</attribute>
- </item>
- </section>
- </submenu>
</menu>
<menu id="EventsDirectoryContextMenu">
<section>
diff --git a/ui/import.ui b/ui/import.ui
index 522ca7b..af733bc 100644
--- a/ui/import.ui
+++ b/ui/import.ui
@@ -28,13 +28,6 @@
<attribute name="action">win.CommonEmptyTrash</attribute>
</item>
</section>
- <section>
- <item>
- <attribute name="label" translatable="yes">_Quit</attribute>
- <attribute name="accel"><Primary>q</attribute>
- <attribute name="action">win.CommonQuit</attribute>
- </item>
- </section>
</submenu>
<submenu>
<attribute name="label" translatable="yes">_Edit</attribute>
@@ -63,12 +56,6 @@
<attribute name="action">win.CommonSelectAll</attribute>
</item>
</section>
- <section>
- <item>
- <attribute name="label" translatable="yes">_Preferences</attribute>
- <attribute name="action">win.CommonPreferences</attribute>
- </item>
- </section>
</submenu>
<submenu>
<attribute name="label" translatable="yes">_View</attribute>
@@ -179,30 +166,6 @@
</submenu>
</section>
</submenu>
- <submenu>
- <attribute name="label" translatable="yes">_Help</attribute>
- <section>
- <item>
- <attribute name="label" translatable="yes">_Help</attribute>
- <attribute name="accel">F1</attribute>
- <attribute name="action">win.CommonHelpContents</attribute>
- </item>
- <item>
- <attribute name="label" translatable="yes">_Frequently Asked Questions</attribute>
- <attribute name="action">win.CommonHelpFAQ</attribute>
- </item>
- <item>
- <attribute name="label" translatable="yes">_Report a Problem…</attribute>
- <attribute name="action">win.CommonHelpReportProblem</attribute>
- </item>
- </section>
- <section>
- <item>
- <attribute name="label" translatable="yes">_About</attribute>
- <attribute name="action">win.CommonAbout</attribute>
- </item>
- </section>
- </submenu>
</menu>
<menu id="ImportContextMenu">
<section>
diff --git a/ui/import_queue.ui b/ui/import_queue.ui
index 9b07d9c..a19c32b 100644
--- a/ui/import_queue.ui
+++ b/ui/import_queue.ui
@@ -26,13 +26,6 @@
<attribute name="action">win.CommonEmptyTrash</attribute>
</item>
</section>
- <section>
- <item>
- <attribute name="label" translatable="yes">_Quit</attribute>
- <attribute name="accel"><Primary>q</attribute>
- <attribute name="action">win.CommonQuit</attribute>
- </item>
- </section>
</submenu>
<submenu>
<attribute name="label" translatable="yes">_View</attribute>
@@ -78,12 +71,6 @@
<attribute name="action">win.CommonHelpReportProblem</attribute>
</item>
</section>
- <section>
- <item>
- <attribute name="label" translatable="yes">_About</attribute>
- <attribute name="action">win.CommonAbout</attribute>
- </item>
- </section>
</submenu>
</menu>
</interface>
diff --git a/ui/media.ui b/ui/media.ui
index e3d8ba1..895855a 100644
--- a/ui/media.ui
+++ b/ui/media.ui
@@ -35,13 +35,6 @@
<attribute name="action">win.CommonEmptyTrash</attribute>
</item>
</section>
- <section>
- <item>
- <attribute name="label" translatable="yes">_Quit</attribute>
- <attribute name="accel"><Primary>q</attribute>
- <attribute name="action">win.CommonQuit</attribute>
- </item>
- </section>
</submenu>
<submenu>
<attribute name="label" translatable="yes">_Edit</attribute>
@@ -88,12 +81,6 @@
<attribute name="action">win.CommonSelectAll</attribute>
</item>
</section>
- <section>
- <item>
- <attribute name="label" translatable="yes">_Preferences</attribute>
- <attribute name="action">win.CommonPreferences</attribute>
- </item>
- </section>
</submenu>
<submenu>
<attribute name="label" translatable="yes">_View</attribute>
@@ -397,29 +384,5 @@
</section>
</submenu>
<!-- Faces menu goes here FacesMenuPlaceholder -->
- <submenu>
- <attribute name="label" translatable="yes">_Help</attribute>
- <section>
- <item>
- <attribute name="label" translatable="yes">_Help</attribute>
- <attribute name="accel">F1</attribute>
- <attribute name="action">win.CommonHelpContents</attribute>
- </item>
- <item>
- <attribute name="label" translatable="yes">_Frequently Asked Questions</attribute>
- <attribute name="action">win.CommonHelpFAQ</attribute>
- </item>
- <item>
- <attribute name="label" translatable="yes">_Report a Problem…</attribute>
- <attribute name="action">win.CommonHelpReportProblem</attribute>
- </item>
- </section>
- <section>
- <item>
- <attribute name="label" translatable="yes">_About</attribute>
- <attribute name="action">win.CommonAbout</attribute>
- </item>
- </section>
- </submenu>
</menu>
</interface>
diff --git a/ui/offline.ui b/ui/offline.ui
index f886526..273ac73 100644
--- a/ui/offline.ui
+++ b/ui/offline.ui
@@ -20,13 +20,6 @@
<attribute name="action">win.CommonEmptyTrash</attribute>
</item>
</section>
- <section>
- <item>
- <attribute name="label" translatable="yes">_Quit</attribute>
- <attribute name="accel"><Primary>q</attribute>
- <attribute name="action">win.CommonQuit</attribute>
- </item>
- </section>
</submenu>
<submenu>
<attribute name="label" translatable="yes">_Edit</attribute>
@@ -67,12 +60,6 @@
<attribute name="action">win.CommonSelectAll</attribute>
</item>
</section>
- <section>
- <item>
- <attribute name="label" translatable="yes">_Preferences</attribute>
- <attribute name="action">win.CommonPreferences</attribute>
- </item>
- </section>
</submenu>
<submenu>
<attribute name="label" translatable="yes">_View</attribute>
@@ -176,30 +163,6 @@
</submenu>
</section>
</submenu>
- <submenu>
- <attribute name="label" translatable="yes">_Help</attribute>
- <section>
- <item>
- <attribute name="label" translatable="yes">_Help</attribute>
- <attribute name="accel">F1</attribute>
- <attribute name="action">win.CommonHelpContents</attribute>
- </item>
- <item>
- <attribute name="label" translatable="yes">_Frequently Asked Questions</attribute>
- <attribute name="action">win.CommonHelpFAQ</attribute>
- </item>
- <item>
- <attribute name="label" translatable="yes">_Report a Problem…</attribute>
- <attribute name="action">win.CommonHelpReportProblem</attribute>
- </item>
- </section>
- <section>
- <item>
- <attribute name="label" translatable="yes">_About</attribute>
- <attribute name="action">win.CommonAbout</attribute>
- </item>
- </section>
- </submenu>
</menu>
<menu id="OfflineContextMenu">
<section>
diff --git a/ui/photo.ui b/ui/photo.ui
index 6b662a5..cb39801 100644
--- a/ui/photo.ui
+++ b/ui/photo.ui
@@ -43,13 +43,6 @@
<attribute name="action">win.CommonEmptyTrash</attribute>
</item>
</section>
- <section>
- <item>
- <attribute name="label" translatable="yes">_Quit</attribute>
- <attribute name="accel"><Primary>q</attribute>
- <attribute name="action">win.CommonQuit</attribute>
- </item>
- </section>
</submenu>
<submenu>
<attribute name="label" translatable="yes">_Edit</attribute>
@@ -84,12 +77,6 @@
<attribute name="action">win.MoveToTrash</attribute>
</item>
</section>
- <section>
- <item>
- <attribute name="label" translatable="yes">_Preferences</attribute>
- <attribute name="action">win.CommonPreferences</attribute>
- </item>
- </section>
</submenu>
<submenu>
<attribute name="label" translatable="yes">_View</attribute>
@@ -380,29 +367,5 @@
</item>
</section>
</submenu>
- <submenu>
- <attribute name="label" translatable="yes">_Help</attribute>
- <section>
- <item>
- <attribute name="label" translatable="yes">_Help</attribute>
- <attribute name="accel">F1</attribute>
- <attribute name="action">win.CommonHelpContents</attribute>
- </item>
- <item>
- <attribute name="label" translatable="yes">_Frequently Asked Questions</attribute>
- <attribute name="action">win.CommonHelpFAQ</attribute>
- </item>
- <item>
- <attribute name="label" translatable="yes">_Report a Problem…</attribute>
- <attribute name="action">win.CommonHelpReportProblem</attribute>
- </item>
- </section>
- <section>
- <item>
- <attribute name="label" translatable="yes">_About</attribute>
- <attribute name="action">win.CommonAbout</attribute>
- </item>
- </section>
- </submenu>
</menu>
</interface>
diff --git a/ui/tags.ui b/ui/tags.ui
index c693e7f..e2cb3cf 100644
--- a/ui/tags.ui
+++ b/ui/tags.ui
@@ -35,13 +35,6 @@
<attribute name="action">win.CommonEmptyTrash</attribute>
</item>
</section>
- <section>
- <item>
- <attribute name="label" translatable="yes">_Quit</attribute>
- <attribute name="accel"><Primary>q</attribute>
- <attribute name="action">win.CommonQuit</attribute>
- </item>
- </section>
</submenu>
<submenu>
<attribute name="label" translatable="yes">_Edit</attribute>
@@ -88,12 +81,6 @@
<attribute name="action">win.CommonSelectAll</attribute>
</item>
</section>
- <section>
- <item>
- <attribute name="label" translatable="yes">_Preferences</attribute>
- <attribute name="action">win.CommonPreferences</attribute>
- </item>
- </section>
</submenu>
<submenu>
<attribute name="label" translatable="yes">_View</attribute>
@@ -416,30 +403,6 @@
</section>
</submenu>
<!-- Faces menu goes here FacesMenuPlaceholder -->
- <submenu>
- <attribute name="label" translatable="yes">_Help</attribute>
- <section>
- <item>
- <attribute name="label" translatable="yes">_Help</attribute>
- <attribute name="accel">F1</attribute>
- <attribute name="action">win.CommonHelpContents</attribute>
- </item>
- <item>
- <attribute name="label" translatable="yes">_Frequently Asked Questions</attribute>
- <attribute name="action">win.CommonHelpFAQ</attribute>
- </item>
- <item>
- <attribute name="label" translatable="yes">_Report a Problem…</attribute>
- <attribute name="action">win.CommonHelpReportProblem</attribute>
- </item>
- </section>
- <section>
- <item>
- <attribute name="label" translatable="yes">_About</attribute>
- <attribute name="action">win.CommonAbout</attribute>
- </item>
- </section>
- </submenu>
</menu>
<menu id="TagsContextMenu">
diff --git a/ui/trash.ui b/ui/trash.ui
index 2e68df8..0bd7a20 100644
--- a/ui/trash.ui
+++ b/ui/trash.ui
@@ -25,13 +25,6 @@
<attribute name="action">win.CommonEmptyTrash</attribute>
</item>
</section>
- <section>
- <item>
- <attribute name="label" translatable="yes">_Quit</attribute>
- <attribute name="accel"><Primary>q</attribute>
- <attribute name="action">win.CommonQuit</attribute>
- </item>
- </section>
</submenu>
<submenu>
<attribute name="label" translatable="yes">_Edit</attribute>
@@ -76,12 +69,6 @@
<attribute name="action">win.CommonSelectAll</attribute>
</item>
</section>
- <section>
- <item>
- <attribute name="label" translatable="yes">_Preferences</attribute>
- <attribute name="action">win.CommonPreferences</attribute>
- </item>
- </section>
</submenu>
<submenu>
<attribute name="label" translatable="yes">_View</attribute>
@@ -185,30 +172,6 @@
</submenu>
</section>
</submenu>
- <submenu>
- <attribute name="label" translatable="yes">_Help</attribute>
- <section>
- <item>
- <attribute name="label" translatable="yes">_Help</attribute>
- <attribute name="accel">F1</attribute>
- <attribute name="action">win.CommonHelpContents</attribute>
- </item>
- <item>
- <attribute name="label" translatable="yes">_Frequently Asked Questions</attribute>
- <attribute name="action">win.CommonHelpFAQ</attribute>
- </item>
- <item>
- <attribute name="label" translatable="yes">_Report a Problem…</attribute>
- <attribute name="action">win.CommonHelpReportProblem</attribute>
- </item>
- </section>
- <section>
- <item>
- <attribute name="label" translatable="yes">_About</attribute>
- <attribute name="action">win.CommonAbout</attribute>
- </item>
- </section>
- </submenu>
</menu>
<menu id="TrashContextMenu">
<section>
[Date Prev][
Date Next] [Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]