[longomatch] Players can be untagged using the 'delete' menu
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [longomatch] Players can be untagged using the 'delete' menu
- Date: Thu, 20 Aug 2009 14:52:23 +0000 (UTC)
commit db9ca68cc3e2971093c50934410c48e6a402281e
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Thu Aug 20 16:52:10 2009 +0200
Players can be untagged using the 'delete' menu
CesarPlayer/CesarPlayer.mdp | 2 +
CesarPlayer/gtk-gui/gui.stetic | 16 ++++++++++
LongoMatch/Gui/MainWindow.cs | 5 ++-
LongoMatch/Gui/PlayersListTreeWidget.cs | 5 ++-
LongoMatch/Gui/PlayersTreeView.cs | 36 +++++++++++++---------
LongoMatch/Time/MediaTimeNode.cs | 8 +++++
LongoMatch/gtk-gui/LongoMatch.Gui.MainWindow.cs | 2 +-
LongoMatch/gtk-gui/gui.stetic | 2 +-
LongoMatch/gtk-gui/objects.xml | 2 +-
9 files changed, 57 insertions(+), 21 deletions(-)
---
diff --git a/CesarPlayer/CesarPlayer.mdp b/CesarPlayer/CesarPlayer.mdp
index b48cdbf..550b4a0 100644
--- a/CesarPlayer/CesarPlayer.mdp
+++ b/CesarPlayer/CesarPlayer.mdp
@@ -75,6 +75,8 @@
<File name="Player/GstMetadataType.cs" subtype="Code" buildaction="Compile" />
<File name="Player/GstVideoProperty.cs" subtype="Code" buildaction="Compile" />
<File name="Utils/PreviewMediaFile.cs" subtype="Code" buildaction="Compile" />
+ <File name="te.cs" subtype="Code" buildaction="Compile" />
+ <File name="gtk-gui/longomatch.te.cs" subtype="Code" buildaction="Compile" />
</Contents>
<References>
<ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
diff --git a/CesarPlayer/gtk-gui/gui.stetic b/CesarPlayer/gtk-gui/gui.stetic
index a4c826e..a1115bb 100644
--- a/CesarPlayer/gtk-gui/gui.stetic
+++ b/CesarPlayer/gtk-gui/gui.stetic
@@ -402,4 +402,20 @@
</widget>
</child>
</widget>
+ <widget class="Gtk.Window" id="longomatch.te" design-size="400 300">
+ <property name="MemberName" />
+ <property name="Title" translatable="yes">te</property>
+ <property name="WindowPosition">CenterOnParent</property>
+ <child>
+ <placeholder />
+ </child>
+ </widget>
+ <widget class="Gtk.Window" id="longomatch.te" design-size="400 300">
+ <property name="MemberName" />
+ <property name="Title" translatable="yes">te</property>
+ <property name="WindowPosition">CenterOnParent</property>
+ <child>
+ <placeholder />
+ </child>
+ </widget>
</stetic-interface>
\ No newline at end of file
diff --git a/LongoMatch/Gui/MainWindow.cs b/LongoMatch/Gui/MainWindow.cs
index a5c46fe..3c7fd0f 100644
--- a/LongoMatch/Gui/MainWindow.cs
+++ b/LongoMatch/Gui/MainWindow.cs
@@ -79,8 +79,9 @@ namespace LongoMatch.Gui
playerbin1.LogoMode = true;
playlistwidget2.SetPlayer(playerbin1);
-
-
+
+ localplayerslisttreewidget.Team = Team.LOCAL;
+ visitorplayerslisttreewidget.Team = Team.VISITOR;
}
#endregion
diff --git a/LongoMatch/Gui/PlayersListTreeWidget.cs b/LongoMatch/Gui/PlayersListTreeWidget.cs
index 3e4f850..492dbe9 100644
--- a/LongoMatch/Gui/PlayersListTreeWidget.cs
+++ b/LongoMatch/Gui/PlayersListTreeWidget.cs
@@ -43,7 +43,10 @@ namespace LongoMatch.Gui.Component
this.Build();
}
-
+ public Team Team{
+ set {playerstreeview.Team = value;}
+ }
+
public void DeleteTimeNode(MediaTimeNode tNode, int player){
if (template != null){
TreeIter iter;
diff --git a/LongoMatch/Gui/PlayersTreeView.cs b/LongoMatch/Gui/PlayersTreeView.cs
index 0126e1d..35db558 100644
--- a/LongoMatch/Gui/PlayersTreeView.cs
+++ b/LongoMatch/Gui/PlayersTreeView.cs
@@ -43,10 +43,13 @@ namespace LongoMatch.Gui.Component
private Gtk.TreeViewColumn nameColumn;
//Using TimeNode as in the tree there are Media and Sections timenodes
private TimeNode selectedTimeNode;
+
+ private Team team;
public PlayersTreeView(){
+ team = Team.LOCAL;
this.RowActivated += new RowActivatedHandler(OnTreeviewRowActivated);
SetMenu();
@@ -80,7 +83,12 @@ namespace LongoMatch.Gui.Component
this.AppendColumn (startTimeColumn);
this.AppendColumn (stopTimeColumn);
- }
+ }
+
+ public Team Team{
+ set {team = value;}
+ get {return team ;}
+ }
private void SetMenu(){
@@ -99,12 +107,7 @@ namespace LongoMatch.Gui.Component
snapshot.Activated += new EventHandler(OnSnapshot);
menu.ShowAll();
}
-
- /*private int GetSectionFromIter (TreeIter iter){
- TreePath path = this.Model.GetPath(iter);
- return int.Parse(path.ToString().Split(':')[0]);
- }*/
-
+
protected override bool OnButtonPressEvent (EventButton evnt)
{
object selectedItem;
@@ -126,19 +129,23 @@ namespace LongoMatch.Gui.Component
}
}
}
- return returnValue;
-
+ return returnValue;
}
- protected void OnDeleted(object obj, EventArgs args){
- //TimeNodeDeleted((MediaTimeNode)selectedTimeNode,int.Parse(path.ToString().Split(':')[0]));
+ protected void OnDeleted(object obj, EventArgs args){
+ (Model as TreeStore).Remove(ref selectedIter);
+
+ if (Team == Team.LOCAL)
+ ((MediaTimeNode) selectedTimeNode).RemoveLocalPlayer(int.Parse(path.ToString().Split(':')[0]));
+ if (Team == Team.VISITOR)
+ ((MediaTimeNode) selectedTimeNode).RemoveVisitorPlayer(int.Parse(path.ToString().Split(':')[0]));
}
protected void OnSnapshot(object obj, EventArgs args){
if (SnapshotSeriesEvent != null)
- SnapshotSeriesEvent((MediaTimeNode)selectedTimeNode);
-
+ SnapshotSeriesEvent((MediaTimeNode)selectedTimeNode);
}
+
private void RenderMiniature (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
{
object item = model.GetValue (iter, 0);
@@ -147,8 +154,7 @@ namespace LongoMatch.Gui.Component
(cell as Gtk.CellRendererPixbuf).Pixbuf = (item as MediaTimeNode).Miniature;
if (item is Player)
- (cell as Gtk.CellRendererPixbuf).Pixbuf= (item as Player).Photo;
-
+ (cell as Gtk.CellRendererPixbuf).Pixbuf= (item as Player).Photo;
}
diff --git a/LongoMatch/Time/MediaTimeNode.cs b/LongoMatch/Time/MediaTimeNode.cs
index be7121d..bfba81a 100644
--- a/LongoMatch/Time/MediaTimeNode.cs
+++ b/LongoMatch/Time/MediaTimeNode.cs
@@ -143,6 +143,14 @@ namespace LongoMatch.TimeNodes
visitorPlayersList.Add(index);
}
+ public void RemoveLocalPlayer(int index){
+ localPlayersList.Remove(index);
+ }
+
+ public void RemoveVisitorPlayer(int index){
+ visitorPlayersList.Remove(index);
+ }
+
#endregion
}
diff --git a/LongoMatch/gtk-gui/LongoMatch.Gui.MainWindow.cs b/LongoMatch/gtk-gui/LongoMatch.Gui.MainWindow.cs
index ace02cb..25387d5 100644
--- a/LongoMatch/gtk-gui/LongoMatch.Gui.MainWindow.cs
+++ b/LongoMatch/gtk-gui/LongoMatch.Gui.MainWindow.cs
@@ -214,7 +214,7 @@ namespace LongoMatch.Gui {
this.notebook1 = new Gtk.Notebook();
this.notebook1.CanFocus = true;
this.notebook1.Name = "notebook1";
- this.notebook1.CurrentPage = 0;
+ this.notebook1.CurrentPage = 2;
this.notebook1.TabPos = ((Gtk.PositionType)(3));
// Container child notebook1.Gtk.Notebook+NotebookChild
this.treewidget1 = new LongoMatch.Gui.Component.TreeWidget();
diff --git a/LongoMatch/gtk-gui/gui.stetic b/LongoMatch/gtk-gui/gui.stetic
index 5d5394f..3f6f44a 100755
--- a/LongoMatch/gtk-gui/gui.stetic
+++ b/LongoMatch/gtk-gui/gui.stetic
@@ -1578,7 +1578,7 @@
<widget class="Gtk.Notebook" id="notebook1">
<property name="MemberName" />
<property name="CanFocus">True</property>
- <property name="CurrentPage">0</property>
+ <property name="CurrentPage">2</property>
<property name="TabPos">Bottom</property>
<child>
<widget class="LongoMatch.Gui.Component.TreeWidget" id="treewidget1">
diff --git a/LongoMatch/gtk-gui/objects.xml b/LongoMatch/gtk-gui/objects.xml
index 49ef68b..bff93d2 100755
--- a/LongoMatch/gtk-gui/objects.xml
+++ b/LongoMatch/gtk-gui/objects.xml
@@ -168,8 +168,8 @@
<signals>
<itemgroup label="PlayersListTreeWidget Signals">
<signal name="TimeNodeSelected" />
- <signal name="SnapshotSeriesEvent" />
<signal name="TimeNodeChanged" />
+ <signal name="SnapshotSeriesEvent" />
</itemgroup>
</signals>
</object>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]