[gbrainy] Disable / enable the answer label as the rest of the answer controls



commit 1fd1e71ed7cb6317f5294f83531035b6a733858f
Author: Jordi Mas <jmas softcatala org>
Date:   Thu Apr 28 00:22:29 2011 +0200

    Disable / enable the answer label as the rest of the answer controls

 src/Clients/Classical/gbrainy.cs |   12 ++++++------
 src/Clients/Classical/gbrainy.ui |    2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/src/Clients/Classical/gbrainy.cs b/src/Clients/Classical/gbrainy.cs
index 6d8c681..0cecc31 100644
--- a/src/Clients/Classical/gbrainy.cs
+++ b/src/Clients/Classical/gbrainy.cs
@@ -55,6 +55,7 @@ namespace gbrainy.Clients.Classical
 		[GtkBeans.Builder.Object] Gtk.VBox framework_vbox;
 		[GtkBeans.Builder.Object] Gtk.Entry answer_entry;
 		[GtkBeans.Builder.Object] Gtk.Button answer_button;
+		[GtkBeans.Builder.Object] Gtk.Label answer_label;
 		[GtkBeans.Builder.Object] Gtk.Button tip_button;
 		[GtkBeans.Builder.Object] Gtk.Button next_button;
 		[GtkBeans.Builder.Object] Gtk.Statusbar statusbar;
@@ -273,9 +274,9 @@ namespace gbrainy.Clients.Classical
 		// These are UI elements dependent of the game status
 		public void ActiveInputControls (bool active)
 		{
-			bool answer, entry, next, tip, can_pause;
+			bool answer, next, tip, can_pause;
 
-			can_pause = answer = entry = next = tip = active;
+			can_pause = answer = next = tip = active;
 
 			if (active == true && session.CurrentGame != null && session.CurrentGame.ButtonsActive == true && String.IsNullOrEmpty (session.CurrentGame.Tip ) == false)
 				tip = true;
@@ -286,7 +287,6 @@ namespace gbrainy.Clients.Classical
 			case GameSession.SessionStatus.NotPlaying:
 			case GameSession.SessionStatus.Finished:
 				answer = false;
-				entry = false;
 				next = false;
 				tip = false;
 				can_pause = false;
@@ -301,19 +301,19 @@ namespace gbrainy.Clients.Classical
 				break;
 			case GameSession.SessionStatus.Answered:
 				answer = false;
-				entry = false;
 				tip = false;
 				can_pause = false;
 				break;
 			}
 
 			answer_button.Sensitive = answer;
-			answer_entry.Sensitive = entry;
+			answer_entry.Sensitive = answer;
+			answer_label.Sensitive = answer;
 			next_button.Sensitive = next;
 			tip_button.Sensitive = tip;
 			pause_menuitem.Sensitive = toolbar.PauseButton.Sensitive = can_pause;
 
-			if (entry == true)
+			if (answer == true)
 				answer_entry.GrabFocus ();
 		}
 
diff --git a/src/Clients/Classical/gbrainy.ui b/src/Clients/Classical/gbrainy.ui
index b76bf26..223eb2e 100644
--- a/src/Clients/Classical/gbrainy.ui
+++ b/src/Clients/Classical/gbrainy.ui
@@ -338,7 +338,7 @@
                         <property name="n_columns">5</property>
                         <property name="column_spacing">5</property>
                         <child>
-                          <object class="GtkLabel" id="label_answer">
+                          <object class="GtkLabel" id="answer_label">
                             <property name="visible">True</property>
                             <property name="xalign">0</property>
                             <property name="xpad">3</property>



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