[chronojump] Better message on jumps graph if there's no data



commit 0db900d3c2bdde7073f657411e746dde94ab48f1
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Jun 27 14:55:33 2016 +0200

    Better message on jumps graph if there's no data

 src/gui/eventExecute.cs |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/gui/eventExecute.cs b/src/gui/eventExecute.cs
index 6944a0f..c98460f 100644
--- a/src/gui/eventExecute.cs
+++ b/src/gui/eventExecute.cs
@@ -562,14 +562,18 @@ public partial class ChronoJumpWindow
                if(radio_mode_jumps_small.Active) {
                        string [] str = SqliteJump.SelectTestMaxStuff(currentPerson.UniqueID, 
currentJumpType); 
                                        
-                       string message = string.Format(Catalog.GetString("Best {0} jump of person {1} is 
{2}\nDone at session {3} ({4})"),
+                       if(str[2] == "" || str[2] == "0")
+                               new DialogMessage(Constants.MessageTypes.WARNING, Catalog.GetString("Missing 
data."));
+                       else {
+                               string message = string.Format(Catalog.GetString("Best {0} jump of person {1} 
is {2}\nDone at session {3} ({4})"),
                                                currentJumpType.Name, currentPerson.Name, 
                                                Util.TrimDecimals(Util.ChangeDecimalSeparator(str[2]), 3), 
                                                str[1], str[0]);
-                       if(str[3] == "-1")
-                               message += "\n" + Catalog.GetString("Simulated");
+                               if(str[3] == "-1")
+                                       message += "\n" + Catalog.GetString("Simulated");
 
-                       new DialogMessage(Constants.MessageTypes.INFO, message);
+                               new DialogMessage(Constants.MessageTypes.INFO, message);
+                       }
                }
        }
        


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