[gnome-music] application: let GtkApplication automatically load the app-menu
- From: Felipe Borges <felipeborges src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music] application: let GtkApplication automatically load the app-menu
- Date: Wed, 25 Nov 2015 09:56:14 +0000 (UTC)
commit 8ccb25da7ffd991e129383c3ef1a40351134ba1e
Author: Felipe Borges <felipeborges gnome org>
Date: Wed Nov 25 10:52:44 2015 +0100
application: let GtkApplication automatically load the app-menu
GtkApplication automatically loads menus from the GtkBuilder resource
located at "gtk/menus.ui", relative to the application's resource
base path (see g_application_set_resource_base_path ()). The menu
with the ID "app-menu" is taken as the application's app menu.
data/gnome-music.gresource.xml | 2 +-
gnomemusic/application.py | 7 -------
2 files changed, 1 insertions(+), 8 deletions(-)
---
diff --git a/data/gnome-music.gresource.xml b/data/gnome-music.gresource.xml
index a0db704..88f1225 100644
--- a/data/gnome-music.gresource.xml
+++ b/data/gnome-music.gresource.xml
@@ -2,7 +2,7 @@
<gresources>
<gresource prefix="/org/gnome/Music">
<file preprocess="xml-stripblanks">AboutDialog.ui</file>
- <file preprocess="xml-stripblanks">app-menu.ui</file>
+ <file alias="gtk/menus.ui" preprocess="xml-stripblanks">app-menu.ui</file>
<file>application.css</file>
<file>initial-state.png</file>
<file preprocess="xml-stripblanks">AlbumWidget.ui</file>
diff --git a/gnomemusic/application.py b/gnomemusic/application.py
index 7e8b061..741a7cb 100644
--- a/gnomemusic/application.py
+++ b/gnomemusic/application.py
@@ -67,13 +67,6 @@ class Application(Gtk.Application):
@log
def build_app_menu(self):
- builder = Gtk.Builder()
-
- builder.add_from_resource('/org/gnome/Music/app-menu.ui')
-
- menu = builder.get_object('app-menu')
- self.set_app_menu(menu)
-
aboutAction = Gio.SimpleAction.new('about', None)
aboutAction.connect('activate', self.about)
self.add_action(aboutAction)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]