[chronojump/optimizeRFD] Races with 2 tracks: do not allow to show sprint calculations
- From: Xavier Padullés <xpadulles src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump/optimizeRFD] Races with 2 tracks: do not allow to show sprint calculations
- Date: Sun, 3 Jan 2021 17:07:58 +0000 (UTC)
commit bef26940dad6a8b9077b2b748e99fac2318da6df
Author: Xavier de Blas <xaviblas gmail com>
Date: Thu Dec 31 13:56:01 2020 +0100
Races with 2 tracks: do not allow to show sprint calculations
src/gui/sprint.cs | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
---
diff --git a/src/gui/sprint.cs b/src/gui/sprint.cs
index 70e89ca84..1d029024c 100644
--- a/src/gui/sprint.cs
+++ b/src/gui/sprint.cs
@@ -190,7 +190,16 @@ public partial class ChronoJumpWindow
// you get the iter and the model if something is selected
if (((TreeSelection)o).GetSelected(out model, out iter))
- button_sprint.Sensitive = true;
+ {
+ //only allow sprint calculation when there are three tracks
+ string splitTimes = (string) model.GetValue(iter, 3);
+ if(splitTimes.Split(new char[] {';'}).Length >= 3)
+ button_sprint.Sensitive = true;
+ else
+ button_sprint.Sensitive = false;
+ }
+ else
+ button_sprint.Sensitive = false;
}
public static bool GetSelectedSprint (Gtk.TreeView tv)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]