[gnome-2048] Use GResource for loading the app-menu.
- From: Arnaud Bonatti <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-2048] Use GResource for loading the app-menu.
- Date: Thu, 28 Jan 2016 14:47:36 +0000 (UTC)
commit bd80a0a813f85ebfd3ce15d0589652e98c894541
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Thu Jan 28 15:47:02 2016 +0100
Use GResource for loading the app-menu.
src/application.vala | 13 -------------
src/gnome-2048.gresource.xml | 4 +++-
2 files changed, 3 insertions(+), 14 deletions(-)
---
diff --git a/src/application.vala b/src/application.vala
index b6de35c..c5819cf 100644
--- a/src/application.vala
+++ b/src/application.vala
@@ -74,7 +74,6 @@ public class Application : Gtk.Application
_settings = new Settings ("org.gnome.2048");
_init_style ();
- _init_app_menu ();
_init_game ();
}
@@ -122,18 +121,6 @@ public class Application : Gtk.Application
}
}
- private void _init_app_menu ()
- {
- var builder = new Gtk.Builder ();
- try {
- builder.add_from_resource ("/org/gnome/gnome-2048/data/menus.ui");
- var menu = builder.get_object ("app-menu") as GLib.MenuModel;
- set_app_menu (menu);
- } catch (GLib.Error e) {
- stderr.printf ("%s\n", e.message);
- }
- }
-
private void _init_game ()
{
_game = new Game (_settings);
diff --git a/src/gnome-2048.gresource.xml b/src/gnome-2048.gresource.xml
index bb559af..2f7168c 100644
--- a/src/gnome-2048.gresource.xml
+++ b/src/gnome-2048.gresource.xml
@@ -1,10 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/gnome-2048">
- <file preprocess="xml-stripblanks">data/menus.ui</file>
<file preprocess="xml-stripblanks">data/mainwindow.ui</file>
<file preprocess="xml-stripblanks">data/preferences.ui</file>
<file preprocess="xml-stripblanks">data/congrats.ui</file>
<file>data/style.css</file>
</gresource>
+ <gresource prefix="/org/gnome/gnome-2048/gtk">
+ <file preprocess="xml-stripblanks" alias="menus.ui">data/menus.ui</file>
+ </gresource>
</gresources>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]