[Mono-docs-list] Re: Patch for pasting in monodoc

Peter Williams peter@newton.cx
Wed, 28 Jul 2004 19:37:11 -0400


--=-Lz9W+72h8Iy06vTI5n/L
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

The third hunk of the original patch desensitizes the paste item. I
committed, but can revert if I'm misunderstanding what you want.

Next up is a patch for copying: it will copy from the text editor if
you're in editing mode; the function used to blindly copy from the HTML
view no matter what mode the browser is in.

Peter

On Wed, 2004-07-28 at 11:55, Miguel de Icaza wrote:
> Hello,
> 
> > The attached patch adds a menu item to allow pasting when editing in
> > Monodoc. Otherwise it's disabled. Ok for me to commit?
> 
> When leaving the edit mode, I would like the paste item to be disabled,
> it seems like that bit is missing.
> 
> Other than that, feel free to apply the patch
-- 
Peter Williams                          peter@newton.cx

"[Ninjas] are cool; and by cool, I mean totally sweet."
                              -- REAL Ultimate Power

--=-Lz9W+72h8Iy06vTI5n/L
Content-Disposition: attachment; filename=copying.diff
Content-Type: text/x-patch; name=copying.diff; charset=iso-8859-1
Content-Transfer-Encoding: 7bit

Index: browser/ChangeLog
===================================================================
RCS file: /cvs/public/monodoc/browser/ChangeLog,v
retrieving revision 1.134
diff -u -r1.134 ChangeLog
--- browser/ChangeLog	28 Jul 2004 22:25:05 -0000	1.134
+++ browser/ChangeLog	28 Jul 2004 22:29:47 -0000
@@ -1,6 +1,11 @@
 2004-07-28  Peter Williams  <peter@newton.cx>
 
-	* browser.cs: Add support for pasting from the clipboard.
+	* browser.cs (OnCopyActivate): If in editing mode, copy from
+	the text editor's selection, not the HTML view.
+
+2004-07-28  Peter Williams  <peter@newton.cx>
+
+	* browser.cs: Add support for pasting from the clipboard.	
 
 	* browser.glade: Add a Paste menu item.
 
Index: browser/browser.cs
===================================================================
RCS file: /cvs/public/monodoc/browser/browser.cs,v
retrieving revision 1.107
diff -u -r1.107 browser.cs
--- browser/browser.cs	28 Jul 2004 22:25:05 -0000	1.107
+++ browser/browser.cs	28 Jul 2004 22:29:47 -0000
@@ -562,7 +562,12 @@
 	//
 	void OnCopyActivate (object sender, EventArgs a)
 	{
-		html.Copy ();
+		if (BrowserMode == Mode.Viewer)
+			html.Copy ();
+		else {
+			Clipboard cb = Clipboard.Get (Gdk.Selection.Clipboard);
+			text_editor.Buffer.CopyClipboard (cb);
+		}
 	}
 
 	//

--=-Lz9W+72h8Iy06vTI5n/L--