[longomatch] Show positional tagging in the stats for all teams
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Show positional tagging in the stats for all teams
- Date: Mon, 5 Aug 2013 20:08:02 +0000 (UTC)
commit a322b5f2bcc5f9afbc9fcd4a7a583fb898b357e4
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Mon Aug 5 21:59:36 2013 +0200
Show positional tagging in the stats for all teams
.../Gui/Component/Stats/CategoryViewer.cs | 39 ++++---
LongoMatch.GUI/Gui/MainWindow.cs | 1 +
...ongoMatch.Gui.Component.Stats.CategoryViewer.cs | 92 ++++++++++++++-
.../gtk-gui/LongoMatch.Gui.MainWindow.cs | 1 +
LongoMatch.GUI/gtk-gui/gui.stetic | 116 +++++++++++++++++++-
5 files changed, 222 insertions(+), 27 deletions(-)
---
diff --git a/LongoMatch.GUI/Gui/Component/Stats/CategoryViewer.cs
b/LongoMatch.GUI/Gui/Component/Stats/CategoryViewer.cs
index 6bb1d90..314afe7 100644
--- a/LongoMatch.GUI/Gui/Component/Stats/CategoryViewer.cs
+++ b/LongoMatch.GUI/Gui/Component/Stats/CategoryViewer.cs
@@ -27,27 +27,40 @@ namespace LongoMatch.Gui.Component.Stats
public partial class CategoryViewer : Gtk.Bin
{
List<SubCategoryViewer> subcatViewers;
+
public CategoryViewer ()
{
this.Build ();
+ hometagger.CoordinatesSensitive = false;
+ awaytagger.CoordinatesSensitive = false;
}
public void LoadStats (CategoryStats stats) {
- PlaysCoordinatesTagger tagger;
+ alltagger.LoadBackgrounds (stats.Field, stats.HalfField, stats.Goal);
+ alltagger.LoadFieldCoordinates (stats.FieldCoordinates);
+ alltagger.LoadHalfFieldCoordinates (stats.HalfFieldCoordinates);
+ alltagger.LoadGoalCoordinates (stats.GoalCoordinates);
+ allframe.Visible = stats.FieldCoordinates.Count + stats.HalfFieldCoordinates.Count +
+ stats.GoalCoordinates.Count != 0;
+
+ hometagger.LoadBackgrounds (stats.Field, stats.HalfField, stats.Goal);
+ hometagger.LoadFieldCoordinates (stats.HomeFieldCoordinates);
+ hometagger.LoadHalfFieldCoordinates (stats.HomeHalfFieldCoordinates);
+ hometagger.LoadGoalCoordinates (stats.HomeGoalCoordinates);
+ homeframe.Visible = stats.HomeFieldCoordinates.Count +
stats.HomeHalfFieldCoordinates.Count +
+ stats.HomeGoalCoordinates.Count != 0;
+
+ awaytagger.LoadBackgrounds (stats.Field, stats.HalfField, stats.Goal);
+ awaytagger.LoadFieldCoordinates (stats.AwayFieldCoordinates);
+ awaytagger.LoadHalfFieldCoordinates (stats.AwayHalfFieldCoordinates);
+ awaytagger.LoadGoalCoordinates (stats.AwayGoalCoordinates);
+ awayframe.Visible = stats.AwayFieldCoordinates.Count +
stats.AwayHalfFieldCoordinates.Count +
+ stats.AwayGoalCoordinates.Count != 0;
foreach (Widget child in vbox1.AllChildren) {
- vbox1.Remove (child);
+ if (child is SubCategoryViewer || child is HSeparator)
+ vbox1.Remove (child);
}
-
- tagger = new PlaysCoordinatesTagger();
- tagger.LoadBackgrounds (stats.Field, stats.HalfField, stats.Goal);
- tagger.LoadFieldCoordinates (stats.FieldCoordinates);
- tagger.LoadHalfFieldCoordinates (stats.HalfFieldCoordinates);
- 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();
@@ -57,8 +70,6 @@ namespace LongoMatch.Gui.Component.Stats
vbox1.PackStart (new HSeparator());
subcatviewer.Show ();
}
-
- vbox1.Show ();
}
}
}
diff --git a/LongoMatch.GUI/Gui/MainWindow.cs b/LongoMatch.GUI/Gui/MainWindow.cs
index 873b87c..9733dfc 100644
--- a/LongoMatch.GUI/Gui/MainWindow.cs
+++ b/LongoMatch.GUI/Gui/MainWindow.cs
@@ -471,6 +471,7 @@ namespace LongoMatch.Gui
TaggingViewAction.Sensitive = sensitive;
ManualTaggingViewAction.Sensitive = sensitive;
ExportProjectAction1.Sensitive = sensitive;
+ ShowProjectStatsAction.Sensitive = sensitive;
GameUnitsViewAction.Sensitive = sensitive2 && gameUnitsActionVisible;
TimelineViewAction.Sensitive = sensitive2;
HideAllWidgetsAction.Sensitive=sensitive2;
diff --git a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.Stats.CategoryViewer.cs
b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.Stats.CategoryViewer.cs
index 722f811..cd7bd35 100644
--- a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.Stats.CategoryViewer.cs
+++ b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.Stats.CategoryViewer.cs
@@ -6,7 +6,19 @@ namespace LongoMatch.Gui.Component.Stats
{
private global::Gtk.ScrolledWindow scrolledwindow1;
private global::Gtk.VBox vbox1;
- private global::LongoMatch.Gui.Component.PlaysCoordinatesTagger playscoordinatestagger1;
+ private global::Gtk.HBox hbox1;
+ private global::Gtk.Frame allframe;
+ private global::Gtk.Alignment GtkAlignment2;
+ private global::LongoMatch.Gui.Component.PlaysCoordinatesTagger alltagger;
+ private global::Gtk.Label GtkLabel2;
+ private global::Gtk.Frame homeframe;
+ private global::Gtk.Alignment GtkAlignment;
+ private global::LongoMatch.Gui.Component.PlaysCoordinatesTagger hometagger;
+ private global::Gtk.Label GtkLabel;
+ private global::Gtk.Frame awayframe;
+ private global::Gtk.Alignment GtkAlignment1;
+ private global::LongoMatch.Gui.Component.PlaysCoordinatesTagger awaytagger;
+ private global::Gtk.Label GtkLabel1;
protected virtual void Build ()
{
@@ -27,12 +39,78 @@ namespace LongoMatch.Gui.Component.Stats
this.vbox1.Name = "vbox1";
this.vbox1.Spacing = 6;
// Container child vbox1.Gtk.Box+BoxChild
- this.playscoordinatestagger1 = new
global::LongoMatch.Gui.Component.PlaysCoordinatesTagger ();
- this.playscoordinatestagger1.Events = ((global::Gdk.EventMask)(256));
- this.playscoordinatestagger1.Name = "playscoordinatestagger1";
- this.vbox1.Add (this.playscoordinatestagger1);
- global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox1
[this.playscoordinatestagger1]));
- w2.Position = 1;
+ this.hbox1 = new global::Gtk.HBox ();
+ this.hbox1.Name = "hbox1";
+ this.hbox1.Spacing = 6;
+ // Container child hbox1.Gtk.Box+BoxChild
+ this.allframe = new global::Gtk.Frame ();
+ this.allframe.Name = "allframe";
+ this.allframe.ShadowType = ((global::Gtk.ShadowType)(0));
+ // Container child allframe.Gtk.Container+ContainerChild
+ this.GtkAlignment2 = new global::Gtk.Alignment (0F, 0F, 1F, 1F);
+ this.GtkAlignment2.Name = "GtkAlignment2";
+ this.GtkAlignment2.LeftPadding = ((uint)(12));
+ // Container child GtkAlignment2.Gtk.Container+ContainerChild
+ this.alltagger = new global::LongoMatch.Gui.Component.PlaysCoordinatesTagger ();
+ this.alltagger.Events = ((global::Gdk.EventMask)(256));
+ this.alltagger.Name = "alltagger";
+ this.GtkAlignment2.Add (this.alltagger);
+ this.allframe.Add (this.GtkAlignment2);
+ this.GtkLabel2 = new global::Gtk.Label ();
+ this.GtkLabel2.Name = "GtkLabel2";
+ this.GtkLabel2.LabelProp = global::Mono.Unix.Catalog.GetString ("<b>All</b>");
+ this.GtkLabel2.UseMarkup = true;
+ this.allframe.LabelWidget = this.GtkLabel2;
+ this.hbox1.Add (this.allframe);
+ global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox1
[this.allframe]));
+ w4.Position = 0;
+ // Container child hbox1.Gtk.Box+BoxChild
+ this.homeframe = new global::Gtk.Frame ();
+ this.homeframe.Name = "homeframe";
+ this.homeframe.ShadowType = ((global::Gtk.ShadowType)(0));
+ // Container child homeframe.Gtk.Container+ContainerChild
+ this.GtkAlignment = new global::Gtk.Alignment (0F, 0F, 1F, 1F);
+ this.GtkAlignment.Name = "GtkAlignment";
+ this.GtkAlignment.LeftPadding = ((uint)(12));
+ // Container child GtkAlignment.Gtk.Container+ContainerChild
+ this.hometagger = new global::LongoMatch.Gui.Component.PlaysCoordinatesTagger ();
+ this.hometagger.Events = ((global::Gdk.EventMask)(256));
+ this.hometagger.Name = "hometagger";
+ this.GtkAlignment.Add (this.hometagger);
+ this.homeframe.Add (this.GtkAlignment);
+ this.GtkLabel = new global::Gtk.Label ();
+ this.GtkLabel.Name = "GtkLabel";
+ this.GtkLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("<b>Home</b>");
+ this.GtkLabel.UseMarkup = true;
+ this.homeframe.LabelWidget = this.GtkLabel;
+ this.hbox1.Add (this.homeframe);
+ global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.hbox1
[this.homeframe]));
+ w7.Position = 1;
+ // Container child hbox1.Gtk.Box+BoxChild
+ this.awayframe = new global::Gtk.Frame ();
+ this.awayframe.Name = "awayframe";
+ this.awayframe.ShadowType = ((global::Gtk.ShadowType)(0));
+ // Container child awayframe.Gtk.Container+ContainerChild
+ this.GtkAlignment1 = new global::Gtk.Alignment (0F, 0F, 1F, 1F);
+ this.GtkAlignment1.Name = "GtkAlignment1";
+ this.GtkAlignment1.LeftPadding = ((uint)(12));
+ // Container child GtkAlignment1.Gtk.Container+ContainerChild
+ this.awaytagger = new global::LongoMatch.Gui.Component.PlaysCoordinatesTagger ();
+ this.awaytagger.Events = ((global::Gdk.EventMask)(256));
+ this.awaytagger.Name = "awaytagger";
+ this.GtkAlignment1.Add (this.awaytagger);
+ this.awayframe.Add (this.GtkAlignment1);
+ this.GtkLabel1 = new global::Gtk.Label ();
+ this.GtkLabel1.Name = "GtkLabel1";
+ this.GtkLabel1.LabelProp = global::Mono.Unix.Catalog.GetString ("<b>Away</b>");
+ this.GtkLabel1.UseMarkup = true;
+ this.awayframe.LabelWidget = this.GtkLabel1;
+ this.hbox1.Add (this.awayframe);
+ global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.hbox1
[this.awayframe]));
+ w10.Position = 2;
+ this.vbox1.Add (this.hbox1);
+ global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hbox1]));
+ w11.Position = 0;
w1.Add (this.vbox1);
this.scrolledwindow1.Add (w1);
this.Add (this.scrolledwindow1);
diff --git a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.MainWindow.cs
b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.MainWindow.cs
index 4081975..f0b9178 100644
--- a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.MainWindow.cs
+++ b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.MainWindow.cs
@@ -187,6 +187,7 @@ namespace LongoMatch.Gui
this.PreferencesAction.ShortLabel = global::Mono.Unix.Catalog.GetString
("Preferences");
w1.Add (this.PreferencesAction, null);
this.ShowProjectStatsAction = new global::Gtk.Action ("ShowProjectStatsAction",
global::Mono.Unix.Catalog.GetString ("Show project stats"), null, null);
+ this.ShowProjectStatsAction.Sensitive = false;
this.ShowProjectStatsAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Show
project stats");
w1.Add (this.ShowProjectStatsAction, null);
this.UIManager.InsertActionGroup (w1, 0);
diff --git a/LongoMatch.GUI/gtk-gui/gui.stetic b/LongoMatch.GUI/gtk-gui/gui.stetic
index 4888d1b..458a39c 100644
--- a/LongoMatch.GUI/gtk-gui/gui.stetic
+++ b/LongoMatch.GUI/gtk-gui/gui.stetic
@@ -1834,6 +1834,7 @@
<action id="ShowProjectStatsAction">
<property name="Type">Action</property>
<property name="Label" translatable="yes">Show project stats</property>
+ <property name="Sensitive">False</property>
<property name="ShortLabel" translatable="yes">Show project stats</property>
</action>
</action-group>
@@ -8711,18 +8712,120 @@ Defining <b> Game Units </b> will help you during the analysis to in
<property name="MemberName" />
<property name="Spacing">6</property>
<child>
- <placeholder />
- </child>
- <child>
- <widget class="LongoMatch.Gui.Component.PlaysCoordinatesTagger"
id="playscoordinatestagger1">
+ <widget class="Gtk.HBox" id="hbox1">
<property name="MemberName" />
- <property name="Events">ButtonPressMask</property>
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.Frame" id="allframe">
+ <property name="MemberName" />
+ <property name="ShadowType">None</property>
+ <child>
+ <widget class="Gtk.Alignment" id="GtkAlignment2">
+ <property name="MemberName" />
+ <property name="Xalign">0</property>
+ <property name="Yalign">0</property>
+ <property name="LeftPadding">12</property>
+ <child>
+ <widget class="LongoMatch.Gui.Component.PlaysCoordinatesTagger" id="alltagger">
+ <property name="MemberName" />
+ <property name="Events">ButtonPressMask</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="GtkLabel2">
+ <property name="MemberName" />
+ <property name="LabelProp" translatable="yes"><b>All</b></property>
+ <property name="UseMarkup">True</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Frame" id="homeframe">
+ <property name="MemberName" />
+ <property name="ShadowType">None</property>
+ <child>
+ <widget class="Gtk.Alignment" id="GtkAlignment">
+ <property name="MemberName" />
+ <property name="Xalign">0</property>
+ <property name="Yalign">0</property>
+ <property name="LeftPadding">12</property>
+ <child>
+ <widget class="LongoMatch.Gui.Component.PlaysCoordinatesTagger"
id="hometagger">
+ <property name="MemberName" />
+ <property name="Events">ButtonPressMask</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="GtkLabel">
+ <property name="MemberName" />
+ <property name="LabelProp" translatable="yes"><b>Home</b></property>
+ <property name="UseMarkup">True</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Frame" id="awayframe">
+ <property name="MemberName" />
+ <property name="ShadowType">None</property>
+ <child>
+ <widget class="Gtk.Alignment" id="GtkAlignment1">
+ <property name="MemberName" />
+ <property name="Xalign">0</property>
+ <property name="Yalign">0</property>
+ <property name="LeftPadding">12</property>
+ <child>
+ <widget class="LongoMatch.Gui.Component.PlaysCoordinatesTagger"
id="awaytagger">
+ <property name="MemberName" />
+ <property name="Events">ButtonPressMask</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="GtkLabel1">
+ <property name="MemberName" />
+ <property name="LabelProp" translatable="yes"><b>Away</b></property>
+ <property name="UseMarkup">True</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">2</property>
+ <property name="AutoSize">False</property>
+ </packing>
+ </child>
</widget>
<packing>
- <property name="Position">1</property>
+ <property name="Position">0</property>
<property name="AutoSize">True</property>
</packing>
</child>
+ <child>
+ <placeholder />
+ </child>
</widget>
</child>
</widget>
@@ -8746,6 +8849,7 @@ Defining <b> Game Units </b> will help you during the analysis to in
<property name="MemberName" />
<property name="CanFocus">True</property>
<property name="Label" translatable="yes">Histogram</property>
+ <property name="Active">True</property>
<property name="DrawIndicator">True</property>
<property name="HasLabel">True</property>
<property name="UseUnderline">True</property>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]