[longomatch] Make widget's mode configurable through constructor.



commit 8ad7e4a345ad35291e1e4a0057c7895ba403f81e
Author: Julien Moutte <julien fluendo com>
Date:   Wed Mar 18 18:34:45 2015 +0100

    Make widget's mode configurable through constructor.
    
    Indeed we were using the FileSet's size as a trigger to enable editable. This is not suitable for fake 
project importing so we need to configure this at construction time.

 .../Gui/Component/MediaFileSetSelection.cs         |    8 ++++----
 LongoMatch.GUI/Gui/GUIToolkit.cs                   |    2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/LongoMatch.GUI/Gui/Component/MediaFileSetSelection.cs 
b/LongoMatch.GUI/Gui/Component/MediaFileSetSelection.cs
index 447da3e..e771e59 100644
--- a/LongoMatch.GUI/Gui/Component/MediaFileSetSelection.cs
+++ b/LongoMatch.GUI/Gui/Component/MediaFileSetSelection.cs
@@ -24,17 +24,19 @@ using Gtk;
 
 namespace LongoMatch.Gui.Component
 {
-       [System.ComponentModel.ToolboxItem(true)]
+       [System.ComponentModel.ToolboxItem (true)]
        public partial class MediaFileSetSelection : Gtk.Bin
        {
                MediaFileSet fileSet;
                List<MediaFileChooser> fileChoosers;
                bool editable = true;
 
-               public MediaFileSetSelection ()
+               public MediaFileSetSelection (bool editable = true)
                {
                        this.Build ();
 
+                       this.editable = editable;
+
                        fileChoosers = new List<MediaFileChooser> ();
                }
 
@@ -43,8 +45,6 @@ namespace LongoMatch.Gui.Component
                                fileSet = value;
 
                                if (fileSet.Count > 0) {
-                                       editable = false;
-
                                        // Create all choosers
                                        foreach (MediaFile mf in fileSet) {
                                                AddMediaFileChooser (mf.Name);
diff --git a/LongoMatch.GUI/Gui/GUIToolkit.cs b/LongoMatch.GUI/Gui/GUIToolkit.cs
index b9a3dfb..bc347a6 100644
--- a/LongoMatch.GUI/Gui/GUIToolkit.cs
+++ b/LongoMatch.GUI/Gui/GUIToolkit.cs
@@ -415,7 +415,7 @@ namespace LongoMatch.Gui
                public bool SelectMediaFiles (Project project)
                {
                        bool ret = false;
-                       MediaFileSetSelection fileselector = new MediaFileSetSelection ();
+                       MediaFileSetSelection fileselector = new MediaFileSetSelection (false);
                        Gtk.Dialog d = new Gtk.Dialog (Catalog.GetString ("Select video files"),
                                               mainWindow.Toplevel as Gtk.Window,
                                               DialogFlags.Modal | DialogFlags.DestroyWithParent,


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