Revision: 4217
          http://tigervnc.svn.sourceforge.net/tigervnc/?rev=4217&view=rev
Author:   atkac
Date:     2010-12-08 13:48:29 +0000 (Wed, 08 Dec 2010)

Log Message:
-----------
[Development] Preserve SecurityTypes value during "reconnect" in Win vncviewer.

Modified Paths:
--------------
    trunk/win/vncviewer/CConnOptions.cxx
    trunk/win/vncviewer/CConnOptions.h
    trunk/win/vncviewer/OptionsDialog.cxx

Modified: trunk/win/vncviewer/CConnOptions.cxx
===================================================================
--- trunk/win/vncviewer/CConnOptions.cxx        2010-12-08 13:47:41 UTC (rev 
4216)
+++ trunk/win/vncviewer/CConnOptions.cxx        2010-12-08 13:48:29 UTC (rev 
4217)
@@ -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);

Modified: trunk/win/vncviewer/CConnOptions.h
===================================================================
--- trunk/win/vncviewer/CConnOptions.h  2010-12-08 13:47:41 UTC (rev 4216)
+++ trunk/win/vncviewer/CConnOptions.h  2010-12-08 13:48:29 UTC (rev 4217)
@@ -24,8 +24,11 @@
 #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 @@
       bool acceptBell;
       bool autoScaling;
       int scale;
+      std::list<rdr::U32> secTypes;
       CharArray userName;
       void setUserName(const char* user);
       PlainPasswd password;

Modified: trunk/win/vncviewer/OptionsDialog.cxx
===================================================================
--- trunk/win/vncviewer/OptionsDialog.cxx       2010-12-08 13:47:41 UTC (rev 
4216)
+++ trunk/win/vncviewer/OptionsDialog.cxx       2010-12-08 13:48:29 UTC (rev 
4217)
@@ -431,6 +431,13 @@
     }
   }
 
+  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:


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
What happens now with your Lotus Notes apps - do you make another costly 
upgrade, or settle for being marooned without product support? Time to move
off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
use, and manage than apps on traditional platforms. Sign up for the Lotus 
Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
_______________________________________________
Tigervnc-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tigervnc-commits

Reply via email to