[chronojump] Allow finish RJ after time moved to main gui



commit c6d08a5205b4a31a49f2da627e1b72d6ca710267
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Jan 4 15:06:27 2013 +0100

    Allow finish RJ after time moved to main gui

 glade/chronojump.glade |   55 ++++++++++++++++++++++++-----------------------
 src/gui/chronojump.cs  |   19 ++--------------
 src/gui/jump.cs        |    7 ++++++
 src/gui/preferences.cs |   10 +-------
 4 files changed, 39 insertions(+), 52 deletions(-)
---
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index d0d3f32..5042dd5 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -1677,22 +1677,22 @@ Chronopic</property>
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <child>
-                                                            <widget class="GtkRadioButton" id="extra_window_radio_jump_rj_hexagon">
+                                                            <widget class="GtkRadioButton" id="extra_window_radio_jump_rj_j">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">True</property>
                                                             <property name="receives_default">False</property>
                                                             <property name="has_tooltip">True</property>
-                                                            <property name="tooltip" translatable="yes">CounterMovement Jump</property>
+                                                            <property name="tooltip" translatable="yes">Simple jump with no special technique</property>
                                                             <property name="use_action_appearance">False</property>
                                                             <property name="relief">none</property>
+                                                            <property name="active">True</property>
                                                             <property name="draw_indicator">False</property>
-                                                            <property name="group">extra_window_radio_jump_rj_j</property>
                                                             <signal name="toggled" handler="on_extra_window_jumps_rj_test_changed" swapped="no"/>
                                                             <child>
-                                                            <widget class="GtkLabel" id="label_extra_window_radio_jump_rj_hexagon">
+                                                            <widget class="GtkLabel" id="label_extra_window_radio_jump_rj_j">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
-                                                            <property name="label" translatable="yes">Hexagon</property>
+                                                            <property name="label" translatable="yes">RJ(j)</property>
                                                             </widget>
                                                             </child>
                                                             </widget>
@@ -1755,22 +1755,22 @@ Chronopic</property>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkRadioButton" id="extra_window_radio_jump_rj_j">
+                                                            <widget class="GtkRadioButton" id="extra_window_radio_jump_rj_hexagon">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">True</property>
                                                             <property name="receives_default">False</property>
                                                             <property name="has_tooltip">True</property>
-                                                            <property name="tooltip" translatable="yes">Simple jump with no special technique</property>
+                                                            <property name="tooltip" translatable="yes">CounterMovement Jump</property>
                                                             <property name="use_action_appearance">False</property>
                                                             <property name="relief">none</property>
-                                                            <property name="active">True</property>
                                                             <property name="draw_indicator">False</property>
+                                                            <property name="group">extra_window_radio_jump_rj_j</property>
                                                             <signal name="toggled" handler="on_extra_window_jumps_rj_test_changed" swapped="no"/>
                                                             <child>
-                                                            <widget class="GtkLabel" id="label_extra_window_radio_jump_rj_j">
+                                                            <widget class="GtkLabel" id="label_extra_window_radio_jump_rj_hexagon">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
-                                                            <property name="label" translatable="yes">RJ(j)</property>
+                                                            <property name="label" translatable="yes">Hexagon</property>
                                                             </widget>
                                                             </child>
                                                             </widget>
@@ -4283,6 +4283,24 @@ weight</property>
                                                             <property name="position">2</property>
                                                             </packing>
                                                             </child>
+                                                            <child>
+                                                            <widget class="GtkCheckButton" id="checkbutton_allow_finish_rj_after_time">
+                                                            <property name="label" translatable="yes">Allow finish after time</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property name="receives_default">False</property>
+                                                            <property name="has_tooltip">True</property>
+                                                            <property name="tooltip" translatable="yes">If a reactive jump is limited by time, and time has running out, allow finish jump</property>
+                                                            <property name="use_action_appearance">False</property>
+                                                            <property name="use_underline">True</property>
+                                                            <property name="draw_indicator">True</property>
+                                                            <signal name="toggled" handler="on_extra_window_checkbutton_allow_finish_rj_after_time_toggled" swapped="no"/>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">3</property>
+                                                            </packing>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -24160,23 +24178,6 @@ show elevation as:</property>
                     <property name="position">1</property>
                   </packing>
                 </child>
-                <child>
-                  <widget class="GtkCheckButton" id="checkbutton_allow_finish_rj_after_time">
-                    <property name="label" translatable="yes">Allow RJ's finish after time</property>
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">False</property>
-                    <property name="tooltip" translatable="yes">If a reactive jump is limited by time, and time has running out, allow finish jump</property>
-                    <property name="use_action_appearance">False</property>
-                    <property name="use_underline">True</property>
-                    <property name="draw_indicator">True</property>
-                  </widget>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">2</property>
-                  </packing>
-                </child>
               </widget>
               <packing>
                 <property name="position">3</property>
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 7ff7054..d62a8e3 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -289,7 +289,6 @@ public partial class ChronoJumpWindow
 	private static bool weightPercentPreferred;
 	private static bool heightPreferred;
 	private static bool metersSecondsPreferred;
-	private static bool allowFinishRjAfterTime;
 
 	private static Person currentPerson;
 	private static Session currentSession;
@@ -752,12 +751,7 @@ public partial class ChronoJumpWindow
 		
 		prefsDigitsNumber = Convert.ToInt32 ( SqlitePreferences.Select("digitsNumber") );
 
-	
-		if ( SqlitePreferences.Select("allowFinishRjAfterTime") == "True" ) 
-			allowFinishRjAfterTime = true;
-		 else 
-			allowFinishRjAfterTime = false;
-		
+		checkbutton_allow_finish_rj_after_time.Active = ( SqlitePreferences.Select("allowFinishRjAfterTime") == "True" );
 			
 		if ( SqlitePreferences.Select("showHeight") == "True" ) 
 			showHeight = true;
@@ -2545,8 +2539,7 @@ public partial class ChronoJumpWindow
 				prefsDigitsNumber, showHeight, showPower, showInitialSpeed, showAngle, showQIndex, showDjIndex, 
 				askDeletion, weightPercentPreferred, heightPreferred, metersSecondsPreferred,
 				//System.Threading.Thread.CurrentThread.CurrentUICulture.ToString(),
-				SqlitePreferences.Select("language"),
-				allowFinishRjAfterTime, volumeOn, videoOn);
+				SqlitePreferences.Select("language"), volumeOn, videoOn);
 		myWin.Button_accept.Clicked += new EventHandler(on_preferences_accepted);
 	}
 
@@ -2627,12 +2620,6 @@ public partial class ChronoJumpWindow
 			metersSecondsPreferred = false;
 		
 
-		//update allowFinish...
-		if ( SqlitePreferences.Select("allowFinishRjAfterTime") == "True" ) 
-			allowFinishRjAfterTime = true;
-		else 
-			allowFinishRjAfterTime = false;
-		
 		//change language works on windows. On Linux let's change the locale
 		//if(Util.IsWindows()) 
 		//	languageChange();
@@ -3275,7 +3262,7 @@ Log.WriteLine("DDD 2");
 				currentSession.UniqueID, currentJumpRjType.Name, myFall, jumpWeight, 
 				progressbarLimit, currentJumpRjType.JumpsLimited, 
 				chronopicWin.CP, event_execute_textview_message, app1, prefsDigitsNumber,
-				allowFinishRjAfterTime, volumeOn, repetitiveConditionsWin, progressbarLimit,
+				checkbutton_allow_finish_rj_after_time.Active, volumeOn, repetitiveConditionsWin, progressbarLimit,
 				egd, image_simulated_warning);
 		
 		
diff --git a/src/gui/jump.cs b/src/gui/jump.cs
index 4bf5ffe..57fee6a 100644
--- a/src/gui/jump.cs
+++ b/src/gui/jump.cs
@@ -1019,6 +1019,7 @@ partial class ChronoJumpWindow
 	[Widget] Gtk.Label extra_window_jumps_rj_label_fall;
 	[Widget] Gtk.Label extra_window_jumps_rj_label_cm;
 	[Widget] Gtk.Label extra_window_label_jumps_rj_no_options;
+	[Widget] Gtk.CheckButton checkbutton_allow_finish_rj_after_time;
 
 	//labels notebook_execute	
 	[Widget] Gtk.Label label_extra_window_radio_jump_free;
@@ -1196,6 +1197,7 @@ partial class ChronoJumpWindow
 		currentEventType = myJumpType;
 		changeTestImage(EventType.Types.JUMP.ToString(), myJumpType.Name, myJumpType.ImageFileName);
 		bool hasOptions = false;
+		checkbutton_allow_finish_rj_after_time.Visible = false;
 	
 		if(myJumpType.FixedValue >= 0) {
 			hasOptions = true;
@@ -1207,6 +1209,7 @@ partial class ChronoJumpWindow
 			} else {
 				extra_window_jumps_rj_jumpsLimited = false;
 				extra_window_jumps_rj_label_limit_units.Text = secondsName;
+				checkbutton_allow_finish_rj_after_time.Visible = true;
 			}
 			if(myJumpType.FixedValue > 0) {
 				extra_window_jumps_rj_spinbutton_limit.Sensitive = false;
@@ -1255,6 +1258,10 @@ partial class ChronoJumpWindow
 		changeTestImage(EventType.Types.JUMP.ToString(), j.Name, j.ImageFileName);
 	}
 
+	private void on_extra_window_checkbutton_allow_finish_rj_after_time_toggled(object o, EventArgs args)
+	{
+		SqlitePreferences.Update("allowFinishRjAfterTime", checkbutton_allow_finish_rj_after_time.Active.ToString(), false);
+	}
 
 	private void on_more_jumps_draw_image_test (object o, EventArgs args) {
 		currentEventType = new JumpType(jumpsMoreWin.SelectedEventName);
diff --git a/src/gui/preferences.cs b/src/gui/preferences.cs
index 5106b66..eacb9c4 100644
--- a/src/gui/preferences.cs
+++ b/src/gui/preferences.cs
@@ -43,7 +43,6 @@ public class PreferencesWindow {
 	[Widget] Gtk.CheckButton checkbutton_initial_speed;
 	[Widget] Gtk.CheckButton checkbutton_angle;
 	
-	[Widget] Gtk.CheckButton checkbutton_allow_finish_rj_after_time;
 	[Widget] Gtk.CheckButton checkbutton_show_tv_tc_index;
 	[Widget] Gtk.Box hbox_indexes;
 	[Widget] Gtk.RadioButton radiobutton_show_q_index;
@@ -101,7 +100,7 @@ public class PreferencesWindow {
 	static public PreferencesWindow Show (int digitsNumber, bool showHeight, bool showPower,  
 			bool showInitialSpeed, bool showAngle, bool showQIndex, bool showDjIndex,
 			bool askDeletion, bool weightStatsPercent, bool heightPreferred, bool metersSecondsPreferred, 
-			string language, bool allowFinishRjAfterTime, bool volumeOn, bool videoOn)
+			string language, bool volumeOn, bool videoOn)
 	{
 		if (PreferencesWindowBox == null) {
 			PreferencesWindowBox = new PreferencesWindow ();
@@ -116,12 +115,6 @@ public class PreferencesWindow {
 		string [] decs = {"1", "2", "3"};
 		PreferencesWindowBox.combo_decimals.Active = UtilGtk.ComboMakeActive(decs, digitsNumber.ToString());
 
-		if(allowFinishRjAfterTime)
-			PreferencesWindowBox.checkbutton_allow_finish_rj_after_time.Active = true; 
-		else
-			PreferencesWindowBox.checkbutton_allow_finish_rj_after_time.Active = false; 
-			
-		
 		if(showHeight) 
 			PreferencesWindowBox.checkbutton_height.Active = true; 
 		else 
@@ -402,7 +395,6 @@ public class PreferencesWindow {
 		SqlitePreferences.Update("showPower", PreferencesWindowBox.checkbutton_power.Active.ToString(), false);
 		SqlitePreferences.Update("showInitialSpeed", PreferencesWindowBox.checkbutton_initial_speed.Active.ToString(), false);
 		SqlitePreferences.Update("showAngle", PreferencesWindowBox.checkbutton_angle.Active.ToString(), false);
-		SqlitePreferences.Update("allowFinishRjAfterTime", PreferencesWindowBox.checkbutton_allow_finish_rj_after_time.Active.ToString(), false);
 		
 		if(PreferencesWindowBox.checkbutton_show_tv_tc_index.Active) {
 			SqlitePreferences.Update("showQIndex", PreferencesWindowBox.radiobutton_show_q_index.Active.ToString(), false);



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