[longomatch] Show a default title for projects



commit e169d66abb55c44fb374e9c13df68094da8b5cac
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Mon Oct 6 07:41:46 2014 +0200

    Show a default title for projects

 LongoMatch.Core/Store/ProjectDescription.cs       |   15 +++++++++++++--
 LongoMatch.GUI/Gui/Component/ProjectListWidget.cs |   12 +-----------
 2 files changed, 14 insertions(+), 13 deletions(-)
---
diff --git a/LongoMatch.Core/Store/ProjectDescription.cs b/LongoMatch.Core/Store/ProjectDescription.cs
index ccb7ac2..4572624 100644
--- a/LongoMatch.Core/Store/ProjectDescription.cs
+++ b/LongoMatch.Core/Store/ProjectDescription.cs
@@ -30,6 +30,8 @@ namespace LongoMatch.Core.Store
        [Serializable]
        public class ProjectDescription :  IComparable, IIDObject
        {
+               string title;
+
                /// <summary>
                /// Unique ID of the parent project
                /// </summary>
@@ -42,8 +44,17 @@ namespace LongoMatch.Core.Store
                /// Title of the project
                /// </summary>
                public String Title {
-                       get;
-                       set;
+                       get {
+                               if (title == null) {
+                                       return String.Format ("{0} - {1} ({2}-{3}) {4} {5}",
+                                                             LocalName, VisitorName, LocalGoals, 
VisitorGoals,
+                                                             Competition, Season);
+                               }
+                               return title;
+                       }
+                       set {
+                               title = value;
+                       }
                }
 
                /// <summary>
diff --git a/LongoMatch.GUI/Gui/Component/ProjectListWidget.cs 
b/LongoMatch.GUI/Gui/Component/ProjectListWidget.cs
index a1d2a2c..13105ce 100644
--- a/LongoMatch.GUI/Gui/Component/ProjectListWidget.cs
+++ b/LongoMatch.GUI/Gui/Component/ProjectListWidget.cs
@@ -84,7 +84,7 @@ namespace LongoMatch.Gui.Component
                                } else  {
                                        image = Stetic.IconLoader.LoadIcon (this, Gtk.Stock.Harddisk, 
IconSize.Dialog);
                                }
-                               store.AppendValues (Describe (pdesc), image, pdesc);
+                               store.AppendValues (pdesc.Title, image, pdesc);
                        }
                        swallowSignals = false;
                }
@@ -103,16 +103,6 @@ namespace LongoMatch.Gui.Component
                        filterEntry.Text="";
                }
                
-               string Describe (ProjectDescription project) {
-                       string ret;
-                       
-                       ret = project.Title;
-                       ret += String.Format ("\n {0} - {1} ({2}-{3})", project.LocalName,
-                                             project.VisitorName, project.LocalGoals,
-                                             project.VisitorGoals);
-                       return ret;
-               }
-               
                ListStore CreateStore ()
                {
                        store = new ListStore (typeof (string), typeof (Gdk.Pixbuf), typeof 
(ProjectDescription));


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