[longomatch] Created dialog with progress bar to show the thumbnailing progress



commit 05d8aa374cbe5ee2bc8848cdf2772dfbed436b25
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Sat Mar 20 10:36:44 2010 +0100

    Created dialog with progress bar to show the thumbnailing progress

 LongoMatch/Gui/Dialog/BusyDialog.cs                |   44 ++++++++++++++
 LongoMatch/LongoMatch.mdp                          |    2 +
 LongoMatch/Makefile.am                             |    2 +
 LongoMatch/Utils/ProjectUtils.cs                   |   13 ++++-
 .../gtk-gui/LongoMatch.Gui.Dialog.BusyDialog.cs    |   62 ++++++++++++++++++++
 LongoMatch/gtk-gui/gui.stetic                      |   39 ++++++++++++
 6 files changed, 161 insertions(+), 1 deletions(-)
---
diff --git a/LongoMatch/Gui/Dialog/BusyDialog.cs b/LongoMatch/Gui/Dialog/BusyDialog.cs
new file mode 100644
index 0000000..9bca233
--- /dev/null
+++ b/LongoMatch/Gui/Dialog/BusyDialog.cs
@@ -0,0 +1,44 @@
+// 
+//  Copyright (C) 2010 Andoni Morales Alastruey
+// 
+//  This program is free software; you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation; either version 2 of the License, or
+//  (at your option) any later version.
+// 
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+//  GNU General Public License for more details.
+//  
+//  You should have received a copy of the GNU General Public License
+//  along with this program; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+// 
+
+using System;
+
+namespace LongoMatch.Gui.Dialog
+{
+	
+	
+	public partial class BusyDialog : Gtk.Window
+	{
+		
+		public BusyDialog() : 
+				base(Gtk.WindowType.Toplevel)
+		{
+			this.Build();
+		}
+		
+		public string Message {
+			set{
+				messagelabel.Text = value;
+			}
+		}
+		
+		public void Pulse(){
+			progressbar1.Pulse();
+		}
+	}
+}
diff --git a/LongoMatch/LongoMatch.mdp b/LongoMatch/LongoMatch.mdp
index 88811f3..713baba 100644
--- a/LongoMatch/LongoMatch.mdp
+++ b/LongoMatch/LongoMatch.mdp
@@ -185,6 +185,8 @@
     <File name="Utils/ProjectUtils.cs" subtype="Code" buildaction="Compile" />
     <File name="images/camera-video.png" subtype="Code" buildaction="EmbedAsResource" />
     <File name="images/video.png" subtype="Code" buildaction="EmbedAsResource" />
+    <File name="Gui/Dialog/BusyDialog.cs" subtype="Code" buildaction="Compile" />
+    <File name="gtk-gui/LongoMatch.Gui.Dialog.BusyDialog.cs" subtype="Code" buildaction="Compile" />
   </Contents>
   <References>
     <ProjectReference type="Gac" localcopy="True" refto="Mono.Posix, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
diff --git a/LongoMatch/Makefile.am b/LongoMatch/Makefile.am
index 08da8ff..f7d9561 100644
--- a/LongoMatch/Makefile.am
+++ b/LongoMatch/Makefile.am
@@ -118,6 +118,7 @@ FILES = \
 	gtk-gui/LongoMatch.Gui.Component.TeamTemplateWidget.cs \
 	gtk-gui/LongoMatch.Gui.Component.TimeAdjustWidget.cs \
 	gtk-gui/LongoMatch.Gui.Component.TimeLineWidget.cs \
+	gtk-gui/LongoMatch.Gui.Dialog.BusyDialog.cs \
 	gtk-gui/LongoMatch.Gui.Dialog.DrawingTool.cs \
 	gtk-gui/LongoMatch.Gui.Dialog.EditCategoryDialog.cs \
 	gtk-gui/LongoMatch.Gui.Dialog.EditPlayerDialog.cs \
@@ -161,6 +162,7 @@ FILES = \
 	Gui/Component/TimeLineWidget.cs \
 	Gui/Component/TimeReferenceWidget.cs \
 	Gui/Component/TimeScale.cs \
+	Gui/Dialog/BusyDialog.cs \
 	Gui/Dialog/DrawingTool.cs \
 	Gui/Dialog/EditCategoryDialog.cs \
 	Gui/Dialog/EditPlayerDialog.cs \
diff --git a/LongoMatch/Utils/ProjectUtils.cs b/LongoMatch/Utils/ProjectUtils.cs
index a8c4f5e..0aa0a16 100644
--- a/LongoMatch/Utils/ProjectUtils.cs
+++ b/LongoMatch/Utils/ProjectUtils.cs
@@ -242,9 +242,18 @@ namespace LongoMatch.Utils
 			fChooser.Destroy();
 		}
 		
-		public static void CreateThumbnails(Project project){
+		public static void CreateThumbnails(Window window, Project project){
 			MultimediaFactory factory;
 			IFramesCapturer capturer;
+			BusyDialog dialog;
+			
+			Console.WriteLine("start thumbnails");
+			
+			dialog = new BusyDialog();
+			dialog.TransientFor = window;
+			dialog.Message = Catalog.GetString("Creating video thumbnails. This can take a while."); 
+			dialog.Show();
+			dialog.Pulse();
 			
 			/* Create all the thumbnails */
 			factory = new MultimediaFactory();
@@ -257,6 +266,7 @@ namespace LongoMatch.Utils
 						                  true);
 						play.Miniature = capturer.GetCurrentFrame(Constants.THUMBNAIL_MAX_WIDTH,
 						                                          Constants.THUMBNAIL_MAX_HEIGHT);
+						dialog.Pulse();
 						
 					} catch {
 						/* FIXME: Add log */
@@ -264,6 +274,7 @@ namespace LongoMatch.Utils
 				}					
 			}	
 			capturer.Dispose();
+			dialog.Destroy();
 		}
 	}
 }
diff --git a/LongoMatch/gtk-gui/LongoMatch.Gui.Dialog.BusyDialog.cs b/LongoMatch/gtk-gui/LongoMatch.Gui.Dialog.BusyDialog.cs
new file mode 100644
index 0000000..bf6441f
--- /dev/null
+++ b/LongoMatch/gtk-gui/LongoMatch.Gui.Dialog.BusyDialog.cs
@@ -0,0 +1,62 @@
+// ------------------------------------------------------------------------------
+//  <autogenerated>
+//      This code was generated by a tool.
+//      
+// 
+//      Changes to this file may cause incorrect behavior and will be lost if 
+//      the code is regenerated.
+//  </autogenerated>
+// ------------------------------------------------------------------------------
+
+namespace LongoMatch.Gui.Dialog {
+    
+    
+    public partial class BusyDialog {
+        
+        private Gtk.VBox vbox2;
+        
+        private Gtk.Label messagelabel;
+        
+        private Gtk.ProgressBar progressbar1;
+        
+        protected virtual void Build() {
+            Stetic.Gui.Initialize(this);
+            // Widget LongoMatch.Gui.Dialog.BusyDialog
+            this.Name = "LongoMatch.Gui.Dialog.BusyDialog";
+            this.Title = "";
+            this.Icon = Stetic.IconLoader.LoadIcon(this, "longomatch", Gtk.IconSize.Menu, 16);
+            this.WindowPosition = ((Gtk.WindowPosition)(4));
+            this.Modal = true;
+            this.Resizable = false;
+            this.AllowGrow = false;
+            this.Gravity = ((Gdk.Gravity)(5));
+            this.SkipPagerHint = true;
+            this.SkipTaskbarHint = true;
+            // Container child LongoMatch.Gui.Dialog.BusyDialog.Gtk.Container+ContainerChild
+            this.vbox2 = new Gtk.VBox();
+            this.vbox2.Name = "vbox2";
+            this.vbox2.Spacing = 6;
+            // Container child vbox2.Gtk.Box+BoxChild
+            this.messagelabel = new Gtk.Label();
+            this.messagelabel.Name = "messagelabel";
+            this.vbox2.Add(this.messagelabel);
+            Gtk.Box.BoxChild w1 = ((Gtk.Box.BoxChild)(this.vbox2[this.messagelabel]));
+            w1.Position = 0;
+            // Container child vbox2.Gtk.Box+BoxChild
+            this.progressbar1 = new Gtk.ProgressBar();
+            this.progressbar1.Name = "progressbar1";
+            this.vbox2.Add(this.progressbar1);
+            Gtk.Box.BoxChild w2 = ((Gtk.Box.BoxChild)(this.vbox2[this.progressbar1]));
+            w2.Position = 1;
+            w2.Expand = false;
+            w2.Fill = false;
+            this.Add(this.vbox2);
+            if ((this.Child != null)) {
+                this.Child.ShowAll();
+            }
+            this.DefaultWidth = 295;
+            this.DefaultHeight = 95;
+            this.Show();
+        }
+    }
+}
diff --git a/LongoMatch/gtk-gui/gui.stetic b/LongoMatch/gtk-gui/gui.stetic
index 58c954d..340ac3c 100644
--- a/LongoMatch/gtk-gui/gui.stetic
+++ b/LongoMatch/gtk-gui/gui.stetic
@@ -5370,6 +5370,7 @@ You can add new tags using the text entry and clicking "Add Tag"</property>
                     <property name="MemberName" />
                     <property name="CanFocus">True</property>
                     <property name="Label" translatable="yes" />
+                    <property name="Active">True</property>
                     <property name="DrawIndicator">True</property>
                     <property name="HasLabel">False</property>
                     <property name="UseUnderline">True</property>
@@ -5652,4 +5653,42 @@ You can continue with the current capture, cancel it or save your project.
       </widget>
     </child>
   </widget>
+  <widget class="Gtk.Window" id="LongoMatch.Gui.Dialog.BusyDialog" design-size="295 95">
+    <property name="MemberName" />
+    <property name="Title" translatable="yes" />
+    <property name="Icon">stock:longomatch Menu</property>
+    <property name="WindowPosition">CenterOnParent</property>
+    <property name="Modal">True</property>
+    <property name="Resizable">False</property>
+    <property name="AllowGrow">False</property>
+    <property name="Gravity">Center</property>
+    <property name="SkipPagerHint">True</property>
+    <property name="SkipTaskbarHint">True</property>
+    <child>
+      <widget class="Gtk.VBox" id="vbox2">
+        <property name="MemberName" />
+        <property name="Spacing">6</property>
+        <child>
+          <widget class="Gtk.Label" id="messagelabel">
+            <property name="MemberName" />
+          </widget>
+          <packing>
+            <property name="Position">0</property>
+            <property name="AutoSize">False</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="Gtk.ProgressBar" id="progressbar1">
+            <property name="MemberName" />
+          </widget>
+          <packing>
+            <property name="Position">1</property>
+            <property name="AutoSize">True</property>
+            <property name="Expand">False</property>
+            <property name="Fill">False</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+  </widget>
 </stetic-interface>
\ No newline at end of file



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