]> source.dussan.org Git - tigervnc.git/commitdiff
[Development] Preserve SecurityTypes value during "reconnect" in Win vncviewer.
authorAdam Tkac <atkac@redhat.com>
Wed, 8 Dec 2010 13:48:29 +0000 (13:48 +0000)
committerAdam Tkac <atkac@redhat.com>
Wed, 8 Dec 2010 13:48:29 +0000 (13:48 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4217 3789f03b-4d11-0410-bbf8-ca57d06f2519

win/vncviewer/CConnOptions.cxx
win/vncviewer/CConnOptions.h
win/vncviewer/OptionsDialog.cxx

index 2f889dd0b1405cea9a8dad816a61fa9d020791b3..f4085b4d84c7892ec0ec5c4d323f5c00ab8bab19 100644 (file)
@@ -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 @@ noJpeg(::noJpeg),
 qualityLevel(::qualityLevel),
 passwordFile(::passwordFile.getData())
 {
+  char *sectypes;
+
   if (autoSelect) {
     preferredEncoding = encodingTight;
   } else {
@@ -176,6 +179,10 @@ passwordFile(::passwordFile.getData())
     // Default to CustomCompressLevel=1 if CompressLevel is used.
     customCompressLevel = ::compressLevel.hasBeenSet();
   }
+
+  sectypes = SecurityClient::secTypes.getDefaultStr();
+  secTypes = parseSecTypes(sectypes);
+  delete [] sectypes;
 }
 
 
@@ -298,6 +305,8 @@ void CConnOptions::readFromFile(const char* filename) {
             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 @@ void CConnOptions::writeToFile(const char* filename) {
     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);
index d010d172b61d0e3903010539885bcc361a9e5e9c..76f0d68ef3ae987591c1338ccea1d63ce382ec72 100644 (file)
 #ifndef __RFB_WIN32_CCONN_OPTIONS_H__
 #define __RFB_WIN32_CCONN_OPTIONS_H__
 
+#include <rdr/types.h>
 #include <rfb/Password.h>
 
+#include <list>
+
 namespace rfb {
 
   namespace win32 {
@@ -69,6 +72,7 @@ namespace rfb {
       bool acceptBell;
       bool autoScaling;
       int scale;
+      std::list<rdr::U32> secTypes;
       CharArray userName;
       void setUserName(const char* user);
       PlainPasswd password;
index abdd921cca9deea2650408939684a5648b0e793c..c7188e132f5d30423fa4e826afe5b464fdc5a265 100644 (file)
@@ -431,6 +431,13 @@ public:
     }
   }
 
+  virtual bool onOk() {
+    dlg->options.secTypes = security->GetEnabledExtSecTypes();
+    if (isItemChecked(IDC_VENCRYPT))
+      dlg->options.secTypes.push_front(secTypeVeNCrypt);
+    return true;
+  }
+
   virtual bool onCommand(int id, int cmd) {
     switch (id) {
     case IDC_VENCRYPT: