[longomatch] Add a way to edit tag groups



commit 976106050aaefe30efe19de16a75c8ab190ac8a3
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Wed Oct 22 15:07:01 2014 +0200

    Add a way to edit tag groups

 LongoMatch.Core/Store/Project.cs                   |    1 +
 LongoMatch.GUI/Gui/Component/CategoryProperties.cs |   13 +++++
 .../LongoMatch.Gui.Component.CategoryProperties.cs |   35 ++++++++++++
 LongoMatch.GUI/gtk-gui/gui.stetic                  |   56 +++++++++++++++++++-
 4 files changed, 104 insertions(+), 1 deletions(-)
---
diff --git a/LongoMatch.Core/Store/Project.cs b/LongoMatch.Core/Store/Project.cs
index 3793174..fbe2ac9 100644
--- a/LongoMatch.Core/Store/Project.cs
+++ b/LongoMatch.Core/Store/Project.cs
@@ -174,6 +174,7 @@ namespace LongoMatch.Core.Store
                                return subsType;
                        }
                }
+
                #endregion
 
                #region Public Methods
diff --git a/LongoMatch.GUI/Gui/Component/CategoryProperties.cs 
b/LongoMatch.GUI/Gui/Component/CategoryProperties.cs
index 2961589..2cdfa5e 100644
--- a/LongoMatch.GUI/Gui/Component/CategoryProperties.cs
+++ b/LongoMatch.GUI/Gui/Component/CategoryProperties.cs
@@ -69,6 +69,7 @@ namespace LongoMatch.Gui.Component
                        shapecombobox.Changed += HandleShapeChanged;
                        pointsbutton.Changed += HandlePointsChanged;
                        teamcombobox.Changed += HandleTeamChanged;
+                       groupentry.Changed += HandleGroupChanged;
 
                        postable.NoShowAll = true;
                        cattable.NoShowAll = true;
@@ -187,6 +188,7 @@ namespace LongoMatch.Gui.Component
                        scoretable.Visible = scoreButton != null;
                        cardtable.Visible = cardButton != null;
                        timertable.Visible = timerButton != null;
+                       tagtable.Visible = tagButton != null;
 
                        if (button != null) {
                                nameentry.Text = button.Name;
@@ -234,6 +236,9 @@ namespace LongoMatch.Gui.Component
                        if (timerButton != null) {
                                teamcombobox.Active = (int)timerButton.Timer.Team;
                        }
+                       if (tagButton != null) {
+                               groupentry.Text = tagButton.Tag.Group;
+                       }
                        ignore = false;
                        Edited = false;
                }
@@ -386,5 +391,13 @@ namespace LongoMatch.Gui.Component
                        timerButton.Timer.Team = (Team)teamcombobox.Active;
                        Edited = true;
                }
+               
+               void HandleGroupChanged (object sender, EventArgs e)
+               {
+                       if (ignore)
+                               return;
+                       tagButton.Tag.Group = groupentry.Text;
+                       Edited = true;
+               }
        }
 }
diff --git a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.CategoryProperties.cs 
b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.CategoryProperties.cs
index e984d23..0f01fa4 100644
--- a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.CategoryProperties.cs
+++ b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.CategoryProperties.cs
@@ -47,6 +47,9 @@ namespace LongoMatch.Gui.Component
                private global::Gtk.Table timertable;
                private global::Gtk.Label label18;
                private global::Gtk.ComboBox teamcombobox;
+               private global::Gtk.Table tagtable;
+               private global::Gtk.Entry groupentry;
+               private global::Gtk.Label label19;
 
                protected virtual void Build ()
                {
@@ -530,6 +533,37 @@ namespace LongoMatch.Gui.Component
                        w42.Position = 7;
                        w42.Expand = false;
                        w42.Fill = false;
+                       // Container child vbox3.Gtk.Box+BoxChild
+                       this.tagtable = new global::Gtk.Table (((uint)(1)), ((uint)(2)), false);
+                       this.tagtable.Name = "tagtable";
+                       this.tagtable.RowSpacing = ((uint)(6));
+                       this.tagtable.ColumnSpacing = ((uint)(6));
+                       // Container child tagtable.Gtk.Table+TableChild
+                       this.groupentry = new global::Gtk.Entry ();
+                       this.groupentry.CanFocus = true;
+                       this.groupentry.Name = "groupentry";
+                       this.groupentry.IsEditable = true;
+                       this.groupentry.InvisibleChar = '•';
+                       this.tagtable.Add (this.groupentry);
+                       global::Gtk.Table.TableChild w43 = ((global::Gtk.Table.TableChild)(this.tagtable 
[this.groupentry]));
+                       w43.LeftAttach = ((uint)(1));
+                       w43.RightAttach = ((uint)(2));
+                       w43.YOptions = ((global::Gtk.AttachOptions)(4));
+                       // Container child tagtable.Gtk.Table+TableChild
+                       this.label19 = new global::Gtk.Label ();
+                       this.label19.Name = "label19";
+                       this.label19.Xalign = 1F;
+                       this.label19.LabelProp = global::Mono.Unix.Catalog.GetString ("Group");
+                       this.label19.UseMarkup = true;
+                       this.tagtable.Add (this.label19);
+                       global::Gtk.Table.TableChild w44 = ((global::Gtk.Table.TableChild)(this.tagtable 
[this.label19]));
+                       w44.XOptions = ((global::Gtk.AttachOptions)(0));
+                       w44.YOptions = ((global::Gtk.AttachOptions)(4));
+                       this.vbox3.Add (this.tagtable);
+                       global::Gtk.Box.BoxChild w45 = ((global::Gtk.Box.BoxChild)(this.vbox3 
[this.tagtable]));
+                       w45.Position = 8;
+                       w45.Expand = false;
+                       w45.Fill = false;
                        this.Add (this.vbox3);
                        if ((this.Child != null)) {
                                this.Child.ShowAll ();
@@ -538,6 +572,7 @@ namespace LongoMatch.Gui.Component
                        this.cardtable.Hide ();
                        this.scoretable.Hide ();
                        this.timertable.Hide ();
+                       this.tagtable.Hide ();
                        this.Show ();
                }
        }
diff --git a/LongoMatch.GUI/gtk-gui/gui.stetic b/LongoMatch.GUI/gtk-gui/gui.stetic
index 242e1ea..64f1b01 100644
--- a/LongoMatch.GUI/gtk-gui/gui.stetic
+++ b/LongoMatch.GUI/gtk-gui/gui.stetic
@@ -969,7 +969,7 @@ Sort by competition</property>
       </widget>
     </child>
   </widget>
-  <widget class="Gtk.Bin" id="LongoMatch.Gui.Component.CategoryProperties" design-size="318 561">
+  <widget class="Gtk.Bin" id="LongoMatch.Gui.Component.CategoryProperties" design-size="318 598">
     <property name="MemberName" />
     <child>
       <widget class="Gtk.VBox" id="vbox3">
@@ -1802,6 +1802,60 @@ Away</property>
             <property name="Fill">False</property>
           </packing>
         </child>
+        <child>
+          <widget class="Gtk.Table" id="tagtable">
+            <property name="MemberName" />
+            <property name="Visible">False</property>
+            <property name="NColumns">2</property>
+            <property name="RowSpacing">6</property>
+            <property name="ColumnSpacing">6</property>
+            <child>
+              <widget class="Gtk.Entry" id="groupentry">
+                <property name="MemberName" />
+                <property name="CanFocus">True</property>
+                <property name="IsEditable">True</property>
+                <property name="InvisibleChar">•</property>
+              </widget>
+              <packing>
+                <property name="LeftAttach">1</property>
+                <property name="RightAttach">2</property>
+                <property name="AutoSize">True</property>
+                <property name="YOptions">Fill</property>
+                <property name="XExpand">True</property>
+                <property name="XFill">True</property>
+                <property name="XShrink">False</property>
+                <property name="YExpand">False</property>
+                <property name="YFill">True</property>
+                <property name="YShrink">False</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="Gtk.Label" id="label19">
+                <property name="MemberName" />
+                <property name="Xalign">1</property>
+                <property name="LabelProp" translatable="yes">Group</property>
+                <property name="UseMarkup">True</property>
+              </widget>
+              <packing>
+                <property name="AutoSize">False</property>
+                <property name="XOptions">0</property>
+                <property name="YOptions">Fill</property>
+                <property name="XExpand">False</property>
+                <property name="XFill">False</property>
+                <property name="XShrink">False</property>
+                <property name="YExpand">False</property>
+                <property name="YFill">True</property>
+                <property name="YShrink">False</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="Position">8</property>
+            <property name="AutoSize">True</property>
+            <property name="Expand">False</property>
+            <property name="Fill">False</property>
+          </packing>
+        </child>
       </widget>
     </child>
   </widget>


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