[longomatch] Use the real team's names in the UI instead of 'local' and 'visitor'
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Use the real team's names in the UI instead of 'local' and 'visitor'
- Date: Tue, 7 Sep 2010 20:22:39 +0000 (UTC)
commit 5d68aad13359d3ccebbcb354ef4813dac9533f80
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Fri Sep 3 19:24:14 2010 +0200
Use the real team's names in the UI instead of 'local' and 'visitor'
LongoMatch/Gui/Component/PlaysListTreeWidget.cs | 4 +-
LongoMatch/Gui/MainWindow.cs | 13 ++++-
LongoMatch/Gui/TreeView/PlaysTreeView.cs | 54 +++++++++++++++---
LongoMatch/gtk-gui/LongoMatch.Gui.MainWindow.cs | 50 ++++++++--------
LongoMatch/gtk-gui/gui.stetic | 10 ++--
LongoMatch/gtk-gui/objects.xml | 68 ++++++++++++++++++++++-
6 files changed, 154 insertions(+), 45 deletions(-)
---
diff --git a/LongoMatch/Gui/Component/PlaysListTreeWidget.cs b/LongoMatch/Gui/Component/PlaysListTreeWidget.cs
index eebdd68..4f7beea 100644
--- a/LongoMatch/Gui/Component/PlaysListTreeWidget.cs
+++ b/LongoMatch/Gui/Component/PlaysListTreeWidget.cs
@@ -1,4 +1,4 @@
-// TreeWidget.cs
+// TreeWidget.cs
//
// Copyright(C) 20072009 Andoni Morales Alastruey
//
@@ -105,6 +105,8 @@ namespace LongoMatch.Gui.Component
if (project != null) {
treeview.Model = project.GetModel();
treeview.Colors = project.Sections.GetColors();
+ treeview.VisitorTeam = project.VisitorName;
+ treeview.LocalTeam = project.LocalName;
}
else {
treeview.Model = null;
diff --git a/LongoMatch/Gui/MainWindow.cs b/LongoMatch/Gui/MainWindow.cs
index 31a7e4b..dabc280 100644
--- a/LongoMatch/Gui/MainWindow.cs
+++ b/LongoMatch/Gui/MainWindow.cs
@@ -121,7 +121,18 @@ namespace LongoMatch.Gui
this.projectType = projectType;
eManager.OpenedProject = project;
eManager.OpenedProjectType = projectType;
-
+
+ /* Update tabs labels */
+ /* FIXME 1.0: Teams should have default names */
+ if (project.VisitorName == "")
+ visitorteamlabel.Text = Catalog.GetString("Visitor Team");
+ else
+ visitorteamlabel.Text = project.VisitorName;
+ if (project.LocalName == "")
+ localteamlabel.Text = Catalog.GetString("Local Team");
+ else
+ localteamlabel.Text = project.LocalName;
+
if (projectType == ProjectType.FileProject) {
// Check if the file associated to the project exists
if (!File.Exists (project.File.FilePath)) {
diff --git a/LongoMatch/Gui/TreeView/PlaysTreeView.cs b/LongoMatch/Gui/TreeView/PlaysTreeView.cs
index 9a2e467..f972232 100644
--- a/LongoMatch/Gui/TreeView/PlaysTreeView.cs
+++ b/LongoMatch/Gui/TreeView/PlaysTreeView.cs
@@ -45,7 +45,7 @@ namespace LongoMatch.Gui.Component
public event TagPlayHandler TagPlay;
// Plays menu
- private Menu menu;
+ private Menu menu, teamMenu;
private MenuItem local;
private MenuItem visitor;
private MenuItem noTeam;
@@ -55,6 +55,8 @@ namespace LongoMatch.Gui.Component
private MenuItem snapshot;
private MenuItem name;
private MenuItem players;
+ private MenuItem localPlayers;
+ private MenuItem visitorPlayers;
//Categories menu
private Menu categoriesMenu;
@@ -63,21 +65,28 @@ namespace LongoMatch.Gui.Component
private Gtk.CellRendererText nameCell;
private Gtk.TreeViewColumn nameColumn;
private Color[] colors;
+ private String[] teams_name;
private bool editing;
private bool projectIsLive;
+ private const string LOCAL_TEAM = "Local Team";
+ private const string VISITOR_TEAM = "Visitor Team";
public PlaysTreeView() {
Selection.Mode = SelectionMode.Multiple;
Selection.SelectFunction = SelectFunction;
this.RowActivated += new RowActivatedHandler(OnTreeviewRowActivated);
-
+
SetMenu();
SetCategoriesMenu();
ProjectIsLive = false;
PlayListLoaded = false;
colors = new Color[20];
+ teams_name = new String[3];
+ teams_name[(int)Team.NONE] = Catalog.GetString(Catalog.GetString("None"));
+ teams_name[(int)Team.LOCAL] = Catalog.GetString(Catalog.GetString(LOCAL_TEAM));
+ teams_name[(int)Team.VISITOR] = Catalog.GetString(Catalog.GetString(VISITOR_TEAM));
nameColumn = new Gtk.TreeViewColumn();
nameColumn.Title = "Name";
@@ -121,29 +130,53 @@ namespace LongoMatch.Gui.Component
this.colors = value;
}
}
+
+ public String LocalTeam {
+ set{
+ Label l1 = (local.Children[0] as Label);
+ Label l2 = (localPlayers.Children[0] as Label);
+ if (value == "")
+ l1.Text = l2.Text = Catalog.GetString(LOCAL_TEAM);
+ else {
+ l1.Text = l2.Text = value;
+ }
+ teams_name[(int)Team.LOCAL] = l1.Text;
+ }
+ }
+
+ public string VisitorTeam {
+ set{
+ Label l1 = (visitor.Children[0] as Label);
+ Label l2 = (visitorPlayers.Children[0] as Label);
+ if (value == "")
+ l1.Text = l2.Text = Catalog.GetString(VISITOR_TEAM);
+ else
+ l1.Text = l2.Text = value;
+ teams_name[(int)Team.VISITOR] = l1.Text;
+ }
+ }
public bool PlayListLoaded {
set {
addPLN.Sensitive = value;
}
}
-
+
private void SetMenu() {
- Menu teamMenu, playersMenu;
- MenuItem localPlayers, visitorPlayers;
+ Menu playersMenu;
MenuItem team, quit;
teamMenu = new Menu();
- local = new MenuItem(Catalog.GetString("Local Team"));
- visitor = new MenuItem(Catalog.GetString("Visitor Team"));
+ local = new MenuItem(Catalog.GetString(LOCAL_TEAM));
+ visitor = new MenuItem(Catalog.GetString(VISITOR_TEAM));
noTeam = new MenuItem(Catalog.GetString("No Team"));
teamMenu .Append(local);
teamMenu .Append(visitor);
teamMenu .Append(noTeam);
playersMenu = new Menu();
- localPlayers = new MenuItem(Catalog.GetString("Local team"));
- visitorPlayers = new MenuItem(Catalog.GetString("Visitor team"));
+ localPlayers = new MenuItem(Catalog.GetString(LOCAL_TEAM));
+ visitorPlayers = new MenuItem(Catalog.GetString(VISITOR_TEAM));
playersMenu.Append(localPlayers);
playersMenu.Append(visitorPlayers);
@@ -353,9 +386,10 @@ namespace LongoMatch.Gui.Component
if (editing && Selection.IterIsSelected(iter))
(cell as Gtk.CellRendererText).Markup = tNode.Name;
else if (tNode is MediaTimeNode) {
+ MediaTimeNode mTNode = (MediaTimeNode) tNode;
(cell as Gtk.CellRendererText).BackgroundGdk = colors[GetSectionFromIter(iter)];
(cell as Gtk.CellRendererText).CellBackgroundGdk = colors[GetSectionFromIter(iter)];
- (cell as Gtk.CellRendererText).Markup = (tNode as MediaTimeNode).ToString();
+ (cell as Gtk.CellRendererText).Markup = mTNode.ToString(teams_name[(int)mTNode.Team]);
}
else {
(cell as Gtk.CellRendererText).Background = "white";
diff --git a/LongoMatch/gtk-gui/LongoMatch.Gui.MainWindow.cs b/LongoMatch/gtk-gui/LongoMatch.Gui.MainWindow.cs
index fbceab2..be53dc1 100644
--- a/LongoMatch/gtk-gui/LongoMatch.Gui.MainWindow.cs
+++ b/LongoMatch/gtk-gui/LongoMatch.Gui.MainWindow.cs
@@ -75,19 +75,19 @@ namespace LongoMatch.Gui {
private LongoMatch.Gui.Component.PlaysListTreeWidget treewidget1;
- private Gtk.Label label2;
+ private Gtk.Label playslabel;
private LongoMatch.Gui.Component.PlayersListTreeWidget localplayerslisttreewidget;
- private Gtk.Label label6;
+ private Gtk.Label localteamlabel;
private LongoMatch.Gui.Component.PlayersListTreeWidget visitorplayerslisttreewidget;
- private Gtk.Label label4;
+ private Gtk.Label visitorteamlabel;
private LongoMatch.Gui.Component.TagsTreeWidget tagstreewidget1;
- private Gtk.Label label7;
+ private Gtk.Label tagslabel;
private Gtk.HPaned hpaned1;
@@ -241,7 +241,7 @@ namespace LongoMatch.Gui {
this.notebook1 = new Gtk.Notebook();
this.notebook1.CanFocus = true;
this.notebook1.Name = "notebook1";
- this.notebook1.CurrentPage = 3;
+ this.notebook1.CurrentPage = 0;
this.notebook1.TabPos = ((Gtk.PositionType)(3));
// Container child notebook1.Gtk.Notebook+NotebookChild
this.treewidget1 = new LongoMatch.Gui.Component.PlaysListTreeWidget();
@@ -249,11 +249,11 @@ namespace LongoMatch.Gui {
this.treewidget1.Name = "treewidget1";
this.notebook1.Add(this.treewidget1);
// Notebook tab
- this.label2 = new Gtk.Label();
- this.label2.Name = "label2";
- this.label2.LabelProp = Mono.Unix.Catalog.GetString("Plays");
- this.notebook1.SetTabLabel(this.treewidget1, this.label2);
- this.label2.ShowAll();
+ this.playslabel = new Gtk.Label();
+ this.playslabel.Name = "playslabel";
+ this.playslabel.LabelProp = Mono.Unix.Catalog.GetString("Plays");
+ this.notebook1.SetTabLabel(this.treewidget1, this.playslabel);
+ this.playslabel.ShowAll();
// Container child notebook1.Gtk.Notebook+NotebookChild
this.localplayerslisttreewidget = new LongoMatch.Gui.Component.PlayersListTreeWidget();
this.localplayerslisttreewidget.Events = ((Gdk.EventMask)(256));
@@ -262,11 +262,11 @@ namespace LongoMatch.Gui {
Gtk.Notebook.NotebookChild w5 = ((Gtk.Notebook.NotebookChild)(this.notebook1[this.localplayerslisttreewidget]));
w5.Position = 1;
// Notebook tab
- this.label6 = new Gtk.Label();
- this.label6.Name = "label6";
- this.label6.LabelProp = Mono.Unix.Catalog.GetString("Local Team");
- this.notebook1.SetTabLabel(this.localplayerslisttreewidget, this.label6);
- this.label6.ShowAll();
+ this.localteamlabel = new Gtk.Label();
+ this.localteamlabel.Name = "localteamlabel";
+ this.localteamlabel.LabelProp = Mono.Unix.Catalog.GetString("Local Team");
+ this.notebook1.SetTabLabel(this.localplayerslisttreewidget, this.localteamlabel);
+ this.localteamlabel.ShowAll();
// Container child notebook1.Gtk.Notebook+NotebookChild
this.visitorplayerslisttreewidget = new LongoMatch.Gui.Component.PlayersListTreeWidget();
this.visitorplayerslisttreewidget.Events = ((Gdk.EventMask)(256));
@@ -275,11 +275,11 @@ namespace LongoMatch.Gui {
Gtk.Notebook.NotebookChild w6 = ((Gtk.Notebook.NotebookChild)(this.notebook1[this.visitorplayerslisttreewidget]));
w6.Position = 2;
// Notebook tab
- this.label4 = new Gtk.Label();
- this.label4.Name = "label4";
- this.label4.LabelProp = Mono.Unix.Catalog.GetString("Visitor Team");
- this.notebook1.SetTabLabel(this.visitorplayerslisttreewidget, this.label4);
- this.label4.ShowAll();
+ this.visitorteamlabel = new Gtk.Label();
+ this.visitorteamlabel.Name = "visitorteamlabel";
+ this.visitorteamlabel.LabelProp = Mono.Unix.Catalog.GetString("Visitor Team");
+ this.notebook1.SetTabLabel(this.visitorplayerslisttreewidget, this.visitorteamlabel);
+ this.visitorteamlabel.ShowAll();
// Container child notebook1.Gtk.Notebook+NotebookChild
this.tagstreewidget1 = new LongoMatch.Gui.Component.TagsTreeWidget();
this.tagstreewidget1.Events = ((Gdk.EventMask)(256));
@@ -288,11 +288,11 @@ namespace LongoMatch.Gui {
Gtk.Notebook.NotebookChild w7 = ((Gtk.Notebook.NotebookChild)(this.notebook1[this.tagstreewidget1]));
w7.Position = 3;
// Notebook tab
- this.label7 = new Gtk.Label();
- this.label7.Name = "label7";
- this.label7.LabelProp = Mono.Unix.Catalog.GetString("Tags");
- this.notebook1.SetTabLabel(this.tagstreewidget1, this.label7);
- this.label7.ShowAll();
+ this.tagslabel = new Gtk.Label();
+ this.tagslabel.Name = "tagslabel";
+ this.tagslabel.LabelProp = Mono.Unix.Catalog.GetString("Tags");
+ this.notebook1.SetTabLabel(this.tagstreewidget1, this.tagslabel);
+ this.tagslabel.ShowAll();
this.leftbox.Add(this.notebook1);
Gtk.Box.BoxChild w8 = ((Gtk.Box.BoxChild)(this.leftbox[this.notebook1]));
w8.Position = 0;
diff --git a/LongoMatch/gtk-gui/gui.stetic b/LongoMatch/gtk-gui/gui.stetic
index 52cb081..c9e6c63 100644
--- a/LongoMatch/gtk-gui/gui.stetic
+++ b/LongoMatch/gtk-gui/gui.stetic
@@ -1981,7 +1981,7 @@
<widget class="Gtk.Notebook" id="notebook1">
<property name="MemberName" />
<property name="CanFocus">True</property>
- <property name="CurrentPage">3</property>
+ <property name="CurrentPage">0</property>
<property name="TabPos">Bottom</property>
<child>
<widget class="LongoMatch.Gui.Component.PlaysListTreeWidget" id="treewidget1">
@@ -1991,7 +1991,7 @@
</widget>
</child>
<child>
- <widget class="Gtk.Label" id="label2">
+ <widget class="Gtk.Label" id="playslabel">
<property name="MemberName" />
<property name="LabelProp" translatable="yes">Plays</property>
</widget>
@@ -2009,7 +2009,7 @@
</packing>
</child>
<child>
- <widget class="Gtk.Label" id="label6">
+ <widget class="Gtk.Label" id="localteamlabel">
<property name="MemberName" />
<property name="LabelProp" translatable="yes">Local Team</property>
</widget>
@@ -2027,7 +2027,7 @@
</packing>
</child>
<child>
- <widget class="Gtk.Label" id="label4">
+ <widget class="Gtk.Label" id="visitorteamlabel">
<property name="MemberName" />
<property name="LabelProp" translatable="yes">Visitor Team</property>
</widget>
@@ -2045,7 +2045,7 @@
</packing>
</child>
<child>
- <widget class="Gtk.Label" id="label7">
+ <widget class="Gtk.Label" id="tagslabel">
<property name="MemberName" />
<property name="LabelProp" translatable="yes">Tags</property>
</widget>
diff --git a/LongoMatch/gtk-gui/objects.xml b/LongoMatch/gtk-gui/objects.xml
index f7b4d85..e95a6af 100644
--- a/LongoMatch/gtk-gui/objects.xml
+++ b/LongoMatch/gtk-gui/objects.xml
@@ -182,6 +182,62 @@
</itemgroup>
</signals>
</object>
+ <object type="LongoMatch.Gui.Component.ProjectListWidget" palette-category="LongoMatch" allow-children="false" base-type="Gtk.Bin">
+ <itemgroups />
+ <signals>
+ <itemgroup label="ProjectListWidget Signals">
+ <signal name="ProjectsSelected" />
+ </itemgroup>
+ </signals>
+ </object>
+ <object type="LongoMatch.Gui.Component.CategoryProperties" palette-category="LongoMatch" allow-children="false" base-type="Gtk.Bin">
+ <itemgroups />
+ <signals>
+ <itemgroup label="CategoryProperties Signals">
+ <signal name="HotKeyChanged" />
+ </itemgroup>
+ </signals>
+ </object>
+ <object type="LongoMatch.Gui.Popup.TransparentDrawingArea" palette-category="General" allow-children="false" base-type="Gtk.Window">
+ <itemgroups />
+ <signals />
+ </object>
+ <object type="LongoMatch.Gui.Component.TagsTreeWidget" palette-category="LongoMatch" allow-children="false" base-type="Gtk.Bin">
+ <itemgroups />
+ <signals>
+ <itemgroup label="TagsTreeWidget Signals">
+ <signal name="TimeNodeSelected" />
+ <signal name="TimeNodeChanged" />
+ <signal name="PlayListNodeAdded" />
+ <signal name="SnapshotSeriesEvent" />
+ </itemgroup>
+ </signals>
+ </object>
+ <object type="LongoMatch.Gui.Component.DrawingToolBox" palette-category="General" allow-children="false" base-type="Gtk.Bin">
+ <itemgroups />
+ <signals>
+ <itemgroup label="DrawingToolBox Signals">
+ <signal name="LineWidthChanged" />
+ <signal name="DrawToolChanged" />
+ <signal name="ColorChanged" />
+ <signal name="VisibilityChanged" />
+ <signal name="ClearDrawing" />
+ <signal name="TransparencyChanged" />
+ </itemgroup>
+ </signals>
+ </object>
+ <object type="LongoMatch.Gui.Component.ProjectTemplateWidget" palette-category="LongoMatch" allow-children="false" base-type="Gtk.Bin">
+ <itemgroups>
+ <itemgroup label="ProjectTemplateWidget Properties">
+ <property name="Edited" />
+ </itemgroup>
+ </itemgroups>
+ <signals />
+ </object>
+ <object type="LongoMatch.Gui.Component.TaggerWidget" palette-category="General" allow-children="false" base-type="Gtk.Bin">
+ <itemgroups />
+ <signals />
+ </object>
<object type="LongoMatch.Gui.Component.PlayListWidget" palette-category="LongoMatch" allow-children="false" base-type="Gtk.Bin">
<itemgroups />
<signals>
@@ -192,11 +248,17 @@
</itemgroup>
</signals>
</object>
- <object type="LongoMatch.Gui.Component.ProjectListWidget" palette-category="LongoMatch" allow-children="false" base-type="Gtk.Bin">
+ <object type="LongoMatch.Gui.Component.PlaysListTreeWidget" palette-category="LongoMatch" allow-children="false" base-type="Gtk.Bin">
<itemgroups />
<signals>
- <itemgroup label="ProjectListWidget Signals">
- <signal name="ProjectsSelected" />
+ <itemgroup label="PlaysListTreeWidget Signals">
+ <signal name="TimeNodeSelected" />
+ <signal name="TimeNodeChanged" />
+ <signal name="TimeNodeDeleted" />
+ <signal name="PlayListNodeAdded" />
+ <signal name="SnapshotSeriesEvent" />
+ <signal name="PlayersTagged" />
+ <signal name="TagPlay" />
</itemgroup>
</signals>
</object>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]