[longomatch/newui: 147/157] Don't show menus for groups and players in the treeview



commit 1bb5cc5fdac7c84f28954844245708dadd095fc4
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Fri Aug 29 19:00:58 2014 +0200

    Don't show menus for groups and players in the treeview

 .../Gui/Component/PlaysListTreeWidget.cs           |    4 +-
 LongoMatch.GUI/Gui/TreeView/PlayersTreeView.cs     |   29 --------------------
 LongoMatch.GUI/Gui/TreeView/PlaysTreeView.cs       |    7 +++-
 3 files changed, 7 insertions(+), 33 deletions(-)
---
diff --git a/LongoMatch.GUI/Gui/Component/PlaysListTreeWidget.cs 
b/LongoMatch.GUI/Gui/Component/PlaysListTreeWidget.cs
index f1b268d..d9d42d6 100644
--- a/LongoMatch.GUI/Gui/Component/PlaysListTreeWidget.cs
+++ b/LongoMatch.GUI/Gui/Component/PlaysListTreeWidget.cs
@@ -138,7 +138,7 @@ namespace LongoMatch.Gui.Component
                        /* Add scores */
                        if (project.Categories.Scores.Count > 0) {
                                iter = dataFileListStore.AppendValues (
-                                       new AnalysisCategory { Name = Catalog.GetString ("Score"),
+                                       new Score { Name = Catalog.GetString ("Score"),
                                        SortMethod = SortMethodType.SortByStartTime,
                                        Color = Config.Style.PaletteActive}, null);
                                foreach (Score s in project.Categories.Scores) {
@@ -149,7 +149,7 @@ namespace LongoMatch.Gui.Component
                        /* Add penalty cards*/
                        if (project.Categories.PenaltyCards.Count > 0) {
                                iter = dataFileListStore.AppendValues (
-                                       new AnalysisCategory { Name = Catalog.GetString ("Penalty Cards"),
+                                       new PenaltyCard { Name = Catalog.GetString ("Penalty Cards"),
                                        SortMethod = SortMethodType.SortByStartTime,
                                        Color = Config.Style.PaletteActive}, null);
                                foreach (PenaltyCard pc in project.Categories.PenaltyCards) {
diff --git a/LongoMatch.GUI/Gui/TreeView/PlayersTreeView.cs b/LongoMatch.GUI/Gui/TreeView/PlayersTreeView.cs
index 4ec03a3..610e12d 100644
--- a/LongoMatch.GUI/Gui/TreeView/PlayersTreeView.cs
+++ b/LongoMatch.GUI/Gui/TreeView/PlayersTreeView.cs
@@ -30,12 +30,8 @@ namespace LongoMatch.Gui.Component
        public partial class PlayersTreeView : ListTreeViewBase
        {
 
-               private Menu playersMenu;
-
-
                public PlayersTreeView() {
                        this.Team = Team.LOCAL;
-                       SetPlayersMenu();
                }
 
                public Team Team {
@@ -43,29 +39,6 @@ namespace LongoMatch.Gui.Component
                        get;
                }
 
-               private void SetPlayersMenu() {
-                       Action edit;
-                       UIManager manager;
-                       ActionGroup g;
-
-                       manager= new UIManager();
-                       g = new ActionGroup("PlayersMenuGroup");
-
-                       edit = new Action("EditAction", Mono.Unix.Catalog.GetString("Edit name"), null, 
"gtk-edit");
-
-                       g.Add(edit, null);
-
-                       manager.InsertActionGroup(g,0);
-
-                       manager.AddUiFromString("<ui>"+
-                                               "  <popup action='PlayersMenu'>"+
-                                               "    <menuitem action='EditAction'/>"+
-                                               "  </popup>"+
-                                               "</ui>");
-
-                       playersMenu = manager.GetWidget("/PlayersMenu") as Menu;
-               }
-
                protected override int SortFunction(TreeModel model, TreeIter a, TreeIter b) {
                        object oa;
                        object ob;
@@ -105,8 +78,6 @@ namespace LongoMatch.Gui.Component
                                        TimeNode selectedTimeNode = GetValueFromPath(paths[0]) as TimeNode;
                                        if(selectedTimeNode is Play) {
                                                ShowMenu ();
-                                       } else {
-                                               playersMenu.Popup();
                                        }
                                }
                                else if(paths.Length > 1) {
diff --git a/LongoMatch.GUI/Gui/TreeView/PlaysTreeView.cs b/LongoMatch.GUI/Gui/TreeView/PlaysTreeView.cs
index a2bce9d..1f0f584 100644
--- a/LongoMatch.GUI/Gui/TreeView/PlaysTreeView.cs
+++ b/LongoMatch.GUI/Gui/TreeView/PlaysTreeView.cs
@@ -231,8 +231,11 @@ namespace LongoMatch.Gui.Component
                                        if (selectedTimeNode != null) {
                                                ShowMenu ();
                                        } else {
-                                               SetupSortMenu((GetValueFromPath(paths[0]) as 
AnalysisCategory).SortMethod);
-                                               categoriesMenu.Popup();
+                                               AnalysisCategory cat = GetValueFromPath(paths[0]) as 
AnalysisCategory;
+                                               if (!(cat is Score) && !(cat is PenaltyCard)) {
+                                                       SetupSortMenu(cat.SortMethod);
+                                                       categoriesMenu.Popup();
+                                               } 
                                        }
                                }
                                else if(paths.Length > 1) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]