[shotwell] Add Quit menu item to File menu
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [shotwell] Add Quit menu item to File menu
- Date: Sun, 18 Dec 2016 19:08:50 +0000 (UTC)
commit 0fa222a858adee5014c91dd2a8de0658b3a4ec24
Author: Jens Georg <mail jensge org>
Date: Sun Dec 18 20:05:44 2016 +0100
Add Quit menu item to File menu
If the shell does have AppMenu. Not having itbroke my workflow quite badly.
Signed-off-by: Jens Georg <mail jensge org>
src/Page.vala | 10 +++++++++-
ui/direct.ui | 3 +++
ui/event.ui | 6 +-----
ui/events_directory.ui | 3 +++
ui/import.ui | 3 +++
ui/import_queue.ui | 3 +++
ui/media.ui | 3 +++
ui/offline.ui | 3 +++
ui/photo.ui | 3 +++
ui/tags.ui | 3 +++
ui/trash.ui | 3 +++
11 files changed, 37 insertions(+), 6 deletions(-)
---
diff --git a/src/Page.vala b/src/Page.vala
index a65a1e2..7adc1db 100644
--- a/src/Page.vala
+++ b/src/Page.vala
@@ -571,7 +571,15 @@ public abstract class Page : Gtk.ScrolledWindow {
// This is called during init_ui() to collect all Page.InjectedUIElements for the page. They
// should be added to the MultiSet using the injection path as the key.
protected virtual InjectionGroup[] init_collect_injection_groups() {
- return new InjectionGroup[0];
+ var result = new InjectionGroup[0];
+ var settings = Gtk.Settings.get_default ();
+ if (settings.gtk_shell_shows_app_menu) {
+ InjectionGroup group = new InjectionGroup("QuitPlaceholder");
+ group.add_menu_item ("_Quit", "CommonQuit", "<Primary>q");
+ result += group;
+ }
+
+ return result;
}
// This is called during "map" allowing for Gtk.Actions to be updated at
diff --git a/ui/direct.ui b/ui/direct.ui
index 6053967..7e81149 100644
--- a/ui/direct.ui
+++ b/ui/direct.ui
@@ -32,6 +32,9 @@
<attribute name="action">win.CommonJumpToFile</attribute>
</item>
</section>
+ <section>
+ <attribute name="id">QuitPlaceholder</attribute>
+ </section>
</submenu>
<submenu>
<attribute name="label" translatable="yes">_Edit</attribute>
diff --git a/ui/event.ui b/ui/event.ui
index c2bc6cb..cadd49d 100644
--- a/ui/event.ui
+++ b/ui/event.ui
@@ -36,11 +36,7 @@
</item>
</section>
<section>
- <item>
- <attribute name="label" translatable="yes">_Quit</attribute>
- <attribute name="accel"><Primary>q</attribute>
- <attribute name="action">win.CommonQuit</attribute>
- </item>
+ <attribute name="id">QuitPlaceholder</attribute>
</section>
</submenu>
<submenu>
diff --git a/ui/events_directory.ui b/ui/events_directory.ui
index ad4135e..1078aa6 100644
--- a/ui/events_directory.ui
+++ b/ui/events_directory.ui
@@ -20,6 +20,9 @@
<attribute name="action">win.CommonEmptyTrash</attribute>
</item>
</section>
+ <section>
+ <attribute name="id">QuitPlaceholder</attribute>
+ </section>
</submenu>
<submenu>
<attribute name="label" translatable="yes">_Edit</attribute>
diff --git a/ui/import.ui b/ui/import.ui
index 4a75993..646f467 100644
--- a/ui/import.ui
+++ b/ui/import.ui
@@ -28,6 +28,9 @@
<attribute name="action">win.CommonEmptyTrash</attribute>
</item>
</section>
+ <section>
+ <attribute name="id">QuitPlaceholder</attribute>
+ </section>
</submenu>
<submenu>
<attribute name="label" translatable="yes">_Edit</attribute>
diff --git a/ui/import_queue.ui b/ui/import_queue.ui
index a19c32b..8acd0c8 100644
--- a/ui/import_queue.ui
+++ b/ui/import_queue.ui
@@ -26,6 +26,9 @@
<attribute name="action">win.CommonEmptyTrash</attribute>
</item>
</section>
+ <section>
+ <attribute name="id">QuitPlaceholder</attribute>
+ </section>
</submenu>
<submenu>
<attribute name="label" translatable="yes">_View</attribute>
diff --git a/ui/media.ui b/ui/media.ui
index 895855a..b1503a2 100644
--- a/ui/media.ui
+++ b/ui/media.ui
@@ -35,6 +35,9 @@
<attribute name="action">win.CommonEmptyTrash</attribute>
</item>
</section>
+ <section>
+ <attribute name="id">QuitPlaceholder</attribute>
+ </section>
</submenu>
<submenu>
<attribute name="label" translatable="yes">_Edit</attribute>
diff --git a/ui/offline.ui b/ui/offline.ui
index bf241ed..c060fc2 100644
--- a/ui/offline.ui
+++ b/ui/offline.ui
@@ -20,6 +20,9 @@
<attribute name="action">win.CommonEmptyTrash</attribute>
</item>
</section>
+ <section>
+ <attribute name="id">QuitPlaceholder</attribute>
+ </section>
</submenu>
<submenu>
<attribute name="label" translatable="yes">_Edit</attribute>
diff --git a/ui/photo.ui b/ui/photo.ui
index cb39801..9843959 100644
--- a/ui/photo.ui
+++ b/ui/photo.ui
@@ -43,6 +43,9 @@
<attribute name="action">win.CommonEmptyTrash</attribute>
</item>
</section>
+ <section>
+ <attribute name="id">QuitPlaceholder</attribute>
+ </section>
</submenu>
<submenu>
<attribute name="label" translatable="yes">_Edit</attribute>
diff --git a/ui/tags.ui b/ui/tags.ui
index 11a4f44..92b7805 100644
--- a/ui/tags.ui
+++ b/ui/tags.ui
@@ -35,6 +35,9 @@
<attribute name="action">win.CommonEmptyTrash</attribute>
</item>
</section>
+ <section>
+ <attribute name="id">QuitPlaceholder</attribute>
+ </section>
</submenu>
<submenu>
<attribute name="label" translatable="yes">_Edit</attribute>
diff --git a/ui/trash.ui b/ui/trash.ui
index 58badfa..5bab97f 100644
--- a/ui/trash.ui
+++ b/ui/trash.ui
@@ -25,6 +25,9 @@
<attribute name="action">win.CommonEmptyTrash</attribute>
</item>
</section>
+ <section>
+ <attribute name="id">QuitPlaceholder</attribute>
+ </section>
</submenu>
<submenu>
<attribute name="label" translatable="yes">_Edit</attribute>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]