[gnome-games] gnomine: Install images into standard location
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] gnomine: Install images into standard location
- Date: Sat, 31 Dec 2011 07:35:19 +0000 (UTC)
commit ebf22c022865f72caaa7a053899f16d13cce0a7f
Author: Robert Ancell <robert ancell canonical com>
Date: Sat Dec 31 18:35:12 2011 +1100
gnomine: Install images into standard location
gnomine/data/Makefile.am | 2 +-
gnomine/src/Makefile.am | 1 +
gnomine/src/config.vapi | 3 ++-
gnomine/src/gnomine.vala | 5 ++---
gnomine/src/minefield-view.vala | 11 +++++------
5 files changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/gnomine/data/Makefile.am b/gnomine/data/Makefile.am
index 990ef48..2861cc2 100644
--- a/gnomine/data/Makefile.am
+++ b/gnomine/data/Makefile.am
@@ -7,7 +7,7 @@ gsettings_SCHEMAS = $(gsettings_in_file:.xml.in=.xml)
man_MANS = gnomine.6
-pixmapdir = $(datadir)/gnome-games/gnomine/pixmaps
+pixmapdir = $(datadir)/gnomine
pixmap_DATA = face-cool.svg face-sad.svg face-smile.svg face-win.svg \
face-worried.svg \
flag.svg flag-question.svg mine.svg bang.svg warning.svg
diff --git a/gnomine/src/Makefile.am b/gnomine/src/Makefile.am
index ec7abd6..e2f19c3 100644
--- a/gnomine/src/Makefile.am
+++ b/gnomine/src/Makefile.am
@@ -10,6 +10,7 @@ gnomine_CFLAGS = \
-I$(top_srcdir)/libgames-support \
-DVERSION=\"$(VERSION)\" \
-DGETTEXT_PACKAGE=\"$(GETTEXT_PACKAGE)\" \
+ -DDATA_DIRECTORY=\"$(datadir)/gnomine\" \
$(GTK_CFLAGS)
gnomine_VALAFLAGS = \
diff --git a/gnomine/src/config.vapi b/gnomine/src/config.vapi
index 6477226..c0c89fc 100644
--- a/gnomine/src/config.vapi
+++ b/gnomine/src/config.vapi
@@ -1,2 +1,3 @@
public const string VERSION;
-public const string GETTEXT_PACKAGE;
\ No newline at end of file
+public const string GETTEXT_PACKAGE;
+public const string DATA_DIRECTORY;
diff --git a/gnomine/src/gnomine.vala b/gnomine/src/gnomine.vala
index bc0a5c4..49a3d4a 100644
--- a/gnomine/src/gnomine.vala
+++ b/gnomine/src/gnomine.vala
@@ -161,8 +161,7 @@ public class GnoMine : Gtk.Application
private Gtk.Image load_face_image (string name)
{
var image = new Gtk.Image ();
- var dname = GnomeGamesSupport.runtime_get_directory (GnomeGamesSupport.RuntimeDirectory.GAME_PIXMAP_DIRECTORY);
- var filename = Path.build_filename (dname, name);
+ var filename = Path.build_filename (DATA_DIRECTORY, name);
if (filename != null)
image.set_from_file (filename);
@@ -760,7 +759,7 @@ public class GnoMine : Gtk.Application
public static int main (string[] args)
{
if (!GnomeGamesSupport.runtime_init ("gnomine"))
- return 1;
+ return Posix.EXIT_FAILURE;
#if ENABLE_SETGID
GnomeGamesSupport.setgid_io_init ();
diff --git a/gnomine/src/minefield-view.vala b/gnomine/src/minefield-view.vala
index 2a4f993..3c675c5 100644
--- a/gnomine/src/minefield-view.vala
+++ b/gnomine/src/minefield-view.vala
@@ -80,12 +80,11 @@ public class MinefieldView : Gtk.DrawingArea
{
set_events (Gdk.EventMask.EXPOSURE_MASK | Gdk.EventMask.BUTTON_PRESS_MASK | Gdk.EventMask.POINTER_MOTION_MASK | Gdk.EventMask.BUTTON_RELEASE_MASK);
- var pixmap_dir = GnomeGamesSupport.runtime_get_directory (GnomeGamesSupport.RuntimeDirectory.GAME_PIXMAP_DIRECTORY);
- flag_preimage = load_preimage (Path.build_filename (pixmap_dir, "flag.svg"));
- mine_preimage = load_preimage (Path.build_filename (pixmap_dir, "mine.svg"));
- question_preimage = load_preimage (Path.build_filename (pixmap_dir, "flag-question.svg"));
- bang_preimage = load_preimage (Path.build_filename (pixmap_dir, "bang.svg"));
- warning_preimage = load_preimage (Path.build_filename (pixmap_dir, "warning.svg"));
+ flag_preimage = load_preimage (Path.build_filename (DATA_DIRECTORY, "flag.svg"));
+ mine_preimage = load_preimage (Path.build_filename (DATA_DIRECTORY, "mine.svg"));
+ question_preimage = load_preimage (Path.build_filename (DATA_DIRECTORY, "flag-question.svg"));
+ bang_preimage = load_preimage (Path.build_filename (DATA_DIRECTORY, "bang.svg"));
+ warning_preimage = load_preimage (Path.build_filename (DATA_DIRECTORY, "warning.svg"));
number_patterns = new Cairo.Pattern[8];
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]