f-spot r4358 - in trunk: . src



Author: lmilesi
Date: Tue Sep 16 10:47:31 2008
New Revision: 4358
URL: http://svn.gnome.org/viewvc/f-spot?rev=4358&view=rev

Log:
2008-09-16  Lorenzo Milesi <maxxer yetopen it>

        * src/f-spot.glade:
        * src/PhotoImageView.cs:
        * src/MainWindow.cs: Add view loupe menu item. Bgo#474704.



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

Modified: trunk/src/Loupe.cs
==============================================================================
--- trunk/src/Loupe.cs	(original)
+++ trunk/src/Loupe.cs	Tue Sep 16 10:47:31 2008
@@ -596,7 +596,7 @@
 		{
 			switch (args.Event.Key) {
 			case Gdk.Key.v:
-				Destroy ();
+				MainWindow.Toplevel.PhotoView.View.ShowHideLoupe ();
 				args.RetVal = true;
 				break;
 			default:

Modified: trunk/src/MainWindow.cs
==============================================================================
--- trunk/src/MainWindow.cs	(original)
+++ trunk/src/MainWindow.cs	Tue Sep 16 10:47:31 2008
@@ -91,6 +91,7 @@
 
 	[Glade.Widget] MenuItem zoom_in;
 	[Glade.Widget] MenuItem zoom_out;
+	[Glade.Widget] CheckMenuItem loupe_menu_item;
 
 	[Glade.Widget] RadioMenuItem tag_icon_hidden;
 	[Glade.Widget] RadioMenuItem tag_icon_small;
@@ -598,7 +599,7 @@
 			group_selector.Visible = display_timeline.Active;
 
 			if (photo_view.View.Loupe != null)
-				photo_view.View.Loupe.Destroy ();
+				loupe_menu_item.Active = false;
 			JumpTo (photo_view.Item.Index);
 			zoom_scale.Value = icon_view.Zoom;
 			break;
@@ -2122,6 +2123,17 @@
 		new TimeDialog (db, list);
 	}
 
+	void HandleLoupe (object sender, EventArgs args)
+	{
+		// Don't steal characters from any text entries
+		if (Window.Focus is Gtk.Entry && Gtk.Global.CurrentEvent is Gdk.EventKey) {
+			Window.Focus.ProcessEvent (Gtk.Global.CurrentEvent);
+			return;
+		}
+		
+		photo_view.View.ShowHideLoupe ();
+	}
+
 	void HandleSharpen (object sender, EventArgs args)
 	{
 		// Don't steal characters from any text entries
@@ -2908,6 +2920,7 @@
 			rename_version_menu_item.Sensitive = false;
 
 			sharpen.Sensitive = false;
+			loupe_menu_item.Sensitive = false;
 		} else {
 			version_menu_item.Sensitive = true;
 			create_version_menu_item.Sensitive = true;
@@ -2925,6 +2938,7 @@
 			version_menu_item.Submenu = versions_submenu;
 
 			sharpen.Sensitive = (view_mode == ModeType.IconView ? false : true);
+			loupe_menu_item.Sensitive = (view_mode == ModeType.IconView ? false : true);
 		}
 
 		set_as_background.Sensitive = single_active;

Modified: trunk/src/PhotoImageView.cs
==============================================================================
--- trunk/src/PhotoImageView.cs	(original)
+++ trunk/src/PhotoImageView.cs	Tue Sep 16 10:47:31 2008
@@ -103,7 +103,6 @@
 				editor = null;
 		}
 
-
 		public Loupe Loupe {
 			get { return loupe; }
 		}
@@ -534,15 +533,6 @@
 			case Gdk.Key.KP_Subtract:
 				ZoomOut ();
 				break;
-			case Gdk.Key.v:
-				if (loupe == null) {
-					loupe = new Loupe (this);
-					loupe.Destroyed += HandleLoupeDestroy;
-					loupe.Show ();
-				} else {
-					loupe.Destroy ();	
-				}
-				break;
 			case Gdk.Key.equal:
 			case Gdk.Key.plus:
 			case Gdk.Key.KP_Add:
@@ -556,6 +546,18 @@
 			return;
 		}
 
+		public void ShowHideLoupe ()
+		{
+			if (loupe == null) {
+				loupe = new Loupe (this);
+				loupe.Destroyed += HandleLoupeDestroy;
+				loupe.Show ();
+			} else {
+				loupe.Destroy ();	
+			}
+			
+		}
+		
 		public void ShowSharpener ()
 		{
 			if (sharpener == null) {

Modified: trunk/src/f-spot.glade
==============================================================================
--- trunk/src/f-spot.glade	(original)
+++ trunk/src/f-spot.glade	Tue Sep 16 10:47:31 2008
@@ -3544,6 +3544,15 @@
                       </widget>
                     </child>
                     <child>
+                      <widget class="GtkCheckMenuItem" id="loupe_menu_item">
+                        <property name="visible">True</property>
+                        <property name="label" translatable="yes">_Loupe</property>
+                        <property name="use_underline">True</property>
+                        <signal name="activate" handler="HandleLoupe"/>
+                        <accelerator key="v" signal="activate"/>
+                      </widget>
+                    </child>
+                    <child>
                       <widget class="GtkSeparatorMenuItem" id="separator16">
                         <property name="visible">True</property>
                       </widget>



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