[gnome-games/gsoc-seed-games] [same-gnome-clutter] About dialog



commit f24eaf15de8b18e20ee6d54d89a9cd4f2eb40137
Author: Tim Horton <hortont424 gmail com>
Date:   Sun Jul 5 21:17:58 2009 -0400

    [same-gnome-clutter] About dialog

 same-gnome-clutter/Makefile.am  |    2 ++
 same-gnome-clutter/src/about.js |   33 +++++++++++++++++++++++++++++++++
 same-gnome-clutter/src/main.js  |    3 ++-
 3 files changed, 37 insertions(+), 1 deletions(-)
---
diff --git a/same-gnome-clutter/Makefile.am b/same-gnome-clutter/Makefile.am
index 1607dd1..6935331 100644
--- a/same-gnome-clutter/Makefile.am
+++ b/same-gnome-clutter/Makefile.am
@@ -3,6 +3,7 @@ SUBDIRS = data/themes
 samedir=$(pkgdatadir)/same-gnome-clutter
 
 same_DATA = \
+    src/about.js \
     src/board.js \
     src/light.js \
     src/main.js \
@@ -25,6 +26,7 @@ desktop_DATA = $(desktop_in_files:.desktop.in.in=.desktop)
 CLEANFILES = $(desktop_DATA)
 
 EXTRA_DIST = \
+    src/about.js \
     src/board.js \
     src/light.js \
     src/main.js \
diff --git a/same-gnome-clutter/src/about.js b/same-gnome-clutter/src/about.js
new file mode 100644
index 0000000..21abd90
--- /dev/null
+++ b/same-gnome-clutter/src/about.js
@@ -0,0 +1,33 @@
+Gtk = imports.gi.Gtk;
+GnomeGamesSupport = imports.gi.GnomeGamesSupport;
+
+main = imports.main;
+
+// Not sure that this is acceptable; if it is, should it be in a Seed extension?
+var _ = imports.gettext.gettext;
+
+function show_about_dialog()
+{
+	var about_dialog = new Gtk.AboutDialog();
+	about_dialog.program_name = _("Same Gnome");
+	about_dialog.version = "1.0";
+	about_dialog.comments = _("I want to play that game! You know, they all go whirly-round and you click on them and they vanish!\n\nLights Off is a part of GNOME Games.");
+	about_dialog.copyright = _("Copyright \xa9 2009 Tim Horton");
+	about_dialog.license = GnomeGamesSupport.get_license(_("Same Gnome"));
+	about_dialog.wrap_license = true;
+	about_dialog.logo_icon_name = "gnome-samegnome";
+	about_dialog.website = "http://www.gnome.org/projects/gnome-games/";;
+	about_dialog.website_label = _("GNOME Games web site"); // this doesn't work for anyone
+	about_dialog.translator_credits = _("translator-credits");
+
+	about_dialog.set_authors(["Tim Horton"]);
+	about_dialog.set_artists(["Tim Horton"]);
+
+	// TODO: some form of wrapper so we can use gtk_show_about_dialog instead
+	// of faking all of its window-management-related stuff
+
+	about_dialog.set_transient_for(main.window);
+	about_dialog.run();
+	
+	about_dialog.hide();
+}
diff --git a/same-gnome-clutter/src/main.js b/same-gnome-clutter/src/main.js
index 429b50e..98367f8 100755
--- a/same-gnome-clutter/src/main.js
+++ b/same-gnome-clutter/src/main.js
@@ -33,6 +33,7 @@ light = imports.light;
 board = imports.board;
 score = imports.score;
 settings = imports.settings;
+about = imports.about;
 
 handlers = {
 	show_settings: function(selector, ud)
@@ -41,7 +42,7 @@ handlers = {
 	},
 	show_about: function(selector, ud)
 	{
-		About.show_about_dialog();
+		about.show_about_dialog();
 	},
 	reset_score: function(selector, ud)
 	{



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