[mistelix] Fixes #issue 583912



commit 57497d4ea39535d3ac7286ec9c0efd6b7cd39de9
Author: Jordi Mas <jmas softcatala org>
Date:   Wed May 27 18:08:48 2009 +0200

    Fixes #issue 583912
---
 src/dialogs/AddSlideDialog.cs |    7 ++++---
 src/mistelix.glade            |    4 ++--
 src/widgets/SlideShowView.cs  |    4 ++++
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/dialogs/AddSlideDialog.cs b/src/dialogs/AddSlideDialog.cs
index 3a6dee4..28858ad 100644
--- a/src/dialogs/AddSlideDialog.cs
+++ b/src/dialogs/AddSlideDialog.cs
@@ -68,7 +68,7 @@ namespace Mistelix.Dialogs
 		[Glade.Widget] Gtk.HBox ctrls_hbox;
 		[Glade.Widget] Gtk.Button up_button;
 		[Glade.Widget] Gtk.Button down_button;
-		[Glade.Widget] Gtk.Button preview;
+		[Glade.Widget] Gtk.Button preview_button;
 		[Glade.Widget] Gtk.Button audio_button;
 		[Glade.Widget] Gtk.VBox vbox_dir;
 		[Glade.Widget] Gtk.ComboBox textposition_combo;
@@ -330,12 +330,12 @@ namespace Mistelix.Dialogs
 			}
 		}
 		
-		void OnPreview (object sender, EventArgs args) 
+		void OnSlideShowPreview (object sender, EventArgs args) 
 		{
 			SlideShow slide_show = this.SlideShow;
 			SlideShowView slide_show_view = new SlideShowView(slide_show);
 			FullScreenWindow full_screen = new FullScreenWindow(slide_show_view);
-			Destroy ();
+			Dialog.Respond (ResponseType.Ok);
 		}
 
 		// If there are at least two elements we enable the navigation buttons
@@ -345,6 +345,7 @@ namespace Mistelix.Dialogs
 			TreeIter iter;
 
 			enable = image_view.ListStore.GetIterFirst (out iter);
+			preview_button.Sensitive = enable;
 
 			if (enable)
 				enable = image_view.ListStore.IterNext (ref iter);
diff --git a/src/mistelix.glade b/src/mistelix.glade
index f2f5610..ffe06c5 100644
--- a/src/mistelix.glade
+++ b/src/mistelix.glade
@@ -899,7 +899,7 @@
 			  </child>
 
 			  <child>
-			    <widget class="GtkButton" id="preview">
+			    <widget class="GtkButton" id="preview_button">
 			      <property name="visible">True</property>
 			      <property name="can_default">True</property>
 			      <property name="can_focus">True</property>
@@ -907,7 +907,7 @@
 			      <property name="use_underline">True</property>
 			      <property name="relief">GTK_RELIEF_NORMAL</property>
 			      <property name="focus_on_click">True</property>
-			      <signal name="clicked" handler="OnPreview" last_modification_time="Sun, 09 Nov 2008 14:14:34 GMT"/>
+			      <signal name="clicked" handler="OnSlideShowPreview" last_modification_time="Sun, 09 Nov 2008 14:14:34 GMT"/>
 			    </widget>
 			  </child>
 			</widget>
diff --git a/src/widgets/SlideShowView.cs b/src/widgets/SlideShowView.cs
index 9872c72..44c7cd6 100644
--- a/src/widgets/SlideShowView.cs
+++ b/src/widgets/SlideShowView.cs
@@ -126,6 +126,10 @@ namespace Mistelix.Widgets
 				CurrentIndex = 0;
 			if (player != null)
 				player.PlayLooping();
+
+			if (slide.images.Count == 1) // Single image, just show it
+				current_image = ResizeImage (CurrentIndex);
+
 			if(!PlayingTransition())
 				Forward();
 		}



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