[longomatch] Hide correctly fields with no coordinates
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Hide correctly fields with no coordinates
- Date: Mon, 5 Aug 2013 20:07:57 +0000 (UTC)
commit 7b59bb98face3d3362fded55208f1debd78942ec
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Mon Aug 5 15:58:02 2013 +0200
Hide correctly fields with no coordinates
LongoMatch.Core/Stats/ProjectStats.cs | 18 +++++++++---------
.../Gui/Component/PlaysCoordinatesTagger.cs | 2 +-
.../Gui/Component/Stats/CategoryViewer.cs | 7 ++++---
3 files changed, 14 insertions(+), 13 deletions(-)
---
diff --git a/LongoMatch.Core/Stats/ProjectStats.cs b/LongoMatch.Core/Stats/ProjectStats.cs
index 1107be3..087aaae 100644
--- a/LongoMatch.Core/Stats/ProjectStats.cs
+++ b/LongoMatch.Core/Stats/ProjectStats.cs
@@ -118,15 +118,15 @@ namespace LongoMatch.Stats
stats.Field = project.Categories.FieldBackgroundImage;
stats.HalfField = project.Categories.HalfFieldBackgroundImage;
stats.Goal = project.Categories.GoalBackgroundImage;
- stats.FieldCoordinates = plays.Select (p => p.FieldPosition).ToList();
- stats.HalfFieldCoordinates = plays.Select (p => p.HalfFieldPosition).ToList();
- stats.GoalCoordinates = plays.Select (p => p.GoalPosition).ToList();
- stats.HomeFieldCoordinates = homePlays.Select (p => p.FieldPosition).ToList();
- stats.HomeHalfFieldCoordinates = homePlays.Select (p =>
p.HalfFieldPosition).ToList();
- stats.HomeGoalCoordinates = homePlays.Select (p => p.GoalPosition).ToList();
- stats.AwayFieldCoordinates = awayPlays.Select (p => p.FieldPosition).ToList();
- stats.AwayHalfFieldCoordinates = awayPlays.Select (p =>
p.HalfFieldPosition).ToList();
- stats.AwayGoalCoordinates = awayPlays.Select (p => p.GoalPosition).ToList();
+ stats.FieldCoordinates = plays.Select (p => p.FieldPosition).Where(p =>p !=
null).ToList();
+ stats.HalfFieldCoordinates = plays.Select (p => p.HalfFieldPosition).Where(p
=>p != null).ToList();
+ stats.GoalCoordinates = plays.Select (p => p.GoalPosition).Where(p =>p !=
null).ToList();
+ stats.HomeFieldCoordinates = homePlays.Select (p => p.FieldPosition).Where(p
=>p != null).ToList();
+ stats.HomeHalfFieldCoordinates = homePlays.Select (p =>
p.HalfFieldPosition).Where(p =>p != null).ToList();
+ stats.HomeGoalCoordinates = homePlays.Select (p => p.GoalPosition).Where(p
=>p != null).ToList();
+ stats.AwayFieldCoordinates = awayPlays.Select (p => p.FieldPosition).Where(p
=>p != null).ToList();
+ stats.AwayHalfFieldCoordinates = awayPlays.Select (p =>
p.HalfFieldPosition).Where(p =>p != null).ToList();
+ stats.AwayGoalCoordinates = awayPlays.Select (p => p.GoalPosition).Where(p
=>p != null).ToList();
catStats.Add (stats);
foreach (ISubCategory subcat in cat.SubCategories) {
diff --git a/LongoMatch.GUI/Gui/Component/PlaysCoordinatesTagger.cs
b/LongoMatch.GUI/Gui/Component/PlaysCoordinatesTagger.cs
index 602668b..8fd496e 100644
--- a/LongoMatch.GUI/Gui/Component/PlaysCoordinatesTagger.cs
+++ b/LongoMatch.GUI/Gui/Component/PlaysCoordinatesTagger.cs
@@ -67,7 +67,7 @@ namespace LongoMatch.Gui.Component
box.PackStart (hfield, true, true, 0);
box.PackStart (goal, true, true, 0);
mainbox.PackStart (box, true, true, 0);
- ShowAll ();
+ box.Show ();
}
public void LoadPlay (Play play, bool horizontal=true) {
diff --git a/LongoMatch.GUI/Gui/Component/Stats/CategoryViewer.cs
b/LongoMatch.GUI/Gui/Component/Stats/CategoryViewer.cs
index be836d5..6bb1d90 100644
--- a/LongoMatch.GUI/Gui/Component/Stats/CategoryViewer.cs
+++ b/LongoMatch.GUI/Gui/Component/Stats/CategoryViewer.cs
@@ -46,18 +46,19 @@ namespace LongoMatch.Gui.Component.Stats
tagger.LoadGoalCoordinates (stats.GoalCoordinates);
tagger.CoordinatesSensitive = false;
vbox1.PackStart (tagger);
+ tagger.Show ();
+
subcatViewers = new List<SubCategoryViewer>();
-
foreach (SubCategoryStat st in stats.SubcategoriesStats) {
SubCategoryViewer subcatviewer = new SubCategoryViewer();
subcatviewer.LoadStats (st);
subcatViewers.Add (subcatviewer);
vbox1.PackStart (subcatviewer);
vbox1.PackStart (new HSeparator());
+ subcatviewer.Show ();
}
- tagger = new PlaysCoordinatesTagger ();
- vbox1.ShowAll ();
+ vbox1.Show ();
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]