[Development] Preserve SecurityTypes value during "reconnect" in Win vncviewer.


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4217 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/win/vncviewer/CConnOptions.cxx b/win/vncviewer/CConnOptions.cxx
index 2f889dd..f4085b4 100644
--- a/win/vncviewer/CConnOptions.cxx
+++ b/win/vncviewer/CConnOptions.cxx
@@ -23,6 +23,7 @@
 #include <rfb/ScaleFilters.h>
 #include <rfb_win32/MsgBox.h>
 #include <rfb_win32/Registry.h>
+#include <rfb/SecurityClient.h>
 #include <rdr/HexInStream.h>
 #include <rdr/HexOutStream.h>
 #include <stdlib.h>
@@ -158,6 +159,8 @@
 qualityLevel(::qualityLevel),
 passwordFile(::passwordFile.getData())
 {
+  char *sectypes;
+
   if (autoSelect) {
     preferredEncoding = encodingTight;
   } else {
@@ -176,6 +179,10 @@
     // Default to CustomCompressLevel=1 if CompressLevel is used.
     customCompressLevel = ::compressLevel.hasBeenSet();
   }
+
+  sectypes = SecurityClient::secTypes.getDefaultStr();
+  secTypes = parseSecTypes(sectypes);
+  delete [] sectypes;
 }
 
 
@@ -298,6 +305,8 @@
             autoScaling = atoi(value.buf);
           } else if (stricmp(name.buf, "Scale") == 0) {
             scale = atoi(value.buf);
+          } else if (stricmp(name.buf, "SecurityTypes") == 0) {
+            secTypes = parseSecTypes(value.buf);
           }
         }
       }
@@ -381,6 +390,13 @@
     fprintf(f, "QualityLevel=%d\n", qualityLevel);
     fprintf(f, "AutoScaling=%d\n", (int)autoScaling);
     fprintf(f, "Scale=%d\n", scale);
+
+    fprintf(f, "SecurityTypes=");
+    std::list<rdr::U32>::iterator i;
+    for (i = secTypes.begin(); i != secTypes.end(); i++)
+      fprintf(f, "%s,", secTypeName(*i));
+    fprintf(f, "\n");
+
     fclose(f); f=0;
 
     setConfigFileName(filename);