[chronojump] Simulated tests only on SIMULATED session



commit 50e08f92c2a42767ead6d9136734b30d85255365
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Jul 21 17:47:42 2016 +0200

    Simulated tests only on SIMULATED session

 src/constants.cs      |    4 +++-
 src/gui/chronojump.cs |    7 ++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/src/constants.cs b/src/constants.cs
index a8760ad..49f9edd 100644
--- a/src/constants.cs
+++ b/src/constants.cs
@@ -165,9 +165,11 @@ public class Constants
        public const string Height = "height";
        public const string Weight = "weight";
        
-       //session
+       //simulated tests and SIMULATED session
        public const string SessionSimulatedName = "SIMULATED"; //Do NOT translate this 
        public static string SessionProtected = Catalog.GetString("Sorry, this session cannot be modified."); 
//SIMULATED session
+       public static string SimulatedTestsNotAllowed = Catalog.GetString("Chronopic is disconnected.") + 
"\n\n" + 
+               string.Format(Catalog.GetString("If you want to simulate tests, use {0} session."), 
"SIMULATED");
 
        //server
        public const string ServerPingTable = "SPing"; 
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index a4a1f81..6cb19ba 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -3902,7 +3902,12 @@ public partial class ChronoJumpWindow
        
        void on_button_execute_test_accepted (object o, EventArgs args) 
        {
-
+               //simulated tests are only allowed on SIMULATED session
+               if(currentSession.Name != Constants.SessionSimulatedName && ! chronopicWin.Connected) {
+                       new DialogMessage(Constants.MessageTypes.WARNING, Constants.SimulatedTestsNotAllowed);
+                       return;
+               }
+               
                if(radio_mode_jumps_small.Active) 
                {
                        LogB.Debug("radio_mode_jumps_small");


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