gbrainy r467 - trunk/src



Author: jmas
Date: Tue Nov 11 18:10:40 2008
New Revision: 467
URL: http://svn.gnome.org/viewvc/gbrainy?rev=467&view=rev

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

	* gbrainy.cs: Use ResponseType instead of numbers for dlg results
	* GtkDialog.cs: Use ResponseType instead of numbers for dlg results



Modified:
   trunk/src/ChangeLog
   trunk/src/GtkDialog.cs
   trunk/src/gbrainy.cs

Modified: trunk/src/GtkDialog.cs
==============================================================================
--- trunk/src/GtkDialog.cs	(original)
+++ trunk/src/GtkDialog.cs	Tue Nov 11 18:10:40 2008
@@ -38,9 +38,9 @@
 		dialog = null;
 	}
 
-	public int Run ()
+	public ResponseType Run ()
 	{
-		return Dialog.Run ();
+		return (ResponseType) Dialog.Run ();
 	}
 
 	public Gtk.Dialog Dialog {

Modified: trunk/src/gbrainy.cs
==============================================================================
--- trunk/src/gbrainy.cs	(original)
+++ trunk/src/gbrainy.cs	Tue Nov 11 18:10:40 2008
@@ -45,7 +45,6 @@
 	[Glade.Widget] Gtk.Label label_answer;
 	GameDrawingArea drawing_area;
 	GameSession session;
-	const int ok_buttonid = -5;
 	ToolButton pause_tbbutton;
 	Gtk.TextBuffer question_buffer;
 	Gtk.TextBuffer solution_buffer;
@@ -462,7 +461,7 @@
 		PreferencesDialog dialog;
 
 		dialog = new PreferencesDialog ();
-		if (dialog.Run () == ok_buttonid) {
+		if (dialog.Run () == ResponseType.Ok) {
 			session.GameManager.Difficulty = (Game.Difficulty) preferences.GetIntValue (Preferences.DifficultyKey);
 		}
 		dialog.Dialog.Destroy ();
@@ -470,14 +469,14 @@
 
 	void OnCustomGame (object sender, EventArgs args)
 	{
-		int rslt;
+		ResponseType rslt;
 		CustomGameDialog dialog;
 
 		dialog = new CustomGameDialog (session.GameManager);		
-		rslt = (int) dialog.Run ();
+		rslt = dialog.Run ();
 		dialog.Dialog.Destroy ();
 
-		if (rslt == ok_buttonid && dialog.NumOfGames > 0) {
+		if (rslt == ResponseType.Ok && dialog.NumOfGames > 0) {
 			session.Type = GameSession.Types.Custom;
 			OnNewGame ();
 		}



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