f-spot r3721 - in trunk: . src



Author: sdelcroix
Date: Fri Feb 29 15:51:08 2008
New Revision: 3721
URL: http://svn.gnome.org/viewvc/f-spot?rev=3721&view=rev

Log:
2008-02-29  Stephane Delcroix  <sdelcroix novell com>

	* src/FullScreenView.cs: replace obsolete call.

	* src/PhotoImageView.cs:
	* src/MainWindow.cs: use the Loupe sharpener from the edit menu too. Fixes
	bgo #326547.

	* src/f-spot.glade: add the 's' shortcut to the menuitem


Modified:
   trunk/ChangeLog
   trunk/src/FullScreenView.cs
   trunk/src/MainWindow.cs
   trunk/src/PhotoImageView.cs
   trunk/src/f-spot.glade

Modified: trunk/src/FullScreenView.cs
==============================================================================
--- trunk/src/FullScreenView.cs	(original)
+++ trunk/src/FullScreenView.cs	Fri Feb 29 15:51:08 2008
@@ -11,7 +11,6 @@
 using Gtk;
 using Gdk;
 using FSpot.Widgets;
-using Cairo;
 using Mono.Unix;
 
 namespace FSpot {
@@ -215,7 +214,7 @@
 		protected override bool OnExposeEvent (Gdk.EventExpose args)
 		{
 			bool ret = base.OnExposeEvent (args);
-			Graphics g = CairoUtils.CreateDrawable (GdkWindow);
+			Graphics g = CairoHelper.Create (GdkWindow);
 
 			g.Color = new Cairo.Color (0, 0, 0, .5);
 			g.Operator = Operator.DestOut;

Modified: trunk/src/MainWindow.cs
==============================================================================
--- trunk/src/MainWindow.cs	(original)
+++ trunk/src/MainWindow.cs	Fri Feb 29 15:51:08 2008
@@ -1965,64 +1965,7 @@
 
 	void HandleSharpen (object sender, EventArgs args)
 	{
-		Gtk.Dialog dialog = new Gtk.Dialog (Catalog.GetString ("Unsharp Mask"), main_window, Gtk.DialogFlags.Modal);
-
-		dialog.VBox.Spacing = 6;
-		dialog.VBox.BorderWidth = 12;
-		
-		Gtk.Table table = new Gtk.Table (3, 2, false);
-		table.ColumnSpacing = 6;
-		table.RowSpacing = 6;
-		
-		table.Attach (new Gtk.Label (Catalog.GetString ("Amount:")), 0, 1, 0, 1);
-		table.Attach (new Gtk.Label (Catalog.GetString ("Radius:")), 0, 1, 1, 2);
-		table.Attach (new Gtk.Label (Catalog.GetString ("Threshold:")), 0, 1, 2, 3);
-
-		Gtk.SpinButton amount_spin = new Gtk.SpinButton (0.5, 100.0, .01);
-		Gtk.SpinButton radius_spin = new Gtk.SpinButton (5.0, 50.0, .01);
-		Gtk.SpinButton threshold_spin = new Gtk.SpinButton (0.0, 50.0, .01);
-
-		table.Attach (amount_spin, 1, 2, 0, 1);
-		table.Attach (radius_spin, 1, 2, 1, 2);
-		table.Attach (threshold_spin, 1, 2, 2, 3);
-		
-		dialog.VBox.PackStart (table);
-
-		dialog.AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel);
-		dialog.AddButton (Gtk.Stock.Ok, Gtk.ResponseType.Ok);
-
-		dialog.ShowAll ();
-
-		Gtk.ResponseType response = (Gtk.ResponseType) dialog.Run ();
-
-		if (response == Gtk.ResponseType.Ok) {
-			foreach (int id in SelectedIds ()) {
-				Photo photo = query.Photos [id];
-				try {
-					Gdk.Pixbuf orig = FSpot.PhotoLoader.Load (query, id);
-					Gdk.Pixbuf final = PixbufUtils.UnsharpMask (orig, radius_spin.Value, amount_spin.Value, threshold_spin.Value);
-					
-					bool create_version = photo.DefaultVersion.IsProtected;
-
-					photo.SaveVersion (final, create_version);
-					query.Commit (id);
-				} catch (System.Exception e) {
-					string msg = Catalog.GetString ("Error saving sharpened photo");
-					string desc = String.Format (Catalog.GetString ("Received exception \"{0}\". Unable to save photo {1}"),
-								     e.Message, photo.Name.Replace ("_", "__"));
-					
-					HigMessageDialog md = new HigMessageDialog (main_window, DialogFlags.DestroyWithParent, 
-										    Gtk.MessageType.Error, ButtonsType.Ok, 
-										    msg,
-										    desc);
-					md.Run ();
-					md.Destroy ();
-				}
-			
-			}
-		}
-
-		dialog.Destroy ();
+		photo_view.View.ShowSharpener ();
 	}
 
 	void HandleDisplayToolbar (object sender, EventArgs args)

Modified: trunk/src/PhotoImageView.cs
==============================================================================
--- trunk/src/PhotoImageView.cs	(original)
+++ trunk/src/PhotoImageView.cs	Fri Feb 29 15:51:08 2008
@@ -474,14 +474,6 @@
 			case Gdk.Key.KP_Subtract:
 				ZoomOut ();
 				break;
-			case Gdk.Key.s:
-				if (sharpener == null) {
-					sharpener = new Sharpener (this);
-					sharpener.Destroyed += HandleLoupeDestroy;
-				}
-
-				sharpener.Show ();
-				break;
 			case Gdk.Key.v:
 				if (loupe == null) {
 					loupe = new Loupe (this);
@@ -506,6 +498,16 @@
 
 			return;
 		}
+
+		public void ShowSharpener ()
+		{
+			if (sharpener == null) {
+				sharpener = new Sharpener (this);
+				sharpener.Destroyed += HandleLoupeDestroy;
+			}
+
+			sharpener.Show ();	
+		}
 		
 		[GLib.ConnectBefore]
 		private void HandleScrollEvent (object sender, Gtk.ScrollEventArgs args)

Modified: trunk/src/f-spot.glade
==============================================================================
--- trunk/src/f-spot.glade	(original)
+++ trunk/src/f-spot.glade	Fri Feb 29 15:51:08 2008
@@ -3269,6 +3269,7 @@
                         <property name="label" translatable="yes">_Sharpen...</property>
                         <property name="use_underline">True</property>
                         <signal name="activate" handler="HandleSharpen"/>
+                        <accelerator key="s" signal="activate"/>
                       </widget>
                     </child>
                     <child>



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