[chronojump] small code cleaning



commit f99f19a3e503d7f432acd5a7fe53150d225bfa20
Author: Xavier de Blas <xaviblas gmail com>
Date:   Sat Dec 26 04:26:05 2009 +0100

    small code cleaning

 src/gui/chronojump.cs  |   65 +----------------------------------------------
 src/gui/chronopic.cs   |    5 ---
 src/gui/preferences.cs |   62 ---------------------------------------------
 3 files changed, 2 insertions(+), 130 deletions(-)
---
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index a616995..e228427 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -142,22 +142,8 @@ public class ChronoJumpWindow
 	[Widget] Gtk.MenuItem menuitem_run_analysis;
 	[Widget] Gtk.Button button_run_analysis;
 	[Widget] Gtk.Entry entry_run_analysis_distance;
-	/*
-	[Widget] Gtk.ComboBox combo_port_linux;
-	[Widget] Gtk.ComboBox combo_port_windows;
-	[Widget] Gtk.Button button_connect_cp;
-	*/
-
-	/*
-	[Widget] Gtk.Image image_cp1_yes;
-	[Widget] Gtk.Image image_cp1_no;
-	[Widget] Gtk.Image image_cp2_yes;
-	[Widget] Gtk.Image image_cp2_no;
-	[Widget] Gtk.Image image_cp3_yes;
-	[Widget] Gtk.Image image_cp3_no;
-	[Widget] Gtk.Image image_cp4_yes;
-	[Widget] Gtk.Image image_cp4_no;
-	*/
+	
+	
 	[Widget] Gtk.CheckButton check_multi_sync;
 	[Widget] Gtk.CheckButton check_multi_delete_first;
 	
@@ -220,9 +206,6 @@ public class ChronoJumpWindow
 	[Widget] Gtk.Button button_show_all_person_events;
 	[Widget] Gtk.MenuItem show_all_person_events;
 	
-//	[Widget] Gtk.RadioMenuItem menuitem_simulated;
-//	[Widget] Gtk.RadioMenuItem menuitem_chronopic;
-	
 	[Widget] Gtk.Notebook notebook;
 	
 	[Widget] Gtk.Box vbox_image_test;
@@ -256,15 +239,6 @@ public class ChronoJumpWindow
 	Random rand;
 	bool volumeOn;
 
-	/*
-	//chronopic connection thread
-	Thread thread;
-	bool needUpdateChronopicWin;
-	bool updateChronopicWinValuesState;
-	string updateChronopicWinValuesMessage;
-	[Widget] Gtk.Button fakeChronopicButton; //raised when chronopic detection ended
-	*/
-	
 	//persons
 	private TreeStore treeview_persons_store;
 	private TreeViewPersons myTreeViewPersons;
@@ -291,7 +265,6 @@ public class ChronoJumpWindow
 	private TreeViewMultiChronopic myTreeViewMultiChronopic;
 
 	//preferences variables
-	//private static string chronopicPort;
 	private static int prefsDigitsNumber;
 	private static bool showHeight;
 	private static bool showPower;
@@ -299,7 +272,6 @@ public class ChronoJumpWindow
 	private static bool showAngle;
 	private static bool showQIndex;
 	private static bool showDjIndex;
-//	private static bool simulated;
 	private static bool askDeletion;
 	private static bool weightPercentPreferred;
 	private static bool heightPreferred;
@@ -377,36 +349,6 @@ public class ChronoJumpWindow
 	
 	static EventExecuteWindow eventExecuteWin;
 
-	bool cpRunning;
-	
-	
-	/*
-	int currentCp; //1 to 4
-
-	//cp1	
-	Chronopic cp;
-	SerialPort sp;
-	Chronopic.Plataforma platformState;	//on (in platform), off (jumping), or unknow
-	
-	//cp2	
-	Chronopic cp2;
-	SerialPort sp2;
-	Chronopic.Plataforma platformState2;
-
-	//cp3	
-	Chronopic cp3;
-	SerialPort sp3;
-	Chronopic.Plataforma platformState3;
-
-	//cp4	
-	Chronopic cp4;
-	SerialPort sp4;
-	Chronopic.Plataforma platformState4;
-
-	States loggedState;		//log of last state
-	*/
-
-
 	private bool firstRjValue;
 	private double rjTcCount;
 	private double rjTvCount;
@@ -2289,7 +2231,6 @@ public class ChronoJumpWindow
 
 	private void on_preferences_activate (object o, EventArgs args) {
 		PreferencesWindow myWin = PreferencesWindow.Show(
-				//chronopicPort, prefsDigitsNumber, showHeight, showPower, showInitialSpeed, showAngle, showQIndex, showDjIndex, 
 				prefsDigitsNumber, showHeight, showPower, showInitialSpeed, showAngle, showQIndex, showDjIndex, 
 				askDeletion, weightPercentPreferred, heightPreferred, metersSecondsPreferred,
 				//System.Threading.Thread.CurrentThread.CurrentUICulture.ToString(),
@@ -5129,9 +5070,7 @@ Console.WriteLine("X");
 	}
 
 	private void on_menuitem_chronopic_activate (object o, EventArgs args) {
-		Log.WriteLine("CP a");
 		chronopicWin = ChronopicWindow.View();
-		Log.WriteLine("CP b");
 	}
 	private void on_menuitem_server_activate (object o, EventArgs args) {
 		Log.WriteLine("SERVER");
diff --git a/src/gui/chronopic.cs b/src/gui/chronopic.cs
index 0102ad6..f1a4106 100644
--- a/src/gui/chronopic.cs
+++ b/src/gui/chronopic.cs
@@ -36,8 +36,6 @@ public class ChronopicWindow
 	ChronopicConnection chronopicConnectionWin;
 
 
-	//[Widget] Gtk.Button button_connect_cp;
-
 	[Widget] Gtk.Image image_cp1_yes;
 	[Widget] Gtk.Image image_cp1_no;
 	[Widget] Gtk.Image image_cp2_yes;
@@ -49,9 +47,6 @@ public class ChronopicWindow
 				
 	//[Widget] Gtk.Entry entry_multi_chronopic_cp2;
 	
-//	[Widget] Gtk.RadioMenuItem menuitem_simulated;
-//	[Widget] Gtk.RadioMenuItem menuitem_chronopic;
-
 	[Widget] Gtk.ComboBox combo_linux1;
 	[Widget] Gtk.ComboBox combo_windows1;
 	string [] comboWindowsOptions;
diff --git a/src/gui/preferences.cs b/src/gui/preferences.cs
index 933d737..0d5b706 100644
--- a/src/gui/preferences.cs
+++ b/src/gui/preferences.cs
@@ -32,9 +32,6 @@ public class PreferencesWindow {
 	
 	[Widget] Gtk.Window preferences;
 
-//	[Widget] Gtk.ComboBox combo_port_linux;
-//	[Widget] Gtk.ComboBox combo_port_windows;
-
 	[Widget] Gtk.Label label_database;
 	[Widget] Gtk.Label label_database_temp;
 	[Widget] Gtk.Label label_logs;
@@ -67,10 +64,7 @@ public class PreferencesWindow {
 	//dialogMessage
 	private string languageIni;
 
-//	string [] comboWindowsOptions;
-	
 
-	//PreferencesWindow (string entryChronopic) {
 	PreferencesWindow () {
 		Glade.XML gladeXML;
 		gladeXML = Glade.XML.FromAssembly (Util.GetGladePath() + "chronojump.glade", "preferences", null);
@@ -79,36 +73,6 @@ public class PreferencesWindow {
 		//put an icon to window
 		UtilGtk.IconWindow(preferences);
 
-		/*
-		//combo port stuff
-		comboWindowsOptions = new string[257];
-		int count = 0;
-		for (int i=1; i <= 257; i ++)
-			comboWindowsOptions[i-1] = "COM" + i;
-
-		if(Util.IsWindows()) {
-			UtilGtk.ComboUpdate(combo_port_windows, comboWindowsOptions, comboWindowsOptions[0]);
-			
-			if(entryChronopic.Length > 0)
-				combo_port_windows.Active = UtilGtk.ComboMakeActive(comboWindowsOptions, entryChronopic);
-			else
-				combo_port_windows.Active = 0; //first option
-		} else {
-			string [] usbSerial = Directory.GetFiles("/dev/", "ttyUSB*");
-			string [] serial = Directory.GetFiles("/dev/", "ttyS*");
-			string [] all = Util.AddArrayString(usbSerial, serial);
-			string [] def = Util.StringToStringArray(Constants.ChronopicDefaultPortLinux);
-			string [] allWithDef = Util.AddArrayString(def, all);
-	
-			UtilGtk.ComboUpdate(combo_port_linux, allWithDef, Constants.ChronopicDefaultPortLinux);
-			
-			if(entryChronopic.Length > 0)
-				combo_port_linux.Active = UtilGtk.ComboMakeActive(allWithDef, entryChronopic);
-			else 
-				combo_port_linux.Active = 0; //first option
-		}
-		*/
-
 		label_database.Visible = false;
 		label_database_temp.Visible = false;
 
@@ -118,27 +82,15 @@ public class PreferencesWindow {
 		//label_logs.Text = Log.GetDir();
 	}
 	
-	//static public PreferencesWindow Show (string entryChronopic, int digitsNumber, bool showHeight, bool showPower,  
 	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)
 	{
 		if (PreferencesWindowBox == null) {
-			//PreferencesWindowBox = new PreferencesWindow (entryChronopic);
 			PreferencesWindowBox = new PreferencesWindow ();
 		}
 
-		/*
-		if(Util.IsWindows()) {
-			PreferencesWindowBox.combo_port_linux.Hide();
-			PreferencesWindowBox.combo_port_windows.Show();
-		} else {
-			PreferencesWindowBox.combo_port_windows.Hide();
-			PreferencesWindowBox.combo_port_linux.Show();
-		}
-		*/
-
 		PreferencesWindowBox.languageIni = language;
 		//if(Util.IsWindows())
 		//	PreferencesWindowBox.createComboLanguage(language);
@@ -365,14 +317,6 @@ public class PreferencesWindow {
 	void on_button_accept_clicked (object o, EventArgs args)
 	{
 		/* the falses are for the dbcon that is not opened */
-
-		/*
-		if(Util.IsWindows()) 
-			SqlitePreferences.Update("chronopicPort", UtilGtk.ComboGetActive(combo_port_windows), false);
-		else
-			SqlitePreferences.Update("chronopicPort", UtilGtk.ComboGetActive(combo_port_linux), false);
-			*/
-		
 		SqlitePreferences.Update("digitsNumber", UtilGtk.ComboGetActive(combo_decimals), false);
 		SqlitePreferences.Update("showHeight", PreferencesWindowBox.checkbutton_height.Active.ToString(), false);
 		SqlitePreferences.Update("showPower", PreferencesWindowBox.checkbutton_power.Active.ToString(), false);
@@ -416,12 +360,6 @@ public class PreferencesWindow {
 		PreferencesWindowBox = null;
 	}
 
-	/*
-	private void on_button_help_clicked (object o, EventArgs args) {
-		new HelpPorts();
-	}
-	*/
-
 	public Button Button_accept 
 	{
 		set { button_accept = value; }



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