lynx-dev
[Top][All Lists]
Advanced

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

Re: lynx-dev verbose images option patch


From: Laura Eaves
Subject: Re: lynx-dev verbose images option patch
Date: Sat, 22 Aug 1998 18:28:46 -0400 (EDT)

The patch below includes Leonid's patch for setting verbose images
on the forms options screen.  It also includes code to handle
verbose images on the old options screen.  (I don't know
why I wasted my time on it, since it will probably go away, but
for completeness I thought it should be handled.)

This patch is applied to dev22.

There is only one glitch that I can't seem to figure out.
When I go to the forms options page and set verbose images from ON to OFF,
when I accept the change and return to my web page, the page is
reloaded so images come out [LINE].
But when I do the same thing on the old options page, the page isn't reloaded
automatically.
I'm sure if I stared at this a little longer I might figure out what the
problem is, but figured I'd post the patch now in case someone else more
experienced with this part of the code has an idea.

Let me know if there are other problems.
--le

Index: LYOptions.c
--- old/LYOptions.c     Fri Aug 21 07:30:14 1998
+++ src/LYOptions.c     Sat Aug 22 17:32:21 1998
@@ -321,6 +321,9 @@
       ((user_mode == INTERMEDIATE_MODE) ? "Intermediate" :
                                          "Advanced    "));
 
+    addstr("  verbose images (!) : ");
+    addstr( verbose_img ? "ON " : "OFF" );
+
     move(L_User_Agent, 5);
     addstr("user (A)gent                 : ");
     addstr((LYUserAgent && *LYUserAgent) ? LYUserAgent : "NONE");
@@ -1384,6 +1387,46 @@
                }
                break;
 
+           case '!':
+               /*
+                *  Copy strings into choice array.
+                */
+               choices[0] = NULL;
+               StrAllocCopy(choices[0], "OFF");
+               choices[1] = NULL;
+               StrAllocCopy(choices[1], "ON ");
+               choices[2] = NULL;
+               if (!LYSelectPopups) {
+                   verbose_img = boolean_choice(verbose_img,
+                                               L_VERBOSE_IMAGES,
+                                               C_VERBOSE_IMAGES,
+                                               choices);
+               } else {
+                   verbose_img = popup_choice(verbose_img,
+                                            L_VERBOSE_IMAGES,
+                                            C_VERBOSE_IMAGES,
+                                            choices,
+                                            2, FALSE);
+               }
+               FREE(choices[0]);
+               FREE(choices[1]);
+               response = ' ';
+               if (LYSelectPopups) {
+#if !defined(VMS) || defined(USE_SLANG)
+                   if (term_options) {
+                       term_options = FALSE;
+                   } else {
+                       AddValueAccepted = TRUE;
+                   }
+                   goto draw_options;
+#else
+                   term_options = FALSE;
+                   if (use_assume_charset != old_use_assume_charset)
+                       goto draw_options;
+#endif /* !VMS || USE_SLANG */
+               }
+               break;
+
            case 'a':   /* Change user agent string. */
            case 'A':
                if (!no_useragent) {
@@ -3100,6 +3143,8 @@
 
 static char * show_color_string = "show_color";
 
+static char * verbose_images_string = "verbose_images";
+
 static char * vi_keys_string = "vi_keys";
 
 static char * emacs_keys_string = "emacs_keys";
@@ -3444,6 +3489,13 @@
        }
 
        /*
+        * verbose images mode
+        */
+       if (!strcmp(data[i].tag, verbose_images_string)) {
+           verbose_img = GetOptValues(bool_values, data[i].value);
+       }
+
+       /*
         * vi_keys
         */
        if (!strcmp(data[i].tag, vi_keys_string)) {
@@ -3829,6 +3881,14 @@
     }
     EndSelect(fp0);
 #endif /* USE_SLANG || COLOR_CURSES */
+
+    /*
+     * verbose images mode
+     */
+    PutLabel(fp0, "Verbose images");
+    BeginSelect(fp0, verbose_images_string);
+    PutOptValues(fp0, verbose_img, bool_values);
+    EndSelect(fp0);
 
     /*
      * vi_keys
Index: LYOptions.h
--- old/LYOptions.h     Thu Aug  6 06:28:22 1998
+++ src/LYOptions.h     Fri Aug 21 18:42:57 1998
@@ -69,6 +69,10 @@
 #define L_EXEC         18
 #endif /* DIRED_SUPPORT */
 
+#define L_VERBOSE_IMAGES L_USER_MODE
+#define B_VERBOSE_IMAGES 50
+#define C_VERBOSE_IMAGES (B_VERBOSE_IMAGES + 21)
+
 #endif /* EXP_FORMS_OPTIONS */
 
 #define OPTIONS_TITLE "Lynx Options Configuration"
Index: LYrcFile.c
--- old/LYrcFile.c      Fri Aug 21 07:30:14 1998
+++ src/LYrcFile.c      Fri Aug 21 16:43:01 1998
@@ -515,6 +515,18 @@
                local_exec_on_local_files=FALSE;
 #endif /* ALLOW_USERS_TO_CHANGE_EXEC_WITHIN_OPTIONS */
 
+       } else if ((cp = LYstrstr(line_buffer,
+                                 "verbose_images")) != NULL &&
+                  cp-line_buffer < number_sign) {
+
+          if ((cp2 = (char *)strchr(cp, '=')) != NULL)
+               cp = cp2 + 1;
+          cp = LYSkipBlanks(cp);
+          if (!strncasecomp(cp, "on", 2))
+               verbose_img = 1;
+          else if (!strncasecomp(cp, "off", 3))
+               verbose_img = 0;
+
        } /* end of if */
 
     } /* end of while */
@@ -916,6 +928,13 @@
     fprintf(fp, "run_execution_links_on_local_files=%s\n\n",
                (local_exec_on_local_files ? "on" : "off"));
 #endif /* defined(EXEC_LINKS) || defined(EXEC_SCRIPTS) */
+
+    fprintf(fp, "\
+# If verbose_images is \"on\", lynx will print the name of the image\n\
+# source file in place of [INLINE], [LINK] or [IMAGE]\n\
+# See also VERBOSE_IMAGES in lynx.cfg\n");
+    fprintf(fp, "verbose_images=%s\n\n",
+               verbose_img ? "on" : "off");
 
     /*
      *  Close the RC file.

reply via email to

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