[chronojump] Encoder save curves table done.



commit 30a6489524d26c301bf8ea565c13d02578c46891
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Apr 15 13:38:54 2013 +0200

    Encoder save curves table done.

 glade/chronojump.glade |  71 ++++++++++++++++++++++++++++------
 src/constants.cs       |   4 +-
 src/encoder.cs         |  10 +++++
 src/exportSession.cs   |  24 +++++++-----
 src/gui/encoder.cs     | 101 +++++++++++++++++++++++++++++++++++++++----------
 src/gui/event.cs       |   2 +-
 src/util.cs            |   7 +++-
 src/utilGtk.cs         |   2 +
 8 files changed, 173 insertions(+), 48 deletions(-)
---
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index 7ff9bad..056bf15 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -13717,6 +13717,7 @@ on current Chronojump version.</property>
                                                             <property name="sensitive">False</property>
                                                             <property name="can_focus">True</property>
                                                             <property name="receives_default">True</property>
+                                                            <property name="tooltip" translatable="yes">Save 
image</property>
                                                             <property 
name="use_action_appearance">False</property>
                                                             <signal name="clicked" 
handler="on_button_encoder_analyze_image_save_clicked" swapped="no"/>
                                                             <accelerator key="z" signal="clicked"/>
@@ -13724,7 +13725,6 @@ on current Chronojump version.</property>
                                                             <widget class="GtkImage" 
id="image_encoder_analyze_image_save">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
-                                                            <property name="tooltip" translatable="yes">Save 
image</property>
                                                             <property name="stock">gtk-save</property>
                                                             </widget>
                                                             </child>
@@ -13757,22 +13757,69 @@ on current Chronojump version.</property>
                                                   </packing>
                                                 </child>
                                                 <child>
-                                                  <widget class="GtkScrolledWindow" 
id="scrolledwindow_encoder_analyze_curves">
-                                                    <property name="width_request">200</property>
-                                                    <property name="height_request">175</property>
+                                                  <widget class="GtkHBox" id="hbox83">
                                                     <property name="visible">True</property>
-                                                    <property name="can_focus">True</property>
-                                                    <property name="hscrollbar_policy">automatic</property>
-                                                    <property name="vscrollbar_policy">automatic</property>
-                                                    <property name="shadow_type">etched-in</property>
+                                                    <property name="can_focus">False</property>
                                                     <child>
-                                                      <widget class="GtkTreeView" 
id="treeview_encoder_analyze_curves">
+                                                      <widget class="GtkScrolledWindow" 
id="scrolledwindow_encoder_analyze_curves">
+                                                        <property name="width_request">200</property>
+                                                        <property name="height_request">175</property>
                                                         <property name="visible">True</property>
                                                         <property name="can_focus">True</property>
-                                                        <property name="rules_hint">True</property>
-                                                        <property name="enable_search">False</property>
-                                                        <property name="show_expanders">False</property>
+                                                        <property 
name="hscrollbar_policy">automatic</property>
+                                                        <property 
name="vscrollbar_policy">automatic</property>
+                                                        <property name="shadow_type">etched-in</property>
+                                                        <child>
+                                                          <widget class="GtkTreeView" 
id="treeview_encoder_analyze_curves">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property name="rules_hint">True</property>
+                                                            <property name="enable_search">False</property>
+                                                            <property name="show_expanders">False</property>
+                                                          </widget>
+                                                        </child>
+                                                      </widget>
+                                                      <packing>
+                                                        <property name="expand">True</property>
+                                                        <property name="fill">True</property>
+                                                        <property name="position">0</property>
+                                                      </packing>
+                                                    </child>
+                                                    <child>
+                                                      <widget class="GtkVBox" id="vbox90">
+                                                        <property name="visible">True</property>
+                                                        <property name="can_focus">False</property>
+                                                        <child>
+                                                          <widget class="GtkButton" 
id="button_encoder_analyze_table_save">
+                                                            <property name="visible">True</property>
+                                                            <property name="sensitive">False</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property name="receives_default">True</property>
+                                                            <property name="tooltip" translatable="yes">Save 
table</property>
+                                                            <property 
name="use_action_appearance">False</property>
+                                                            <signal name="clicked" 
handler="on_button_encoder_analyze_table_save_clicked" swapped="no"/>
+                                                            <accelerator key="z" signal="clicked"/>
+                                                            <child>
+                                                            <widget class="GtkImage" 
id="image_encoder_analyze_image_save1">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="stock">gtk-save</property>
+                                                            </widget>
+                                                            </child>
+                                                          </widget>
+                                                          <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="pack_type">end</property>
+                                                            <property name="position">0</property>
+                                                          </packing>
+                                                        </child>
                                                       </widget>
+                                                      <packing>
+                                                        <property name="expand">False</property>
+                                                        <property name="fill">False</property>
+                                                        <property name="position">1</property>
+                                                      </packing>
                                                     </child>
                                                   </widget>
                                                   <packing>
diff --git a/src/constants.cs b/src/constants.cs
index d3ae47f..b9432ef 100644
--- a/src/constants.cs
+++ b/src/constants.cs
@@ -173,7 +173,7 @@ public class Constants
        public static string TakeOffWeightName = "TakeOffWeight"; //translate (take off?)
 
 
-       public static string SpreadsheetString = "\n\n" + Catalog.GetString("When import from your 
spreadsheet (OpenOffice, R, MS Excel, ...)\nremember the separator character is semicolon: <b>;</b>");
+       public static string SpreadsheetString = "\n\n" + Catalog.GetString("When import from your 
spreadsheet (OpenOffice, R, MS Excel, ...)\nremember the separator character is semicolon <b>;</b>, or comma 
<b>,</b>.");
 
 /*     OLD, check this
        public static string PotencyLewisCMJFormula = Catalog.GetString("Peak Power")+ " CMJ (Lewis) " +
@@ -594,7 +594,7 @@ public class Constants
        //if this name changes, change it in encoder/graph.R
        public static string EncoderGraphInputMulti = "chronojump-encoder-graph-input-multi.csv"; 
 
-       public enum EncoderCheckFileOp { ANALYZE_EXPORT_ALL_CURVES, ANALYZE_SAVE_IMAGE}
+       public enum EncoderCheckFileOp { ANALYZE_EXPORT_ALL_CURVES, ANALYZE_SAVE_IMAGE, ANALYZE_SAVE_TABLE}
 
        public enum DoubleContact {
                FIRST, AVERAGE, LAST
diff --git a/src/encoder.cs b/src/encoder.cs
index 0c99d99..3c995c0 100644
--- a/src/encoder.cs
+++ b/src/encoder.cs
@@ -210,6 +210,16 @@ public class EncoderCurve
                this.PP_PPT = PP_PPT;   //PeakPower / PeakPowerTime
        }
 
+       public string ToCSV() {
+               string sep = ";";
+               return 
+                       N + sep + Series + sep + Exercise + sep + ExtraWeight + sep + 
+                       Start + sep + Duration + sep + Height + sep + 
+                       MeanSpeed + sep + MaxSpeed + sep + MaxSpeedT + sep + 
+                       MeanPower + sep + PeakPower + sep + PeakPowerT + sep + 
+                       PP_PPT;
+       }
+
        public string N;
        public string Series;
        public string Exercise;
diff --git a/src/exportSession.cs b/src/exportSession.cs
index 52ee2bd..8be303c 100644
--- a/src/exportSession.cs
+++ b/src/exportSession.cs
@@ -210,7 +210,8 @@ public class ExportSession
                                Catalog.GetString ("Date") + ":" + 
                                Catalog.GetString ("Comments") );
                myData.Add ( mySession.UniqueID + ":" + mySession.Name + ":" +
-                                       mySession.Place + ":" + mySession.DateShort + ":" + 
Util.RemoveNewLine(mySession.Comments) );
+                                       mySession.Place + ":" + mySession.DateShort + ":" + 
+                                       Util.RemoveNewLine(mySession.Comments, true) );
                writeData(myData);
                writeData("VERTICAL-SPACE");
        }
@@ -235,11 +236,11 @@ public class ExportSession
                        myData.Add(
                                        p.UniqueID.ToString() + ":" + p.Name + ":" +
                                        p.Sex + ":" + p.DateBorn.ToShortDateString() + ":" +
-                                       Util.RemoveNewLine(p.Description) + ":" +
+                                       Util.RemoveNewLine(p.Description, true) + ":" +
                                        ps.Height + ":" + ps.Weight + ":" + 
                                        sportName + ":" + speciallityName + ":" +
                                        Util.FindLevelName(ps.Practice) + ":" +
-                                       Util.RemoveNewLine(ps.Comments)
+                                       Util.RemoveNewLine(ps.Comments, true)
                                  );
                }
                
@@ -319,7 +320,7 @@ public class ExportSession
                                                Util.TrimDecimals(Util.GetHeightInCentimeters(myStr[5]), dec) 
+ ":" +  
                                                power + ":" +  
                                                Util.TrimDecimals(Util.GetInitialSpeed(myStr[5], true), dec) 
+ ":" +  //true: m/s
-                                               Util.RemoveNewLine(myStr[9]) + ":" +    //jump.description
+                                               Util.RemoveNewLine(myStr[9], true) + ":" +      
//jump.description
                                                Util.TrimDecimals(myStr[10],dec) + ":" +        //jump.angle
                                                Util.SimulatedTestNoYes(Convert.ToInt32(myStr[11]))           
  //jump.simulated
                                                
@@ -414,7 +415,7 @@ public class ExportSession
                                        //myStr[8] + ":" +  myStr[14] + ":" +   //jumpRj.Weight, jumpRj.Jumps
                                        Util.TrimDecimals(myWeight,dec) + ":" +  myStr[14] + ":" +      
//jumpRj.Weight, jumpRj.Jumps
                                        Util.TrimDecimals(myStr[15], dec) + ":" +  
Util.GetLimitedRounded(myStr[16],dec) + ":" +        //jumpRj.Time, jumpRj.Limited
-                                       Util.RemoveNewLine(myStr[9]) + ":" +    //jumpRj.Description
+                                       Util.RemoveNewLine(myStr[9], true) + ":" +      //jumpRj.Description
                                        //myStr[17] + ":" +     //jumpRj.Angle
                                        Util.SimulatedTestNoYes(Convert.ToInt32(myStr[18]))             
//simulated
                                        );
@@ -499,7 +500,7 @@ public class ExportSession
                                                myStr[4] + ":" +  myStr[5] + ":" +      //run.type, 
run.distance
                                                Util.TrimDecimals(myStr[6], dec) + ":" +        //run.time
                                                speed + ":" +                           //speed in m/s (true)
-                                               Util.RemoveNewLine(myStr[7]) + ":" +    //description
+                                               Util.RemoveNewLine(myStr[7], true) + ":" +      //description
                                                Util.SimulatedTestNoYes(Convert.ToInt32(myStr[8])) + ":" + 
//simulated
                                                Util.NoYes(Util.StringToBool(myStr[9])) //initialSpeed
                                           );
@@ -560,7 +561,7 @@ public class ExportSession
                                        Util.TrimDecimals(Util.GetSpeed(myStr[5], myStr[6], true), dec) + ":" 
+         //speed AVG in m/s(true)
                                        myStr[7] + ":" +                //run.distanceInterval
                                        myStr[9] + ":" +  Util.GetLimitedRounded(myStr[11], dec) + ":" +      
  //tracks, limited
-                                       Util.RemoveNewLine(myStr[10]) + ":" +   //description
+                                       Util.RemoveNewLine(myStr[10], true) + ":" +     //description
                                        Util.SimulatedTestNoYes(Convert.ToInt32(myStr[12])) + ":" +     
//simulated
                                        Util.NoYes(Util.StringToBool(myStr[13]))        //initialSpeed
                                   );
@@ -641,7 +642,8 @@ public class ExportSession
                                                //myStr[2] + ":" +  myStr[3] + ":" +    //jump.personID, 
jump.sessionID
                                                //myStr[4] + ":" +  //type
                                                Util.TrimDecimals(myStr[5], dec) + ":" +        //time
-                                               Util.RemoveNewLine(myStr[6]) + ":" + 
Util.SimulatedTestNoYes(Convert.ToInt32(myStr[7])) //description, simulated
+                                               Util.RemoveNewLine(myStr[6], true) + ":" + 
+                                               Util.SimulatedTestNoYes(Convert.ToInt32(myStr[7]))      
//description, simulated
                                           );
                        }
                        writeData(myData);
@@ -678,7 +680,8 @@ public class ExportSession
                                        myStr[2] + ":" +                        //personID
                                        myStr[0] + ":" +  myStr[1] + ":" +      //person.name, pulse.uniqueID
                                        myStr[4] + ":" +                        //type
-                                       Util.RemoveNewLine(myStr[8]) + ":" + 
Util.SimulatedTestNoYes(Convert.ToInt32(myStr[9]))         //description, simulated
+                                       Util.RemoveNewLine(myStr[8], true) + ":" + 
+                                       Util.SimulatedTestNoYes(Convert.ToInt32(myStr[9]))              
//description, simulated
                                   );
                        
                        writeData(myData);
@@ -761,7 +764,8 @@ public class ExportSession
                                        mc.PersonID + ":" +                     
                                        myStr[0] + ":" +  mc.UniqueID + ":" +   //person.name, mc.uniqueID
                                        mc.Type + " " + typeExtra  + ":" +                      
-                                       Util.RemoveNewLine(mc.Description) + ":" + 
Util.SimulatedTestNoYes(Convert.ToInt32(mc.Simulated.ToString()))
+                                       Util.RemoveNewLine(mc.Description, true) + ":" + 
+                                       Util.SimulatedTestNoYes(Convert.ToInt32(mc.Simulated.ToString()))
                                   );
                        
                        writeData(myData);
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index 513ba5f..70d9200 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -81,6 +81,7 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Button button_encoder_analyze_data_compare;
        
        [Widget] Gtk.Button button_encoder_analyze_image_save;
+       [Widget] Gtk.Button button_encoder_analyze_table_save;
 
        [Widget] Gtk.RadioButton radiobutton_encoder_analyze_powerbars;
        [Widget] Gtk.RadioButton radiobutton_encoder_analyze_cross;
@@ -972,12 +973,16 @@ public partial class ChronoJumpWindow
                        exportString = Catalog.GetString ("Export session in format CSV");
                else if(checkFileOp == Constants.EncoderCheckFileOp.ANALYZE_SAVE_IMAGE)
                        exportString = Catalog.GetString ("Save image");
+               else if(checkFileOp == Constants.EncoderCheckFileOp.ANALYZE_SAVE_TABLE)
+                       exportString = Catalog.GetString ("Save table");
                
                string nameString = ""; 
                if(checkFileOp == Constants.EncoderCheckFileOp.ANALYZE_EXPORT_ALL_CURVES)
                        nameString = "encoder_export.csv";
                else if(checkFileOp == Constants.EncoderCheckFileOp.ANALYZE_SAVE_IMAGE)
                        nameString = "encoder_image.png";
+               else if(checkFileOp == Constants.EncoderCheckFileOp.ANALYZE_SAVE_TABLE)
+                       nameString = "encoder_curves_table.csv";
                
                Gtk.FileChooserDialog fc=
                        new Gtk.FileChooserDialog(exportString,
@@ -992,7 +997,8 @@ public partial class ChronoJumpWindow
                {
                        exportFileName = fc.Filename;
                        //add ".csv" if needed
-                       if(checkFileOp == Constants.EncoderCheckFileOp.ANALYZE_EXPORT_ALL_CURVES)
+                       if(checkFileOp == Constants.EncoderCheckFileOp.ANALYZE_EXPORT_ALL_CURVES ||
+                                       checkFileOp == Constants.EncoderCheckFileOp.ANALYZE_SAVE_TABLE)
                                exportFileName = Util.AddCsvIfNeeded(exportFileName);
                        try {
                                if (File.Exists(exportFileName)) {
@@ -1012,12 +1018,17 @@ public partial class ChronoJumpWindow
                                        else if(checkFileOp == 
Constants.EncoderCheckFileOp.ANALYZE_SAVE_IMAGE)
                                                confirmWin.Button_accept.Clicked += 
                                                        new 
EventHandler(on_overwrite_file_encoder_save_image_accepted);
+                                       else if(checkFileOp == 
Constants.EncoderCheckFileOp.ANALYZE_SAVE_TABLE)
+                                               confirmWin.Button_accept.Clicked += 
+                                                       new 
EventHandler(on_overwrite_file_encoder_save_table_accepted);
 
                                } else {
                                        if(checkFileOp == 
Constants.EncoderCheckFileOp.ANALYZE_EXPORT_ALL_CURVES)
                                                on_button_encoder_export_all_curves_file_selected 
(exportFileName);
                                        else if(checkFileOp == 
Constants.EncoderCheckFileOp.ANALYZE_SAVE_IMAGE)
                                                on_button_encoder_save_image_file_selected (exportFileName);
+                                       else if(checkFileOp == 
Constants.EncoderCheckFileOp.ANALYZE_SAVE_TABLE)
+                                               on_button_encoder_save_table_file_selected (exportFileName);
 
                                        string myString = string.Format(Catalog.GetString("Saved to {0}"), 
                                                        exportFileName);
@@ -1025,8 +1036,7 @@ public partial class ChronoJumpWindow
                                                myString += Constants.SpreadsheetString;
                                        new DialogMessage(Constants.MessageTypes.INFO, myString);
                                }
-                       } 
-                       catch {
+                       } catch {
                                string myString = string.Format(
                                                Catalog.GetString("Cannot save file {0} "), exportFileName);
                                new DialogMessage(Constants.MessageTypes.WARNING, myString);
@@ -1060,6 +1070,13 @@ public partial class ChronoJumpWindow
                string myString = string.Format(Catalog.GetString("Saved to {0}"), exportFileName);
                new DialogMessage(Constants.MessageTypes.INFO, myString);
        }
+       private void on_overwrite_file_encoder_save_table_accepted(object o, EventArgs args)
+       {
+               on_button_encoder_save_table_file_selected (exportFileName);
+
+               string myString = string.Format(Catalog.GetString("Saved to {0}"), exportFileName);
+               new DialogMessage(Constants.MessageTypes.INFO, myString);
+       }
        
        
        void on_button_encoder_delete_signal_clicked (object o, EventArgs args) 
@@ -2029,6 +2046,54 @@ Log.WriteLine(str);
                }
        }
 
+       void on_button_encoder_analyze_table_save_clicked (object o, EventArgs args)
+       {
+               /* file is in:
+                * /tmp/chronojump-last-encoder-curves.txt
+                * but if a capture curves has done, file is named the same
+                * make unsensitive the capture table after loading or capturing a new signal
+                * or changing person, loading session, ...
+                * No problem. Is nice to play with seinsitiveness, but the reading will be from treeview and 
not from file
+                */
+
+               checkFile(Constants.EncoderCheckFileOp.ANALYZE_SAVE_TABLE);
+       }
+       void on_button_encoder_save_table_file_selected (string destination)
+       {
+               try {
+                       //this overwrites if needed
+                       TextWriter writer = File.CreateText(destination);
+
+                       //wrrite header
+                       writer.WriteLine(Util.RemoveNewLine(Util.StringArrayToString(
+                                               treeviewEncoderAnalyzeHeaders, ";"), false));
+                       //write curves rows
+                       ArrayList array = getTreeViewCurves(encoderAnalyzeListStore);
+                       foreach (EncoderCurve ec in array)
+                               writer.WriteLine(ec.ToCSV());
+                       
+                       writer.Flush();
+                       ((IDisposable)writer).Dispose();
+               } catch {
+                       string myString = string.Format(
+                                       Catalog.GetString("Cannot save file {0} "), destination);
+                       new DialogMessage(Constants.MessageTypes.WARNING, myString);
+               }
+       }
+       
+       ArrayList getTreeViewCurves(Gtk.ListStore ls) {
+               TreeIter iter = new TreeIter();
+               ls.GetIterFirst ( out iter ) ;
+               ArrayList array = new ArrayList();
+               do {
+                       EncoderCurve ec = (EncoderCurve) ls.GetValue (iter, 0);
+                       array.Add(ec);
+               } while (ls.IterNext (ref iter));
+               return array;
+       }
+
+
+       
        void on_button_encoder_exercise_info_clicked (object o, EventArgs args) 
        {
                int exerciseID = Convert.ToInt32(
@@ -2254,9 +2319,8 @@ Log.WriteLine(str);
                }
                return curvesCount;
        }
-       
-       private int createTreeViewEncoderAnalyze(string contents) {
-               string [] columnsString = {
+
+       string [] treeviewEncoderAnalyzeHeaders = {
                        Catalog.GetString("Curve") + "\n",
                        Catalog.GetString("Series") + "\n",
                        Catalog.GetString("Exercise") + "\n",
@@ -2273,6 +2337,9 @@ Log.WriteLine(str);
                        Catalog.GetString("PeakPower/PPT") + "\n (W/s)"
                };
 
+       private int createTreeViewEncoderAnalyze(string contents) {
+               string [] columnsString = treeviewEncoderAnalyzeHeaders;
+
                ArrayList encoderAnalyzeCurves = new ArrayList ();
 
                //write exercise and extra weight data
@@ -2289,21 +2356,15 @@ Log.WriteLine(str);
 
                string line;
                int curvesCount = 0;
-Log.Write("a");
                using (StringReader reader = new StringReader (contents)) {
-Log.Write("b");
                        line = reader.ReadLine ();      //headers
                        Log.WriteLine(line);
-Log.Write("c");
                        do {
-Log.Write("d");
                                line = reader.ReadLine ();
                                Log.WriteLine(line);
                                if (line == null)
                                        break;
 
-Log.Write("e");
-
                                curvesCount ++;
 
                                string [] cells = line.Split(new char[] {','});
@@ -2320,7 +2381,6 @@ Log.Write("e");
                                        mass = cells[3];
                                }
 
-Log.Write("f");
                                encoderAnalyzeCurves.Add (new EncoderCurve (
                                                        cells[0], 
                                                        cells[1],       //seriesName 
@@ -2332,11 +2392,8 @@ Log.Write("f");
                                                        cells[13]
                                                        ));
 
-Log.Write("g");
                        } while(true);
-Log.Write("h");
                }
-Log.Write("i");
 
                encoderAnalyzeListStore = new Gtk.ListStore (typeof (EncoderCurve));
                foreach (EncoderCurve curve in encoderAnalyzeCurves) 
@@ -2348,8 +2405,6 @@ Log.Write("i");
 
                treeview_encoder_analyze_curves.HeadersVisible=true;
 
-
-Log.Write("j");
                int i=0;
                foreach(string myCol in columnsString) {
                        Gtk.TreeViewColumn aColumn = new Gtk.TreeViewColumn ();
@@ -2361,7 +2416,6 @@ Log.Write("j");
                        //crt1.Background = "blue";
                
                
-Log.Write("k");
                        switch(i){      
                                case 0:
                                        aColumn.SetCellDataFunc (aCell, new Gtk.TreeCellDataFunc 
(RenderNAnalyze));
@@ -2411,7 +2465,6 @@ Log.Write("k");
                        i++;
                }
                return curvesCount;
-Log.Write("l");
        }
 
        /* rendering columns */
@@ -2765,6 +2818,7 @@ Log.Write("l");
                image_encoder_analyze.Sensitive = false;
                treeview_encoder_analyze_curves.Sensitive = false;
                button_encoder_analyze_image_save.Sensitive = false;
+               button_encoder_analyze_table_save.Sensitive = false;
 
                //put some data just in case user doesn't click on compare button
                encoderCompareInitialize();
@@ -3066,7 +3120,9 @@ Log.Write("l");
                        GLib.Idle.Add (new GLib.IdleHandler (pulseGTKEncoderAnalyze));
 
                        encoderButtonsSensitive(encoderSensEnum.PROCESSINGR);
+                       treeview_encoder_analyze_curves.Sensitive = false;
                        button_encoder_analyze_image_save.Sensitive = false;
+                       button_encoder_analyze_table_save.Sensitive = false;
 
                        encoderThreadR.Start(); 
                }
@@ -3230,7 +3286,9 @@ Log.Write("l");
                        encoder_pulsebar_capture.Fraction = 1;
                        //analyze_image_save only has not to be sensitive now because capture graph will be 
saved
                        image_encoder_analyze.Sensitive = false;
+                       treeview_encoder_analyze_curves.Sensitive = false;
                        button_encoder_analyze_image_save.Sensitive = false;
+                       button_encoder_analyze_table_save.Sensitive = false;
 
                } else { //ANALYZE
                        if(encoderProcessCancel) {
@@ -3252,8 +3310,9 @@ Log.Write("l");
                        encoder_pulsebar_analyze.Fraction = 1;
                        encoderButtonsSensitive(encoderSensEnumStored);
                        image_encoder_analyze.Sensitive = true;
-                       button_encoder_analyze_image_save.Sensitive = true;
                        treeview_encoder_analyze_curves.Sensitive = true;
+                       button_encoder_analyze_image_save.Sensitive = true;
+                       button_encoder_analyze_table_save.Sensitive = true;
                }
 
                treeview_encoder_capture_curves.Sensitive = true;
diff --git a/src/gui/event.cs b/src/gui/event.cs
index 23b1a31..a8bac2a 100644
--- a/src/gui/event.cs
+++ b/src/gui/event.cs
@@ -261,7 +261,7 @@ public class EditEventWindow
 
                //also remove new line for old descriptions that used a textview
                string temp = Util.RemoveTildeAndColonAndDot(myEvent.Description);
-               entry_description.Text = Util.RemoveNewLine(temp);
+               entry_description.Text = Util.RemoveNewLine(temp, true);
 
                createComboEventType(myEvent);
                
diff --git a/src/util.cs b/src/util.cs
index 2f3b2c9..916ff92 100644
--- a/src/util.cs
+++ b/src/util.cs
@@ -293,10 +293,13 @@ public class Util
                return myStringBuilder.ToString();
        }
 
-       public static string RemoveNewLine(string myString) 
+       public static string RemoveNewLine(string myString, bool changeBySpace) 
        {
                StringBuilder myStringBuilder = new StringBuilder(myString);
-               myStringBuilder.Replace("\n", " ");
+               if(changeBySpace)
+                       myStringBuilder.Replace("\n", " ");
+               else
+                       myStringBuilder.Replace("\n", "");
                return myStringBuilder.ToString();
        }
 
diff --git a/src/utilGtk.cs b/src/utilGtk.cs
index 90cbb47..6e4f0cc 100644
--- a/src/utilGtk.cs
+++ b/src/utilGtk.cs
@@ -20,6 +20,7 @@
 
 using System;
 using System.Text; //StringBuilder
+using System.Collections; //ArrayList
 using Gtk;
 using Gdk;
 
@@ -218,6 +219,7 @@ public class UtilGtk
        }
 
 
+
        /*
         *
         * COLORS


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