[longomatch] Set harddisk icon for fake live projects



commit 3799568a1cd03a17a3e9d837396b38668a95634c
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Sun Jun 22 13:59:34 2014 +0200

    Set harddisk icon for fake live projects

 LongoMatch.GUI/Gui/Component/ProjectListWidget.cs |    9 ++++++++-
 LongoMatch.GUI/Gui/Panel/ProjectsManagerPanel.cs  |    7 ++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/LongoMatch.GUI/Gui/Component/ProjectListWidget.cs 
b/LongoMatch.GUI/Gui/Component/ProjectListWidget.cs
index ce79e14..198e739 100644
--- a/LongoMatch.GUI/Gui/Component/ProjectListWidget.cs
+++ b/LongoMatch.GUI/Gui/Component/ProjectListWidget.cs
@@ -29,6 +29,7 @@ using LongoMatch.Common;
 using LongoMatch.Handlers;
 using LongoMatch.Store;
 using LongoMatch.Video.Utils;
+using Gdk;
 
 
 
@@ -72,12 +73,18 @@ namespace LongoMatch.Gui.Component
                
                public void Fill (List<ProjectDescription> projects)
                {
+                       Pixbuf image;
                        swallowSignals = true;
                        this.projects = projects;
                        store.Clear ();
                        foreach (ProjectDescription pdesc in projects)
                        {
-                               store.AppendValues (Describe (pdesc), pdesc.File.Preview.Value, pdesc);
+                               if (pdesc.File.Preview != null) {
+                                       image = pdesc.File.Preview.Value;
+                               } else  {
+                                       image = Stetic.IconLoader.LoadIcon (this, Gtk.Stock.Harddisk, 
IconSize.Dialog);
+                               }
+                               store.AppendValues (Describe (pdesc), image, pdesc);
                        }
                        swallowSignals = false;
                }
diff --git a/LongoMatch.GUI/Gui/Panel/ProjectsManagerPanel.cs 
b/LongoMatch.GUI/Gui/Panel/ProjectsManagerPanel.cs
index f60827a..0c7ad95 100644
--- a/LongoMatch.GUI/Gui/Panel/ProjectsManagerPanel.cs
+++ b/LongoMatch.GUI/Gui/Panel/ProjectsManagerPanel.cs
@@ -79,7 +79,12 @@ namespace LongoMatch.Gui.Panel
                        datelabel.Text = pd.MatchDate.ToShortDateString ();
                        templatelabel.Text = project.Categories.Name;
                        
-                       fileimage.Pixbuf = f.Preview.Value;
+                       if (f.Preview != null) {
+                               fileimage.Pixbuf = f.Preview.Value;
+                       } else {
+                               fileimage.Pixbuf = Stetic.IconLoader.LoadIcon (this, Gtk.Stock.Harddisk,
+                                                                              IconSize.Dialog);
+                       }
                        medialabel.Markup = f.Description;
                        
                        homelabel.Text = lt.TeamName;


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