f-spot r3583 - in trunk: . src src/Editors



Author: sdelcroix
Date: Fri Jan 18 20:55:09 2008
New Revision: 3583
URL: http://svn.gnome.org/viewvc/f-spot?rev=3583&view=rev

Log:
2008-01-18  Stephane Delcroix  <sdelcroix novell com>

	* src/HigMessageDialog.cs: in the FSpot.UI.Dialog ns.

	* src/Editors/SoftFocus.cs:
	* src/FileImportBackend.cs:
	* src/FlickrExport.cs:
	* src/ColorDialog.cs:
	* src/RotateCommand.cs:
	* src/PhotoVersionCommands.cs:
	* src/PicasaWebExport.cs:
	* src/ImportCommand.cs:
	* src/Loupe.cs:
	* src/ItemAction.cs:
	* src/MainWindow.cs:
	* src/PhotoView.cs:
	* src/TagSelectionWidget.cs:
	* src/PrintDialog.cs:
	* src/GalleryExport.cs: ns changes.


Modified:
   trunk/ChangeLog
   trunk/src/ColorDialog.cs
   trunk/src/Editors/SoftFocus.cs
   trunk/src/FileImportBackend.cs
   trunk/src/FlickrExport.cs
   trunk/src/GalleryExport.cs
   trunk/src/HigMessageDialog.cs
   trunk/src/ImportCommand.cs
   trunk/src/ItemAction.cs
   trunk/src/Loupe.cs
   trunk/src/MainWindow.cs
   trunk/src/PhotoVersionCommands.cs
   trunk/src/PhotoView.cs
   trunk/src/PicasaWebExport.cs
   trunk/src/PrintDialog.cs
   trunk/src/RotateCommand.cs
   trunk/src/TagSelectionWidget.cs

Modified: trunk/src/ColorDialog.cs
==============================================================================
--- trunk/src/ColorDialog.cs	(original)
+++ trunk/src/ColorDialog.cs	Fri Jan 18 20:55:09 2008
@@ -4,6 +4,7 @@
 using Mono.Unix;
 using System.Threading;
 using FSpot.Widgets;
+using FSpot.UI.Dialog;
 
 namespace FSpot {
 	public class ColorDialog : GladeDialog {

Modified: trunk/src/Editors/SoftFocus.cs
==============================================================================
--- trunk/src/Editors/SoftFocus.cs	(original)
+++ trunk/src/Editors/SoftFocus.cs	Fri Jan 18 20:55:09 2008
@@ -14,6 +14,8 @@
 using Cairo;
 using Mono.Unix;
 
+using FSpot.UI.Dialog;
+
 namespace FSpot.Editors {
 	public class SoftFocus : EffectEditor {
 		Widgets.SoftFocus soft; 

Modified: trunk/src/FileImportBackend.cs
==============================================================================
--- trunk/src/FileImportBackend.cs	(original)
+++ trunk/src/FileImportBackend.cs	Fri Jan 18 20:55:09 2008
@@ -5,6 +5,7 @@
 using System;
 using FSpot;
 using FSpot.Xmp;
+using FSpot.UI.Dialog;
 using System.IO;
 using Mono.Unix;
 

Modified: trunk/src/FlickrExport.cs
==============================================================================
--- trunk/src/FlickrExport.cs	(original)
+++ trunk/src/FlickrExport.cs	Fri Jan 18 20:55:09 2008
@@ -3,9 +3,11 @@
 using System.IO;
 using System.Threading;
 using Mono.Unix;
+
 using FSpot.Filters;
 using FSpot.Widgets;
 using FSpot.Utils;
+using FSpot.UI.Dialog;
 
 namespace FSpot {
 	public class TwentyThreeHQExport : FlickrExport

Modified: trunk/src/GalleryExport.cs
==============================================================================
--- trunk/src/GalleryExport.cs	(original)
+++ trunk/src/GalleryExport.cs	Fri Jan 18 20:55:09 2008
@@ -10,6 +10,7 @@
 using FSpot.Filters;
 using FSpot.Widgets;
 using FSpot.Utils;
+using FSpot.UI.Dialog;
 
 using GalleryRemote;
 

Modified: trunk/src/HigMessageDialog.cs
==============================================================================
--- trunk/src/HigMessageDialog.cs	(original)
+++ trunk/src/HigMessageDialog.cs	Fri Jan 18 20:55:09 2008
@@ -1,8 +1,17 @@
+/*
+ * FSpot.UI.Dialog.HigMessageDialog.cs
+ *
+ * Author(s):
+ *	Larry Ewing <lewing novell com>
+ *
+ * This is free software. See COPYING for details.
+ */
+
 using System;
 using Mono.Unix;
 using Gtk;
 
-namespace FSpot {
+namespace FSpot.UI.Dialog {
 	public class EditException : Exception 
 	{
 		IBrowsableItem item;
@@ -48,176 +57,176 @@
 			return desc;
 		}
 	}
-}					    
 
-// created on 24/01/2005 at 20:14
-// Taken pretty much wholesale from Tomboy
-public class HigMessageDialog : Gtk.Dialog
-{
-	Gtk.AccelGroup accel_group;
-
-	public HigMessageDialog (Gtk.Window parent,
-				 Gtk.DialogFlags flags,
-				 Gtk.MessageType type,
-				 Gtk.ButtonsType buttons,
-				 string          header,
-				 string          msg)
-		: base ()
+	// created on 24/01/2005 at 20:14
+	// Taken pretty much wholesale from Tomboy
+	public class HigMessageDialog : Gtk.Dialog
 	{
-		HasSeparator = false;
-		BorderWidth = 5;
-		Resizable = false;
-		Title = String.Empty;
-
-		VBox.Spacing = 12;
-		ActionArea.Layout = Gtk.ButtonBoxStyle.End;
-
-		accel_group = new Gtk.AccelGroup ();
-		AddAccelGroup (accel_group);
-
-		Gtk.HBox hbox = new Gtk.HBox (false, 12);
-		hbox.BorderWidth = 5;
-		hbox.Show ();
-		VBox.PackStart (hbox, false, false, 0);
-
-		Gtk.Image image = null;
-
-		switch (type) {
-		case Gtk.MessageType.Error:
-			image = new Gtk.Image (Gtk.Stock.DialogError, Gtk.IconSize.Dialog);
-			break;
-		case Gtk.MessageType.Question:
-			image = new Gtk.Image (Gtk.Stock.DialogQuestion, Gtk.IconSize.Dialog);
-			break;
-		case Gtk.MessageType.Info:
-			image = new Gtk.Image (Gtk.Stock.DialogInfo, Gtk.IconSize.Dialog);
-			break;
-		case Gtk.MessageType.Warning:
-			image = new Gtk.Image (Gtk.Stock.DialogWarning, Gtk.IconSize.Dialog);
-			break;
+		Gtk.AccelGroup accel_group;
+	
+		public HigMessageDialog (Gtk.Window parent,
+					 Gtk.DialogFlags flags,
+					 Gtk.MessageType type,
+					 Gtk.ButtonsType buttons,
+					 string          header,
+					 string          msg)
+			: base ()
+		{
+			HasSeparator = false;
+			BorderWidth = 5;
+			Resizable = false;
+			Title = String.Empty;
+	
+			VBox.Spacing = 12;
+			ActionArea.Layout = Gtk.ButtonBoxStyle.End;
+	
+			accel_group = new Gtk.AccelGroup ();
+			AddAccelGroup (accel_group);
+	
+			Gtk.HBox hbox = new Gtk.HBox (false, 12);
+			hbox.BorderWidth = 5;
+			hbox.Show ();
+			VBox.PackStart (hbox, false, false, 0);
+	
+			Gtk.Image image = null;
+	
+			switch (type) {
+			case Gtk.MessageType.Error:
+				image = new Gtk.Image (Gtk.Stock.DialogError, Gtk.IconSize.Dialog);
+				break;
+			case Gtk.MessageType.Question:
+				image = new Gtk.Image (Gtk.Stock.DialogQuestion, Gtk.IconSize.Dialog);
+				break;
+			case Gtk.MessageType.Info:
+				image = new Gtk.Image (Gtk.Stock.DialogInfo, Gtk.IconSize.Dialog);
+				break;
+			case Gtk.MessageType.Warning:
+				image = new Gtk.Image (Gtk.Stock.DialogWarning, Gtk.IconSize.Dialog);
+				break;
+			}
+	
+			image.Show ();
+			hbox.PackStart (image, false, false, 0);
+			
+			Gtk.VBox label_vbox = new Gtk.VBox (false, 0);
+			label_vbox.Show ();
+			hbox.PackStart (label_vbox, true, true, 0);
+	
+			string title = String.Format ("<span weight='bold' size='larger'>{0}" +
+						      "</span>{1}",
+						      header, Environment.NewLine);
+	
+			Gtk.Label label;
+	
+			label = new Gtk.Label (title);
+			label.UseMarkup = true;
+			label.Justify = Gtk.Justification.Left;
+			label.LineWrap = true;
+			label.SetAlignment (0.0f, 0.5f);
+			label.Show ();
+			label_vbox.PackStart (label, false, false, 0);
+	
+			label = new Gtk.Label (msg);
+			label.UseMarkup = true;
+			label.Justify = Gtk.Justification.Left;
+			label.LineWrap = true;
+			label.SetAlignment (0.0f, 0.5f);
+			label.UseUnderline = false;
+			label.Show ();
+			label_vbox.PackStart (label, false, false, 0);
+			
+			switch (buttons) {
+			case Gtk.ButtonsType.None:
+				break;
+			case Gtk.ButtonsType.Ok:
+				AddButton (Gtk.Stock.Ok, Gtk.ResponseType.Ok, true);
+				break;
+			case Gtk.ButtonsType.Close:
+				AddButton (Gtk.Stock.Close, Gtk.ResponseType.Close, true);
+				break;
+			case Gtk.ButtonsType.Cancel:
+				AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, true);
+				break;
+			case Gtk.ButtonsType.YesNo:
+				AddButton (Gtk.Stock.No, Gtk.ResponseType.No, false);
+				AddButton (Gtk.Stock.Yes, Gtk.ResponseType.Yes, true);
+				break;
+			case Gtk.ButtonsType.OkCancel:
+				AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, false);
+				AddButton (Gtk.Stock.Ok, Gtk.ResponseType.Ok, true);
+				break;
+			}
+	
+			if (parent != null)
+				TransientFor = parent;
+	
+			if ((int) (flags & Gtk.DialogFlags.Modal) != 0)
+				Modal = true;
+	
+			if ((int) (flags & Gtk.DialogFlags.DestroyWithParent) != 0)
+				DestroyWithParent = true;
+		}
+	
+		// constructor for a HIG confirmation alert with two buttons
+		public HigMessageDialog (Gtk.Window parent,
+					 Gtk.DialogFlags flags,
+					 Gtk.MessageType type,
+					 string          header,
+					 string          msg,
+					 string          ok_caption)
+			: this (parent, flags, type, Gtk.ButtonsType.Cancel, header, msg)
+		{
+			AddButton (ok_caption, Gtk.ResponseType.Ok, false);
 		}
-
-		image.Show ();
-		hbox.PackStart (image, false, false, 0);
-		
-		Gtk.VBox label_vbox = new Gtk.VBox (false, 0);
-		label_vbox.Show ();
-		hbox.PackStart (label_vbox, true, true, 0);
-
-		string title = String.Format ("<span weight='bold' size='larger'>{0}" +
-					      "</span>{1}",
-					      header, Environment.NewLine);
-
-		Gtk.Label label;
-
-		label = new Gtk.Label (title);
-		label.UseMarkup = true;
-		label.Justify = Gtk.Justification.Left;
-		label.LineWrap = true;
-		label.SetAlignment (0.0f, 0.5f);
-		label.Show ();
-		label_vbox.PackStart (label, false, false, 0);
-
-		label = new Gtk.Label (msg);
-		label.UseMarkup = true;
-		label.Justify = Gtk.Justification.Left;
-		label.LineWrap = true;
-		label.SetAlignment (0.0f, 0.5f);
-		label.UseUnderline = false;
-		label.Show ();
-		label_vbox.PackStart (label, false, false, 0);
 		
-		switch (buttons) {
-		case Gtk.ButtonsType.None:
-			break;
-		case Gtk.ButtonsType.Ok:
-			AddButton (Gtk.Stock.Ok, Gtk.ResponseType.Ok, true);
-			break;
-		case Gtk.ButtonsType.Close:
-			AddButton (Gtk.Stock.Close, Gtk.ResponseType.Close, true);
-			break;
-		case Gtk.ButtonsType.Cancel:
-			AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, true);
-			break;
-		case Gtk.ButtonsType.YesNo:
-			AddButton (Gtk.Stock.No, Gtk.ResponseType.No, false);
-			AddButton (Gtk.Stock.Yes, Gtk.ResponseType.Yes, true);
-			break;
-		case Gtk.ButtonsType.OkCancel:
-			AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, false);
-			AddButton (Gtk.Stock.Ok, Gtk.ResponseType.Ok, true);
-			break;
+		public void AddButton (string stock_id, Gtk.ResponseType response, bool is_default)
+		{
+			Gtk.Button button = new Gtk.Button (stock_id);
+			button.CanDefault = true;
+			button.Show ();
+	
+			AddActionWidget (button, response);
+	
+			if (is_default) {
+				DefaultResponse = response;
+				button.AddAccelerator ("activate",
+						       accel_group,
+						       (uint) Gdk.Key.Escape, 
+						       0,
+						       Gtk.AccelFlags.Visible);
+			}
 		}
-
-		if (parent != null)
-			TransientFor = parent;
-
-		if ((int) (flags & Gtk.DialogFlags.Modal) != 0)
-			Modal = true;
-
-		if ((int) (flags & Gtk.DialogFlags.DestroyWithParent) != 0)
-			DestroyWithParent = true;
-	}
-
-	// constructor for a HIG confirmation alert with two buttons
-	public HigMessageDialog (Gtk.Window parent,
-				 Gtk.DialogFlags flags,
-				 Gtk.MessageType type,
-				 string          header,
-				 string          msg,
-				 string          ok_caption)
-		: this (parent, flags, type, Gtk.ButtonsType.Cancel, header, msg)
-	{
-		AddButton (ok_caption, Gtk.ResponseType.Ok, false);
-	}
 	
-	public void AddButton (string stock_id, Gtk.ResponseType response, bool is_default)
-	{
-		Gtk.Button button = new Gtk.Button (stock_id);
-		button.CanDefault = true;
-		button.Show ();
-
-		AddActionWidget (button, response);
-
-		if (is_default) {
-			DefaultResponse = response;
-			button.AddAccelerator ("activate",
-					       accel_group,
-					       (uint) Gdk.Key.Escape, 
-					       0,
-					       Gtk.AccelFlags.Visible);
+		//run and destroy a standard dialog
+		public static Gtk.ResponseType RunHigMessageDialog(Gtk.Window parent,
+					 Gtk.DialogFlags flags,
+					 Gtk.MessageType type,
+					 Gtk.ButtonsType buttons,
+					 string          header,
+					 string          msg)
+		{
+			HigMessageDialog hmd = new HigMessageDialog(parent, flags, type, buttons, header, msg);
+	 		try {
+	 			return (Gtk.ResponseType)hmd.Run();
+	 		} finally {
+	 			hmd.Destroy();
+	 		}	
 		}
+	
+		//Run and destroy a standard confirmation dialog
+		public static Gtk.ResponseType RunHigConfirmation(Gtk.Window parent,
+					 Gtk.DialogFlags flags,
+					 Gtk.MessageType type,
+					 string          header,
+					 string          msg,
+					 string          ok_caption)
+		{
+			HigMessageDialog hmd = new HigMessageDialog(parent, flags, type, header, msg, ok_caption);
+	 		try {
+	 			return (Gtk.ResponseType)hmd.Run();
+	 		} finally {
+	 			hmd.Destroy();
+	 		}	
+	 	}
 	}
-
-	//run and destroy a standard dialog
-	public static Gtk.ResponseType RunHigMessageDialog(Gtk.Window parent,
-				 Gtk.DialogFlags flags,
-				 Gtk.MessageType type,
-				 Gtk.ButtonsType buttons,
-				 string          header,
-				 string          msg)
-	{
-		HigMessageDialog hmd = new HigMessageDialog(parent, flags, type, buttons, header, msg);
- 		try {
- 			return (Gtk.ResponseType)hmd.Run();
- 		} finally {
- 			hmd.Destroy();
- 		}	
-	}
-
-	//Run and destroy a standard confirmation dialog
-	public static Gtk.ResponseType RunHigConfirmation(Gtk.Window parent,
-				 Gtk.DialogFlags flags,
-				 Gtk.MessageType type,
-				 string          header,
-				 string          msg,
-				 string          ok_caption)
-	{
-		HigMessageDialog hmd = new HigMessageDialog(parent, flags, type, header, msg, ok_caption);
- 		try {
- 			return (Gtk.ResponseType)hmd.Run();
- 		} finally {
- 			hmd.Destroy();
- 		}	
- 	}
 }

Modified: trunk/src/ImportCommand.cs
==============================================================================
--- trunk/src/ImportCommand.cs	(original)
+++ trunk/src/ImportCommand.cs	Fri Jan 18 20:55:09 2008
@@ -24,6 +24,7 @@
 using FSpot.Widgets;
 using FSpot;
 using FSpot.Utils;
+using FSpot.UI.Dialog;
 
 public class ImportCommand : FSpot.GladeDialog
 {

Modified: trunk/src/ItemAction.cs
==============================================================================
--- trunk/src/ItemAction.cs	(original)
+++ trunk/src/ItemAction.cs	Fri Jan 18 20:55:09 2008
@@ -13,6 +13,7 @@
 using Mono.Unix;
 using FSpot.Filters;
 using System;
+using FSpot.UI.Dialog;
 
 namespace FSpot {
 	public abstract class ItemAction : Gtk.Action {

Modified: trunk/src/Loupe.cs
==============================================================================
--- trunk/src/Loupe.cs	(original)
+++ trunk/src/Loupe.cs	Fri Jan 18 20:55:09 2008
@@ -4,6 +4,7 @@
 using Cairo;
 using Mono.Unix;
 using FSpot.Widgets;
+using FSpot.UI.Dialog;
 
 namespace FSpot {
 	public class Sharpener : Loupe {

Modified: trunk/src/MainWindow.cs
==============================================================================
--- trunk/src/MainWindow.cs	(original)
+++ trunk/src/MainWindow.cs	Fri Jan 18 20:55:09 2008
@@ -18,6 +18,8 @@
 using FSpot.Query;
 using FSpot.Widgets;
 using FSpot.Utils;
+using FSpot.UI.Dialog;
+
 using LibGPhoto2;
 
 public class MainWindow {

Modified: trunk/src/PhotoVersionCommands.cs
==============================================================================
--- trunk/src/PhotoVersionCommands.cs	(original)
+++ trunk/src/PhotoVersionCommands.cs	Fri Jan 18 20:55:09 2008
@@ -3,6 +3,7 @@
 using System;
 using Mono.Unix;
 using FSpot;
+using FSpot.UI.Dialog;
 
 public class PhotoVersionCommands {
 

Modified: trunk/src/PhotoView.cs
==============================================================================
--- trunk/src/PhotoView.cs	(original)
+++ trunk/src/PhotoView.cs	Fri Jan 18 20:55:09 2008
@@ -7,6 +7,7 @@
 
 using FSpot.Xmp;
 using FSpot.Utils;
+using FSpot.UI.Dialog;
 
 namespace FSpot {
 public class PhotoView : EventBox {

Modified: trunk/src/PicasaWebExport.cs
==============================================================================
--- trunk/src/PicasaWebExport.cs	(original)
+++ trunk/src/PicasaWebExport.cs	Fri Jan 18 20:55:09 2008
@@ -19,6 +19,7 @@
 using FSpot.Filters;
 using FSpot.Widgets;
 using FSpot.Utils;
+using FSpot.UI.Dialog;
 
 using Gnome.Keyring;
 

Modified: trunk/src/PrintDialog.cs
==============================================================================
--- trunk/src/PrintDialog.cs	(original)
+++ trunk/src/PrintDialog.cs	Fri Jan 18 20:55:09 2008
@@ -1,6 +1,7 @@
 using System;
 using System.Collections;
 using Gtk;
+using FSpot.UI.Dialog;
 
 namespace FSpot {
 	public class PrintDialog {

Modified: trunk/src/RotateCommand.cs
==============================================================================
--- trunk/src/RotateCommand.cs	(original)
+++ trunk/src/RotateCommand.cs	Fri Jan 18 20:55:09 2008
@@ -16,6 +16,7 @@
 
 using FSpot;
 using FSpot.Png;
+using FSpot.UI.Dialog;
 
 using Mono.Unix;
 

Modified: trunk/src/TagSelectionWidget.cs
==============================================================================
--- trunk/src/TagSelectionWidget.cs	(original)
+++ trunk/src/TagSelectionWidget.cs	Fri Jan 18 20:55:09 2008
@@ -34,6 +34,7 @@
 
 using Mono.Unix;
 using FSpot;
+using FSpot.UI.Dialog;
 
 public class TagSelectionWidget : FSpot.Widgets.SaneTreeView {
 	TagSelectionWidget widget;



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