[longomatch] Fix edition of sections and players
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Fix edition of sections and players
- Date: Wed, 29 Sep 2010 20:46:01 +0000 (UTC)
commit 639c5472084e30d5344304570968e0d27f111c01
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Tue Sep 21 16:59:14 2010 +0200
Fix edition of sections and players
The description of a section and a player now contains the count of
plays. It needs to be treated like plays, where the cell's text is replaced
with the real value.
LongoMatch/Gui/TreeView/ListTreeViewBase.cs | 38 +++++++++++++++------------
1 files changed, 21 insertions(+), 17 deletions(-)
---
diff --git a/LongoMatch/Gui/TreeView/ListTreeViewBase.cs b/LongoMatch/Gui/TreeView/ListTreeViewBase.cs
index 58c86a8..b737503 100644
--- a/LongoMatch/Gui/TreeView/ListTreeViewBase.cs
+++ b/LongoMatch/Gui/TreeView/ListTreeViewBase.cs
@@ -248,24 +248,28 @@ namespace LongoMatch.Gui.Component
object o = model.GetValue(iter, 0);
var c = cell as CellRendererText;
+ /* Handle special case in which we replace the text in the cell by the name of the TimeNode
+ * We need to check if we are editing and only change it for the path that's currently beeing edited */
+ if (editing && Selection.IterIsSelected(iter)){
+ if (o is Player)
+ c.Markup = (o as Player).Name;
+ else
+ c.Markup = (o as TimeNode).Name;
+ return;
+ }
+
if (o is MediaTimeNode){
- //Handle special case in which we replace the text in the cell by the name of the TimeNode
- //We need to check if we are editing and only change it for the path that's currently beeing edited
- if (editing && Selection.IterIsSelected(iter)){
- c.Markup = (o as MediaTimeNode).Name;
- } else {
- var mtn = o as MediaTimeNode;
- /* FIXME: the colors array is set externally and might not match the model!!! */
- if (colors !=null) {
- Color col = colors[GetSectionFromIter(iter)];
- c.CellBackgroundGdk = col;
- c.BackgroundGdk = col;
- } else{
- c.Background = "white";
- c.CellBackground = "white";
- }
- c.Markup = mtn.ToString(teams_name[(int)mtn.Team]);
- }
+ var mtn = o as MediaTimeNode;
+ /* FIXME: the colors array is set externally and might not match the model!!! */
+ if (colors !=null) {
+ Color col = colors[GetSectionFromIter(iter)];
+ c.CellBackgroundGdk = col;
+ c.BackgroundGdk = col;
+ } else{
+ c.Background = "white";
+ c.CellBackground = "white";
+ }
+ c.Markup = mtn.ToString(teams_name[(int)mtn.Team]);
}else if (o is Player) {
c.Background = "white";
c.CellBackground = "white";
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]