[f-spot] PhotoView: Fix copy/select all in text fields



commit e8d4a6c67d24fe221fa0dd649eb250f57185f438
Author: Alex Launi <alex launi gmail com>
Date:   Tue Jul 13 09:35:25 2010 -0400

    PhotoView: Fix copy/select all in text fields
    
    Makes ctrl+C and ctrl+A work correctly in text fields rather than
    copying/selecting photos from the collection. (bgo#620445).

 src/MainWindow.cs |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/MainWindow.cs b/src/MainWindow.cs
index 224ee6c..dd49e34 100644
--- a/src/MainWindow.cs
+++ b/src/MainWindow.cs
@@ -2140,6 +2140,11 @@ namespace FSpot
 	
 		void HandleSelectAllCommand (object sender, EventArgs args)
 		{
+			if (Window.Focus is Editable) {
+				(Window.Focus as Editable).SelectRegion (0, -1); // select all in text box
+				return;
+			}
+
 			icon_view.SelectAllCells ();
 			UpdateStatusLabel ();
 		}
@@ -2278,6 +2283,11 @@ namespace FSpot
 			Clipboard primary = Clipboard.Get (Atom.Intern ("PRIMARY", false));
 			Clipboard clipboard = Clipboard.Get (Atom.Intern ("CLIPBOARD", false));
 
+			if (Window.Focus is Editable) {
+				(Window.Focus as Editable).CopyClipboard ();
+				return;
+			}
+
 			clipboard.SetWithData (new TargetEntry[] {
 						DragDropTargets.PlainTextEntry,
 						DragDropTargets.UriListEntry,



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