gbrainy r468 - trunk/src



Author: jmas
Date: Sat Nov 15 15:11:53 2008
New Revision: 468
URL: http://svn.gnome.org/viewvc/gbrainy?rev=468&view=rev

Log:
2008-11-15 Jordi Mas <jmas softcatala org>

	* AboutDialog.cs: Move dlg box code to his own class
	* GtkDialog.cs: gbrainy.cs: Move out dlg about code



Added:
   trunk/src/AboutDialog.cs
Modified:
   trunk/src/ChangeLog
   trunk/src/Makefile.am
   trunk/src/gbrainy.cs

Added: trunk/src/AboutDialog.cs
==============================================================================
--- (empty file)
+++ trunk/src/AboutDialog.cs	Sat Nov 15 15:11:53 2008
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2008 Jordi Mas i HernÃndez <jmas softcatala org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+using System;
+using Glade;
+using Gtk;
+using Gdk;
+using Mono.Unix;
+using System.Collections;
+using System.Text;
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+
+public class AboutDialog : Gtk.AboutDialog
+{
+	public AboutDialog () : base ()
+	{
+		StringBuilder license = new StringBuilder (256);
+		string [] authors = new string [] {
+			"Jordi Mas i Hernandez <jmas softcatala org>",
+		};
+
+		// Name of the people that translated the application
+		string translators = Catalog.GetString ("translator-credits");
+
+		if (translators == "translator-credits")
+			translators = null;
+
+		license.Append (Catalog.GetString ("This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as  published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\n\n"));
+		license.Append (Catalog.GetString ("This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.\n\n"));
+		license.Append (Catalog.GetString ("You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA."));
+
+		Name = "gbrainy";
+		Version = Defines.VERSION;
+		Authors = authors;
+		Documenters = null;
+		Logo = LoadFromAssembly ("gbrainy.svg");
+
+		Copyright = "(c) 2007-2008 Jordi Mas i Hernandez\n";
+		Copyright += Catalog.GetString ("Based on ideas by Terry Stickels, MENSA books and Jordi Mas.");
+
+		Comments = Catalog.GetString ("A brain teaser and trainer game to have fun and to keep your brain trained.");
+		Website = "http://live.gnome.org/gbrainy";;
+		WebsiteLabel = Catalog.GetString ("gbrainy web site");
+		TranslatorCredits = translators;
+		IconName = null;
+		License = license.ToString ();
+		WrapLicense = true;
+	}
+
+	Pixbuf LoadFromAssembly (string resource)
+	{
+		try {
+			return new Pixbuf (System.Reflection.Assembly.GetEntryAssembly (), resource);
+		} catch {
+			return null;
+		}
+	}
+}

Modified: trunk/src/Makefile.am
==============================================================================
--- trunk/src/Makefile.am	(original)
+++ trunk/src/Makefile.am	Sat Nov 15 15:11:53 2008
@@ -69,6 +69,7 @@
 	$(srcdir)/PuzzleGames/PuzzleLargerShape.cs		\
 	$(srcdir)/SVGImage.cs			\
 	$(srcdir)/MemoryGames/MemoryNumbers.cs		\
+	$(srcdir)/AboutDialog.cs	\
 	$(srcdir)/gbrainy.cs			
 
 ASSEMBLIES = \

Modified: trunk/src/gbrainy.cs
==============================================================================
--- trunk/src/gbrainy.cs	(original)
+++ trunk/src/gbrainy.cs	Sat Nov 15 15:11:53 2008
@@ -144,8 +144,6 @@
 		}
 
 		drawing_vbox.Add (drawing_area);
-		//app_window.Resize (500, 700);
-		//app_window.SizeAllocated += new SizeAllocatedHandler (OnSizeAllocated);
 		app_window.IconName = "gbrainy";
 		app_window.ShowAll ();
 
@@ -312,50 +310,9 @@
 	
 	void OnMenuAbout (object sender, EventArgs args)
 	{
-		Gtk.AboutDialog about = new Gtk.AboutDialog ();
-		StringBuilder license = new StringBuilder (256);
-		string [] authors = new string [] {
-			"Jordi Mas i Hernandez <jmas softcatala org>",
-		};
-
-		// Name of the people that translated the application
-		string translators = Catalog.GetString ("translator-credits");
-
-		if (translators == "translator-credits")
-			translators = null;
-
-		license.Append (Catalog.GetString ("This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as  published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\n\n"));
-		license.Append (Catalog.GetString ("This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.\n\n"));
-		license.Append (Catalog.GetString ("You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA."));
-
-		about.Name = "gbrainy";
-		about.Version = Defines.VERSION;
-		about.Authors = authors;
-		about.Documenters = null;
-		about.Logo = LoadFromAssembly ("gbrainy.svg");
-
-		about.Copyright = "(c) 2007-2008 Jordi Mas i Hernandez\n";
-		about.Copyright += Catalog.GetString ("Based on ideas by Terry Stickels, MENSA books and Jordi Mas.");
-
-		about.Comments = Catalog.GetString ("A brain teaser and trainer game to have fun and to keep your brain trained.");
-		about.Website = "http://live.gnome.org/gbrainy";;
-		about.WebsiteLabel = Catalog.GetString ("gbrainy web site");
-		about.TranslatorCredits = translators;
-		about.IconName = null;
-		about.License = license.ToString ();
-		about.WrapLicense = true;
+		AboutDialog about = new AboutDialog ();
 		about.Run ();
-		about.Destroy ();
-	}
-
-	static public Pixbuf LoadFromAssembly (string resource)
-	{
-		try {
-			return new Pixbuf (System.Reflection.Assembly.GetEntryAssembly (), resource);
-		} catch {
-			return null;
-		}
-	}
+	}	
 
 	void OnAnswerButtonClicked (object sender, EventArgs args)
 	{
@@ -559,11 +516,6 @@
 		dialog.Dialog.Destroy ();	
 	}	
 
-	private void OnSizeAllocated (object obj, SizeAllocatedArgs args)
-	{
-		//Console.WriteLine ("OnSizeAllocated");
-	}
-
 	private void AddIcon (IconFactory stock, string stockid, string resource)
 	{
 		Gtk.IconSet iconset = stock.Lookup (stockid);
@@ -614,5 +566,3 @@
 	}
 }
 
-
-



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