lynx-dev
[Top][All Lists]
Advanced

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

lynx-dev [PATCH 2.8.5-dev14] Cut&paste during download etc


From: Ilya Zakharevich
Subject: lynx-dev [PATCH 2.8.5-dev14] Cut&paste during download etc
Date: Tue, 18 Feb 2003 22:36:20 -0800
User-agent: Mutt/1.4i

This patch allows COPY command to work during download (copying the
location to clipboard).  The best thing would be to get the location
*after* redirects, but this may require some additional work.

Enjoy,
Ilya

--- ./src/LYUtils.c-ppre        Wed Jan 22 01:43:12 2003
+++ ./src/LYUtils.c     Tue Feb 18 18:37:54 2003
@@ -1637,16 +1637,26 @@ PUBLIC int HTCheckForInterrupt NOARGS
 
        /* There is a subset of mainloop() actions available at this stage:
        ** no new getfile() cycle is possible until the previous finished.
-       ** Currently we have scrolling in partial mode and toggling of trace
-       ** log. User search now in progress...
+       ** Currently we have scrolling in partial mode, toggling of trace
+       ** log, and pasting. User search now in progress...
        */
     cmd = (LKC_TO_LAC(keymap,c));
     switch (cmd) {
     case LYK_TRACE_TOGGLE :    /*  Toggle TRACE mode. */
        handle_LYK_TRACE_TOGGLE();
        break;
-    default :
+#ifdef CAN_CUT_AND_PASTE
+    case LYK_TO_CLIPBOARD: {  /* ^S */
+       char *s = LYDownLoadAddress();
 
+       if (!s || !*s || put_clip(s))
+           HTInfoMsg("Copy to clipboard failed.");
+       else
+           HTInfoMsg("Download document URL put to clipboard.");
+       break;
+    }
+#endif /* defined CAN_CUT_AND_PASTE */
+    default :
 #ifdef DISP_PARTIAL
        /* OK, we got several lines from new document and want to scroll... */
        if (display_partial && (NumOfLines_partial > 2)) {
--- ./src/LYMainLoop.c-ppre     Mon Feb 17 14:33:40 2003
+++ ./src/LYMainLoop.c  Tue Feb 18 18:13:56 2003
@@ -7873,3 +7873,10 @@ PRIVATE void status_link ARGS3(
        }
     }
 }
+
+PUBLIC char*
+LYDownLoadAddress NOARGS
+{
+    char *s = newdoc.address ? newdoc.address : "";
+    return s;
+}
--- ./src/LYMainLoop.h-ppre     Sun Dec  1 18:07:38 2002
+++ ./src/LYMainLoop.h  Tue Feb 18 17:59:02 2003
@@ -11,6 +11,7 @@ extern int mainloop NOPARAMS;
 extern void HTAddGotoURL PARAMS((char *url));
 extern void LYCloseTracelog NOPARAMS;
 extern BOOL LYMainLoop_pageDisplay PARAMS((int line_num));
+extern char* LYDownLoadAddress PARAMS(());
 extern void LYSetNewline PARAMS((int value));
 extern void handle_LYK_TRACE_TOGGLE NOPARAMS;
 extern void handle_LYK_WHEREIS PARAMS((int cmd, BOOLEAN *refresh_screen));

; To UNSUBSCRIBE: Send "unsubscribe lynx-dev" to address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]