[longomatch] Add a way to edit the team tactics creating the project
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Add a way to edit the team tactics creating the project
- Date: Sat, 22 Nov 2014 10:53:34 +0000 (UTC)
commit 4d78fd8df01a0c1832681151a557f1c07e3190d7
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Fri Nov 14 17:15:01 2014 +0100
Add a way to edit the team tactics creating the project
LongoMatch.GUI/Gui/Panel/NewProjectPanel.cs | 30 ++++
.../LongoMatch.Gui.Panel.NewProjectPanel.cs | 156 ++++++++++++++++++--
LongoMatch.GUI/gtk-gui/gui.stetic | 149 ++++++++++++++++---
LongoMatch.Plugins.Stats/gtk-gui/objects.xml | 6 +-
4 files changed, 308 insertions(+), 33 deletions(-)
---
diff --git a/LongoMatch.GUI/Gui/Panel/NewProjectPanel.cs b/LongoMatch.GUI/Gui/Panel/NewProjectPanel.cs
index 4d8d722..4912954 100644
--- a/LongoMatch.GUI/Gui/Panel/NewProjectPanel.cs
+++ b/LongoMatch.GUI/Gui/Panel/NewProjectPanel.cs
@@ -95,6 +95,8 @@ namespace LongoMatch.Gui.Panel
urilabel.ModifyFg (StateType.Normal, red);
Color.Parse ("red", ref red);
ApplyStyle ();
+ hometacticsbutton.Clicked += HandleTacticsChanged;
+ awaytacticsbutton.Clicked += HandleTacticsChanged;
}
protected override void OnDestroyed ()
@@ -120,6 +122,9 @@ namespace LongoMatch.Gui.Panel
vsimage.WidthRequest = StyleConf.NewTeamsSpacing;
hometeamscombobox.WidthRequest = awayteamscombobox.WidthRequest =
StyleConf.NewTeamsComboWidth;
hometeamscombobox.HeightRequest = awayteamscombobox.HeightRequest =
StyleConf.NewTeamsComboHeight;
+ homealignment.Xscale = awayalignment.Xscale = 0;
+ homealignment.Xalign = 0.8f;
+ awayalignment.Xalign = 0.2f;
}
void LoadIcons ()
@@ -251,8 +256,10 @@ namespace LongoMatch.Gui.Panel
{
if (team == Team.LOCAL) {
hometemplate = Cloner.Clone (template);
+ hometacticsentry.Text = hometemplate.FormationStr;
} else {
awaytemplate = Cloner.Clone (template);
+ awaytacticsentry.Text = awaytemplate.FormationStr;
}
teamtagger.LoadTeams (hometemplate, awaytemplate,
analysisTemplate.FieldBackground);
@@ -484,6 +491,29 @@ namespace LongoMatch.Gui.Panel
teamtagger.Substitute (p1, p2, team);
}
+ void HandleTacticsChanged (object sender, EventArgs e)
+ {
+ TeamTemplate team;
+ Entry entry;
+
+ if (sender == hometacticsbutton) {
+ team = hometemplate;
+ entry = hometacticsentry;
+ } else {
+ team = awaytemplate;
+ entry = awaytacticsentry;
+ }
+
+ try {
+ team.FormationStr = entry.Text;
+ teamtagger.Reload ();
+ } catch {
+ Config.GUIToolkit.ErrorMessage (
+ Catalog.GetString ("Could not parse tactics string"));
+ }
+ entry.Text = team.FormationStr;
+ }
+
}
}
diff --git a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Panel.NewProjectPanel.cs
b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Panel.NewProjectPanel.cs
index 6cb850b..7b5d9cb 100644
--- a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Panel.NewProjectPanel.cs
+++ b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Panel.NewProjectPanel.cs
@@ -69,6 +69,17 @@ namespace LongoMatch.Gui.Panel
private global::Gtk.Label analysislabel;
private global::Gtk.ComboBox tagscombobox;
private global::Gtk.VBox vbox6;
+ private global::Gtk.HBox hbox14;
+ private global::Gtk.Alignment homealignment;
+ private global::Gtk.HBox hbox16;
+ private global::Gtk.Label label8;
+ private global::Gtk.Entry hometacticsentry;
+ private global::Gtk.Button hometacticsbutton;
+ private global::Gtk.Alignment awayalignment;
+ private global::Gtk.HBox hbox17;
+ private global::Gtk.Label label9;
+ private global::Gtk.Entry awaytacticsentry;
+ private global::Gtk.Button awaytacticsbutton;
private global::Gtk.DrawingArea drawingarea;
private global::Gtk.Label label3;
private global::LongoMatch.Gui.Component.ProjectPeriods projectperiods1;
@@ -568,7 +579,7 @@ namespace LongoMatch.Gui.Panel
w55.Position = 1;
w55.Fill = false;
// Container child topbox.Gtk.Box+BoxChild
- this.righttable = new global::Gtk.Table (((uint)(3)), ((uint)(2)), true);
+ this.righttable = new global::Gtk.Table (((uint)(1)), ((uint)(2)), true);
this.righttable.Name = "righttable";
this.righttable.RowSpacing = ((uint)(6));
this.righttable.ColumnSpacing = ((uint)(6));
@@ -579,7 +590,7 @@ namespace LongoMatch.Gui.Panel
this.righttable.Add (this.analysislabel);
global::Gtk.Table.TableChild w56 = ((global::Gtk.Table.TableChild)(this.righttable
[this.analysislabel]));
w56.XOptions = ((global::Gtk.AttachOptions)(4));
- w56.YOptions = ((global::Gtk.AttachOptions)(4));
+ w56.YOptions = ((global::Gtk.AttachOptions)(0));
// Container child righttable.Gtk.Table+TableChild
this.tagscombobox = global::Gtk.ComboBox.NewText ();
this.tagscombobox.Name = "tagscombobox";
@@ -604,19 +615,136 @@ namespace LongoMatch.Gui.Panel
this.vbox6.Name = "vbox6";
this.vbox6.Spacing = 6;
// Container child vbox6.Gtk.Box+BoxChild
+ this.hbox14 = new global::Gtk.HBox ();
+ this.hbox14.Name = "hbox14";
+ this.hbox14.Spacing = 6;
+ // Container child hbox14.Gtk.Box+BoxChild
+ this.homealignment = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 1F);
+ this.homealignment.Name = "homealignment";
+ // Container child homealignment.Gtk.Container+ContainerChild
+ this.hbox16 = new global::Gtk.HBox ();
+ this.hbox16.Name = "hbox16";
+ this.hbox16.Spacing = 6;
+ // Container child hbox16.Gtk.Box+BoxChild
+ this.label8 = new global::Gtk.Label ();
+ this.label8.Name = "label8";
+ this.label8.LabelProp = global::Mono.Unix.Catalog.GetString ("Tactics");
+ this.hbox16.Add (this.label8);
+ global::Gtk.Box.BoxChild w61 = ((global::Gtk.Box.BoxChild)(this.hbox16
[this.label8]));
+ w61.Position = 0;
+ w61.Expand = false;
+ w61.Fill = false;
+ // Container child hbox16.Gtk.Box+BoxChild
+ this.hometacticsentry = new global::Gtk.Entry ();
+ this.hometacticsentry.CanFocus = true;
+ this.hometacticsentry.Name = "hometacticsentry";
+ this.hometacticsentry.IsEditable = true;
+ this.hometacticsentry.InvisibleChar = '•';
+ this.hbox16.Add (this.hometacticsentry);
+ global::Gtk.Box.BoxChild w62 = ((global::Gtk.Box.BoxChild)(this.hbox16
[this.hometacticsentry]));
+ w62.Position = 1;
+ w62.Expand = false;
+ // Container child hbox16.Gtk.Box+BoxChild
+ this.hometacticsbutton = new global::Gtk.Button ();
+ this.hometacticsbutton.CanFocus = true;
+ this.hometacticsbutton.Name = "hometacticsbutton";
+ this.hometacticsbutton.UseUnderline = true;
+ // Container child hometacticsbutton.Gtk.Container+ContainerChild
+ global::Gtk.Alignment w63 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
+ // Container child GtkAlignment.Gtk.Container+ContainerChild
+ global::Gtk.HBox w64 = new global::Gtk.HBox ();
+ w64.Spacing = 2;
+ // Container child GtkHBox.Gtk.Container+ContainerChild
+ global::Gtk.Image w65 = new global::Gtk.Image ();
+ w65.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-apply",
global::Gtk.IconSize.Menu);
+ w64.Add (w65);
+ // Container child GtkHBox.Gtk.Container+ContainerChild
+ global::Gtk.Label w67 = new global::Gtk.Label ();
+ w64.Add (w67);
+ w63.Add (w64);
+ this.hometacticsbutton.Add (w63);
+ this.hbox16.Add (this.hometacticsbutton);
+ global::Gtk.Box.BoxChild w71 = ((global::Gtk.Box.BoxChild)(this.hbox16
[this.hometacticsbutton]));
+ w71.Position = 2;
+ w71.Expand = false;
+ w71.Fill = false;
+ this.homealignment.Add (this.hbox16);
+ this.hbox14.Add (this.homealignment);
+ global::Gtk.Box.BoxChild w73 = ((global::Gtk.Box.BoxChild)(this.hbox14
[this.homealignment]));
+ w73.Position = 0;
+ // Container child hbox14.Gtk.Box+BoxChild
+ this.awayalignment = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 1F);
+ this.awayalignment.Name = "awayalignment";
+ // Container child awayalignment.Gtk.Container+ContainerChild
+ this.hbox17 = new global::Gtk.HBox ();
+ this.hbox17.Name = "hbox17";
+ this.hbox17.Spacing = 6;
+ // Container child hbox17.Gtk.Box+BoxChild
+ this.label9 = new global::Gtk.Label ();
+ this.label9.Name = "label9";
+ this.label9.LabelProp = global::Mono.Unix.Catalog.GetString ("Tactics");
+ this.hbox17.Add (this.label9);
+ global::Gtk.Box.BoxChild w74 = ((global::Gtk.Box.BoxChild)(this.hbox17
[this.label9]));
+ w74.Position = 0;
+ w74.Expand = false;
+ w74.Fill = false;
+ // Container child hbox17.Gtk.Box+BoxChild
+ this.awaytacticsentry = new global::Gtk.Entry ();
+ this.awaytacticsentry.CanFocus = true;
+ this.awaytacticsentry.Name = "awaytacticsentry";
+ this.awaytacticsentry.IsEditable = true;
+ this.awaytacticsentry.InvisibleChar = '•';
+ this.hbox17.Add (this.awaytacticsentry);
+ global::Gtk.Box.BoxChild w75 = ((global::Gtk.Box.BoxChild)(this.hbox17
[this.awaytacticsentry]));
+ w75.Position = 1;
+ w75.Expand = false;
+ // Container child hbox17.Gtk.Box+BoxChild
+ this.awaytacticsbutton = new global::Gtk.Button ();
+ this.awaytacticsbutton.CanFocus = true;
+ this.awaytacticsbutton.Name = "awaytacticsbutton";
+ this.awaytacticsbutton.UseUnderline = true;
+ // Container child awaytacticsbutton.Gtk.Container+ContainerChild
+ global::Gtk.Alignment w76 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
+ // Container child GtkAlignment.Gtk.Container+ContainerChild
+ global::Gtk.HBox w77 = new global::Gtk.HBox ();
+ w77.Spacing = 2;
+ // Container child GtkHBox.Gtk.Container+ContainerChild
+ global::Gtk.Image w78 = new global::Gtk.Image ();
+ w78.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-apply",
global::Gtk.IconSize.Menu);
+ w77.Add (w78);
+ // Container child GtkHBox.Gtk.Container+ContainerChild
+ global::Gtk.Label w80 = new global::Gtk.Label ();
+ w77.Add (w80);
+ w76.Add (w77);
+ this.awaytacticsbutton.Add (w76);
+ this.hbox17.Add (this.awaytacticsbutton);
+ global::Gtk.Box.BoxChild w84 = ((global::Gtk.Box.BoxChild)(this.hbox17
[this.awaytacticsbutton]));
+ w84.Position = 2;
+ w84.Expand = false;
+ w84.Fill = false;
+ this.awayalignment.Add (this.hbox17);
+ this.hbox14.Add (this.awayalignment);
+ global::Gtk.Box.BoxChild w86 = ((global::Gtk.Box.BoxChild)(this.hbox14
[this.awayalignment]));
+ w86.Position = 1;
+ this.vbox6.Add (this.hbox14);
+ global::Gtk.Box.BoxChild w87 = ((global::Gtk.Box.BoxChild)(this.vbox6 [this.hbox14]));
+ w87.Position = 0;
+ w87.Expand = false;
+ w87.Fill = false;
+ // Container child vbox6.Gtk.Box+BoxChild
this.drawingarea = new global::Gtk.DrawingArea ();
this.drawingarea.Name = "drawingarea";
this.vbox6.Add (this.drawingarea);
- global::Gtk.Box.BoxChild w61 = ((global::Gtk.Box.BoxChild)(this.vbox6
[this.drawingarea]));
- w61.Position = 0;
+ global::Gtk.Box.BoxChild w88 = ((global::Gtk.Box.BoxChild)(this.vbox6
[this.drawingarea]));
+ w88.Position = 1;
this.vbox5.Add (this.vbox6);
- global::Gtk.Box.BoxChild w62 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.vbox6]));
- w62.Position = 1;
+ global::Gtk.Box.BoxChild w89 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.vbox6]));
+ w89.Position = 1;
this.notebook1.Add (this.vbox5);
- global::Gtk.Notebook.NotebookChild w63 =
((global::Gtk.Notebook.NotebookChild)(this.notebook1 [this.vbox5]));
- w63.Position = 1;
- w63.TabFill = false;
- w63.MenuLabel = "";
+ global::Gtk.Notebook.NotebookChild w90 =
((global::Gtk.Notebook.NotebookChild)(this.notebook1 [this.vbox5]));
+ w90.Position = 1;
+ w90.TabFill = false;
+ w90.MenuLabel = "";
// Notebook tab
this.label3 = new global::Gtk.Label ();
this.label3.Name = "label3";
@@ -628,8 +756,8 @@ namespace LongoMatch.Gui.Panel
this.projectperiods1.Events = ((global::Gdk.EventMask)(256));
this.projectperiods1.Name = "projectperiods1";
this.notebook1.Add (this.projectperiods1);
- global::Gtk.Notebook.NotebookChild w64 =
((global::Gtk.Notebook.NotebookChild)(this.notebook1 [this.projectperiods1]));
- w64.Position = 2;
+ global::Gtk.Notebook.NotebookChild w91 =
((global::Gtk.Notebook.NotebookChild)(this.notebook1 [this.projectperiods1]));
+ w91.Position = 2;
// Notebook tab
this.label7 = new global::Gtk.Label ();
this.label7.Name = "label7";
@@ -637,8 +765,8 @@ namespace LongoMatch.Gui.Panel
this.notebook1.SetTabLabel (this.projectperiods1, this.label7);
this.label7.ShowAll ();
this.vbox3.Add (this.notebook1);
- global::Gtk.Box.BoxChild w65 = ((global::Gtk.Box.BoxChild)(this.vbox3
[this.notebook1]));
- w65.Position = 1;
+ global::Gtk.Box.BoxChild w92 = ((global::Gtk.Box.BoxChild)(this.vbox3
[this.notebook1]));
+ w92.Position = 1;
this.Add (this.vbox3);
if ((this.Child != null)) {
this.Child.ShowAll ();
diff --git a/LongoMatch.GUI/gtk-gui/gui.stetic b/LongoMatch.GUI/gtk-gui/gui.stetic
index 7f0a07e..f7ebd5b 100644
--- a/LongoMatch.GUI/gtk-gui/gui.stetic
+++ b/LongoMatch.GUI/gtk-gui/gui.stetic
@@ -5875,7 +5875,7 @@ You can continue with the current capture, cancel it or save your project.
</widget>
</child>
</widget>
- <widget class="Gtk.Bin" id="LongoMatch.Gui.Panel.NewProjectPanel" design-size="1206 584">
+ <widget class="Gtk.Bin" id="LongoMatch.Gui.Panel.NewProjectPanel" design-size="1129 750">
<property name="MemberName" />
<property name="Visible">False</property>
<child>
@@ -6644,37 +6644,24 @@ You can continue with the current capture, cancel it or save your project.
<child>
<widget class="Gtk.Table" id="righttable">
<property name="MemberName" />
- <property name="NRows">3</property>
<property name="NColumns">2</property>
<property name="Homogeneous">True</property>
<property name="RowSpacing">6</property>
<property name="ColumnSpacing">6</property>
<child>
- <placeholder />
- </child>
- <child>
- <placeholder />
- </child>
- <child>
- <placeholder />
- </child>
- <child>
- <placeholder />
- </child>
- <child>
<widget class="Gtk.Label" id="analysislabel">
<property name="MemberName" />
<property name="LabelProp" translatable="yes">Analysis Template:</property>
</widget>
<packing>
- <property name="AutoSize">True</property>
+ <property name="AutoSize">False</property>
<property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
+ <property name="YOptions">0</property>
<property name="XExpand">False</property>
<property name="XFill">True</property>
<property name="XShrink">False</property>
<property name="YExpand">False</property>
- <property name="YFill">True</property>
+ <property name="YFill">False</property>
<property name="YShrink">False</property>
</packing>
</child>
@@ -6720,12 +6707,138 @@ You can continue with the current capture, cancel it or save your project.
<property name="MemberName" />
<property name="Spacing">6</property>
<child>
- <widget class="Gtk.DrawingArea" id="drawingarea">
+ <widget class="Gtk.HBox" id="hbox14">
<property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.Alignment" id="homealignment">
+ <property name="MemberName" />
+ <property name="Xscale">0</property>
+ <child>
+ <widget class="Gtk.HBox" id="hbox16">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.Label" id="label8">
+ <property name="MemberName" />
+ <property name="LabelProp" translatable="yes">Tactics</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Entry" id="hometacticsentry">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="IsEditable">True</property>
+ <property name="InvisibleChar">•</property>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">False</property>
+ <property name="Expand">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Button" id="hometacticsbutton">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="Type">TextAndIcon</property>
+ <property name="Icon">stock:gtk-apply Menu</property>
+ <property name="Label" translatable="yes" />
+ <property name="UseUnderline">True</property>
+ </widget>
+ <packing>
+ <property name="Position">2</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Alignment" id="awayalignment">
+ <property name="MemberName" />
+ <property name="Xscale">0</property>
+ <child>
+ <widget class="Gtk.HBox" id="hbox17">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.Label" id="label9">
+ <property name="MemberName" />
+ <property name="LabelProp" translatable="yes">Tactics</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Entry" id="awaytacticsentry">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="IsEditable">True</property>
+ <property name="InvisibleChar">•</property>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">False</property>
+ <property name="Expand">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Button" id="awaytacticsbutton">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="Type">TextAndIcon</property>
+ <property name="Icon">stock:gtk-apply Menu</property>
+ <property name="Label" translatable="yes" />
+ <property name="UseUnderline">True</property>
+ </widget>
+ <packing>
+ <property name="Position">2</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">False</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="Position">0</property>
<property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.DrawingArea" id="drawingarea">
+ <property name="MemberName" />
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
</packing>
</child>
</widget>
diff --git a/LongoMatch.Plugins.Stats/gtk-gui/objects.xml b/LongoMatch.Plugins.Stats/gtk-gui/objects.xml
index 092554b..a276599 100644
--- a/LongoMatch.Plugins.Stats/gtk-gui/objects.xml
+++ b/LongoMatch.Plugins.Stats/gtk-gui/objects.xml
@@ -322,7 +322,11 @@
<itemgroups />
<signals />
</object>
- <object type="LongoMatch.Plugins.Stats.StatsViewer" palette-category="General" allow-children="false"
base-type="Gtk.Bin">
+ <object type="LongoMatch.Gui.Component.GameDescriptionHeader" palette-category="General"
allow-children="false" base-type="Gtk.Bin">
+ <itemgroups />
+ <signals />
+ </object>
+ <object type="LongoMatch.Gui.Component.VideoFileInfo" palette-category="General" allow-children="false"
base-type="Gtk.Bin">
<itemgroups />
<signals />
</object>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]