[longomatch] Set tempate backgrounds when editing a subcategory



commit d79b412accbe1d8d6e70a4db5f82aaaf077cf2b5
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Sun Aug 18 16:20:44 2013 +0200

    Set tempate backgrounds when editing a subcategory

 .../Gui/Component/CategoriesTemplateEditor.cs      |    1 +
 LongoMatch.GUI/Gui/Component/CategoryProperties.cs |   14 ++++++++++++++
 .../Gui/Component/PlaysListTreeWidget.cs           |    1 +
 LongoMatch.GUI/Gui/Dialog/EditCategoryDialog.cs    |    6 ++++++
 4 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/LongoMatch.GUI/Gui/Component/CategoriesTemplateEditor.cs 
b/LongoMatch.GUI/Gui/Component/CategoriesTemplateEditor.cs
index a8bef13..26ab949 100644
--- a/LongoMatch.GUI/Gui/Component/CategoriesTemplateEditor.cs
+++ b/LongoMatch.GUI/Gui/Component/CategoriesTemplateEditor.cs
@@ -134,6 +134,7 @@ namespace LongoMatch.Gui.Component
                protected override void EditSelected() {
                        EditCategoryDialog dialog = new EditCategoryDialog(ts);
                        dialog.Category = selected[0];
+                       dialog.Template = Template;
                        dialog.HotKeysList = hkList;
                        dialog.TransientFor = (Gtk.Window) Toplevel;
                        dialog.Run();
diff --git a/LongoMatch.GUI/Gui/Component/CategoryProperties.cs 
b/LongoMatch.GUI/Gui/Component/CategoryProperties.cs
index ea65303..a4b7c3c 100644
--- a/LongoMatch.GUI/Gui/Component/CategoryProperties.cs
+++ b/LongoMatch.GUI/Gui/Component/CategoryProperties.cs
@@ -121,6 +121,20 @@ namespace LongoMatch.Gui.Component
                        set;
                        get;
                }
+               
+               public Categories Template {
+                       set {
+                               if (value.FieldBackground != null) {
+                                       fieldcoordinatestagger.Background = value.FieldBackground.Value;
+                               }
+                               if (value.HalfFieldBackground != null) {
+                                       halffieldcoordinatestagger.Background = 
value.HalfFieldBackground.Value;
+                               }
+                               if (value.GoalBackground != null) {
+                                       goalcoordinatestagger.Background = value.GoalBackground.Value;
+                               }
+                       }
+               }
 
                private void  UpdateGui() {
                        ListStore list;
diff --git a/LongoMatch.GUI/Gui/Component/PlaysListTreeWidget.cs 
b/LongoMatch.GUI/Gui/Component/PlaysListTreeWidget.cs
index d94be7d..2e540f4 100644
--- a/LongoMatch.GUI/Gui/Component/PlaysListTreeWidget.cs
+++ b/LongoMatch.GUI/Gui/Component/PlaysListTreeWidget.cs
@@ -182,6 +182,7 @@ namespace LongoMatch.Gui.Component
                protected virtual void OnEditProperties(TimeNode tNode, object val) {
                        EditCategoryDialog dialog = new EditCategoryDialog(ts);
                        dialog.Category = tNode as Category; 
+                       dialog.Template = project.Categories;
                        dialog.Project = project;
                        dialog.Run();
                        dialog.Destroy();
diff --git a/LongoMatch.GUI/Gui/Dialog/EditCategoryDialog.cs b/LongoMatch.GUI/Gui/Dialog/EditCategoryDialog.cs
index 7bc1e6d..49d5f53 100644
--- a/LongoMatch.GUI/Gui/Dialog/EditCategoryDialog.cs
+++ b/LongoMatch.GUI/Gui/Dialog/EditCategoryDialog.cs
@@ -50,6 +50,12 @@ namespace LongoMatch.Gui.Dialog
                        }
                }
                
+               public Categories Template {
+                       set {
+                               timenodeproperties2.Template = value;
+                       }
+               }
+               
                public Project Project {
                        set {
                                timenodeproperties2.Project = value;


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