[longomatch] Fix rendering of playlists from the players list
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Fix rendering of playlists from the players list
- Date: Wed, 14 Mar 2012 22:53:46 +0000 (UTC)
commit f5ecf6de65c79362a592bdce417e962626731d96
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Wed Mar 14 23:42:34 2012 +0100
Fix rendering of playlists from the players list
.../Gui/Component/PlayersListTreeWidget.cs | 26 ++++++++++++++++++++
LongoMatch.GUI/Gui/MainWindow.cs | 4 +++
2 files changed, 30 insertions(+), 0 deletions(-)
---
diff --git a/LongoMatch.GUI/Gui/Component/PlayersListTreeWidget.cs b/LongoMatch.GUI/Gui/Component/PlayersListTreeWidget.cs
index ad4e98a..7eee510 100644
--- a/LongoMatch.GUI/Gui/Component/PlayersListTreeWidget.cs
+++ b/LongoMatch.GUI/Gui/Component/PlayersListTreeWidget.cs
@@ -16,6 +16,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
//
+using System;
using System.Collections.Generic;
using Gtk;
using LongoMatch.Common;
@@ -36,6 +37,7 @@ namespace LongoMatch.Gui.Component
public event TimeNodeChangedHandler TimeNodeChanged;
public event PlayListNodeAddedHandler PlayListNodeAdded;
public event SnapshotSeriesHandler SnapshotSeriesEvent;
+ public event RenderPlaylistHandler RenderPlaylistEvent;
public PlayersListTreeWidget()
{
@@ -44,6 +46,13 @@ namespace LongoMatch.Gui.Component
playerstreeview.TimeNodeSelected += OnTimeNodeSelected;
playerstreeview.PlayListNodeAdded += OnPlayListNodeAdded;
playerstreeview.SnapshotSeriesEvent += OnSnapshotSeriesEvent;
+ playerstreeview.NewRenderingJob += OnNewRenderingJob;
+
+ }
+
+ public Project Project {
+ set;
+ get;
}
public Team Team {
@@ -115,6 +124,23 @@ namespace LongoMatch.Gui.Component
if(PlayListNodeAdded != null)
PlayListNodeAdded(tNode);
}
+
+ protected virtual void OnNewRenderingJob (object sender, EventArgs args)
+ {
+ PlayList playlist = new PlayList();
+ TreePath[] paths = playerstreeview.Selection.GetSelectedRows();
+
+ foreach(var path in paths) {
+ TreeIter iter;
+
+ playerstreeview.Model.GetIter(out iter, path);
+ playlist.Add(new PlayListPlay((Play)playerstreeview.Model.GetValue(iter, 0),
+ Project.Description.File, 1, true));
+ }
+
+ if (RenderPlaylistEvent != null)
+ RenderPlaylistEvent(playlist);
+ }
}
}
diff --git a/LongoMatch.GUI/Gui/MainWindow.cs b/LongoMatch.GUI/Gui/MainWindow.cs
index 4090a5c..338c604 100644
--- a/LongoMatch.GUI/Gui/MainWindow.cs
+++ b/LongoMatch.GUI/Gui/MainWindow.cs
@@ -273,6 +273,8 @@ namespace LongoMatch.Gui
playlist.RenderPlaylistEvent += EmitRenderPlaylist;
playsList.RenderPlaylistEvent += EmitRenderPlaylist;
+ localPlayersList.RenderPlaylistEvent += EmitRenderPlaylist;
+ visitorPlayersList.RenderPlaylistEvent += EmitRenderPlaylist;
renderingstatebar1.ManageJobs += (e, o) => {EmitManageJobs();};
@@ -388,6 +390,8 @@ namespace LongoMatch.Gui
tagsList.ProjectIsLive = isLive;
playsList.Project=project;
tagsList.Project = project;
+ visitorPlayersList.Project = project;
+ localPlayersList.Project = project;
UpdateTeamsModels();
buttonswidget.Categories = project.Categories;
MakeActionsSensitive(true,projectType);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]