[chronojump] Better code for CSV column delimiter



commit 1f2c13ab77adbb6f264b62b5fcce83cd13b32254
Author: Xavier de Blas <xaviblas gmail com>
Date:   Tue Sep 18 13:09:54 2018 +0200

    Better code for CSV column delimiter

 src/gui/chronojump.cs |  6 +-----
 src/preferences.cs    | 10 ++++++++++
 2 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index fe97594e..f6e953d7 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -2775,11 +2775,7 @@ public partial class ChronoJumpWindow
 
        private void person_add_multiple ()
        {
-               char columnDelimiter = ',';
-               if(preferences.CSVExportDecimalSeparator == "COMMA")
-                       columnDelimiter = ';';
-
-               personAddMultipleWin = PersonAddMultipleWindow.Show(app1, currentSession, columnDelimiter);
+               personAddMultipleWin = PersonAddMultipleWindow.Show(app1, currentSession, 
preferences.CSVColumnDelimiter);
                personAddMultipleWin.Button_accept.Clicked -= new 
EventHandler(on_person_add_multiple_accepted);
                personAddMultipleWin.Button_accept.Clicked += new 
EventHandler(on_person_add_multiple_accepted);
        }
diff --git a/src/preferences.cs b/src/preferences.cs
index 9539a2ff..90a30710 100644
--- a/src/preferences.cs
+++ b/src/preferences.cs
@@ -296,6 +296,16 @@ public class Preferences
                        " Kg\n\t- at: " + forceSensorCalibrationDateTime;
        }
 
+       public char CSVColumnDelimiter
+       {
+               get {
+                       char columnDelimiter = ',';
+                       if(CSVExportDecimalSeparator == "COMMA")
+                               columnDelimiter = ';';
+
+                       return columnDelimiter;
+               }
+       }
 
        ~Preferences() {}
           


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