[chronojump] Message if load signal not found file
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Message if load signal not found file
- Date: Sat, 2 Mar 2013 12:32:58 +0000 (UTC)
commit 4f18d64890c2a1943b4a925ca782a722970136e0
Author: Xavier de Blas <xaviblas gmail com>
Date: Sat Mar 2 13:32:15 2013 +0100
Message if load signal not found file
src/gui/encoder.cs | 38 ++++++++++++++++++++++----------------
src/util.cs | 7 +++++--
2 files changed, 27 insertions(+), 18 deletions(-)
---
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index 7aee64e..0f75d44 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -525,26 +525,32 @@ public partial class ChronoJumpWindow
ArrayList data = SqliteEncoder.Select(
false, uniqueID, currentPerson.UniqueID, currentSession.UniqueID, "signal",
false);
+ bool success = false;
foreach(EncoderSQL es in data) { //it will run only one time
- Util.CopyEncoderDataToTemp(es.url, es.filename);
- combo_encoder_exercise.Active = UtilGtk.ComboMakeActive(combo_encoder_exercise,
es.exerciseName);
- combo_encoder_eccon.Active = UtilGtk.ComboMakeActive(combo_encoder_eccon,
es.ecconLong);
- combo_encoder_laterality.Active = UtilGtk.ComboMakeActive(combo_encoder_laterality,
es.laterality);
- spin_encoder_extra_weight.Value = Convert.ToInt32(es.extraWeight);
-
- spin_encoder_capture_min_height.Value = es.minHeight;
- spin_encoder_smooth.Value = es.smooth;
- entry_encoder_signal_comment.Text = es.description;
- encoderTimeStamp = es.GetDate(false);
- encoderSignalUniqueID = es.uniqueID;
+ success = Util.CopyEncoderDataToTemp(es.url, es.filename);
+ if(success) {
+ combo_encoder_exercise.Active =
UtilGtk.ComboMakeActive(combo_encoder_exercise, es.exerciseName);
+ combo_encoder_eccon.Active = UtilGtk.ComboMakeActive(combo_encoder_eccon,
es.ecconLong);
+ combo_encoder_laterality.Active =
UtilGtk.ComboMakeActive(combo_encoder_laterality, es.laterality);
+ spin_encoder_extra_weight.Value = Convert.ToInt32(es.extraWeight);
+
+ spin_encoder_capture_min_height.Value = es.minHeight;
+ spin_encoder_smooth.Value = es.smooth;
+ entry_encoder_signal_comment.Text = es.description;
+ encoderTimeStamp = es.GetDate(false);
+ encoderSignalUniqueID = es.uniqueID;
+ }
}
-
- //force a recalculate
- on_button_encoder_recalculate_clicked (o, args);
+
+ if(success) {
+ //force a recalculate
+ on_button_encoder_recalculate_clicked (o, args);
- radiobutton_encoder_analyze_data_current_signal.Active = true;
+ radiobutton_encoder_analyze_data_current_signal.Active = true;
- encoderButtonsSensitive(encoderSensEnumStored);
+ encoderButtonsSensitive(encoderSensEnumStored);
+ } else
+ new DialogMessage(Constants.MessageTypes.WARNING, Catalog.GetString("Sorry, file not
found"));
}
void on_button_encoder_export_all_curves_clicked (object o, EventArgs args)
diff --git a/src/util.cs b/src/util.cs
index 84251c5..77c6c1a 100644
--- a/src/util.cs
+++ b/src/util.cs
@@ -946,12 +946,15 @@ public class Util
return fileName;
}
- public static void CopyEncoderDataToTemp(string url, string fileName)
+ public static bool CopyEncoderDataToTemp(string url, string fileName)
{
string origin = url + Path.DirectorySeparatorChar + fileName;
string dest = GetEncoderDataTempFileName();
- if(File.Exists(origin))
+ if(File.Exists(origin)) {
File.Copy(origin, dest, true);
+ return true;
+ }
+ return false;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]