[gnome-2048] Use org.gnome.TwentyFortyEight for resources.



commit fba8fe4b72f29c8c586c753be03ab368072909dd
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Mon Jan 28 23:24:56 2019 +0100

    Use org.gnome.TwentyFortyEight for resources.
    
    See #6.

 src/application.vala                         | 10 +++-------
 src/gnome-2048.gresource.xml                 | 12 ------------
 src/meson.build                              |  2 +-
 src/org.gnome.TwentyFortyEight.gresource.xml | 12 ++++++++++++
 4 files changed, 16 insertions(+), 20 deletions(-)
---
diff --git a/src/application.vala b/src/application.vala
index 6071310..b6394b4 100644
--- a/src/application.vala
+++ b/src/application.vala
@@ -118,10 +118,6 @@ public class Application : Gtk.Application
 
         _settings = new GLib.Settings ("org.gnome.TwentyFortyEight");
 
-/*        CssProvider provider = new CssProvider ();
-        provider.load_from_resource ("/org/gnome/gnome-2048/data/style.css");
-        StyleContext.add_provider_for_screen (Gdk.Screen.get_default (), provider, 
STYLE_PROVIDER_PRIORITY_APPLICATION); */
-
         _init_game ();
 
         _create_window ();
@@ -194,7 +190,7 @@ public class Application : Gtk.Application
 
     private void _create_window ()
     {
-        Builder builder = new Builder.from_resource ("/org/gnome/gnome-2048/data/mainwindow.ui");
+        Builder builder = new Builder.from_resource ("/org/gnome/TwentyFortyEight/ui/mainwindow.ui");
 
         _window = (ApplicationWindow) builder.get_object ("applicationwindow");
         _window.set_default_size (_settings.get_int ("window-width"), _settings.get_int ("window-height"));
@@ -453,7 +449,7 @@ public class Application : Gtk.Application
     private bool _should_create_preferences_dialog = true;
     private inline void _create_preferences_dialog ()
     {
-        Builder builder = new Builder.from_resource ("/org/gnome/gnome-2048/data/preferences.ui");
+        Builder builder = new Builder.from_resource ("/org/gnome/TwentyFortyEight/ui/preferences.ui");
 
         _preferences_dialog = (Dialog) builder.get_object ("preferencesdialog");
         _preferences_dialog.set_application (this); // else we cannot use "app." actions in the dialog
@@ -527,7 +523,7 @@ public class Application : Gtk.Application
     private bool _should_create_congrats_dialog = true;
     private inline void _create_congrats_dialog ()
     {
-        Builder builder = new Builder.from_resource ("/org/gnome/gnome-2048/data/congrats.ui");
+        Builder builder = new Builder.from_resource ("/org/gnome/TwentyFortyEight/ui/congrats.ui");
 
         _congrats_dialog = (MessageDialog) builder.get_object ("congratsdialog");
         _congrats_dialog.set_transient_for (_window);
diff --git a/src/meson.build b/src/meson.build
index e9a4411..041f515 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -1,6 +1,6 @@
 resources = gnome.compile_resources(
   'resources',
-  'gnome-2048.gresource.xml',
+  'org.gnome.TwentyFortyEight.gresource.xml',
   source_dir: '..',
   c_name: 'resources',
 )
diff --git a/src/org.gnome.TwentyFortyEight.gresource.xml b/src/org.gnome.TwentyFortyEight.gresource.xml
new file mode 100644
index 0000000..bf18b92
--- /dev/null
+++ b/src/org.gnome.TwentyFortyEight.gresource.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+  <gresource prefix="/org/gnome/TwentyFortyEight/ui">
+    <file preprocess="xml-stripblanks" alias="mainwindow.ui">data/mainwindow.ui</file>
+    <file preprocess="xml-stripblanks" alias="preferences.ui">data/preferences.ui</file>
+    <file preprocess="xml-stripblanks" alias="congrats.ui">data/congrats.ui</file>
+    <!-- file>data/style.css</file -->
+  </gresource>
+  <gresource prefix="/org/gnome/gnome-2048/gtk">
+    <file preprocess="xml-stripblanks" alias="help-overlay.ui">data/help-overlay.ui</file>
+  </gresource>
+</gresources>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]