From: Adam Tkac Date: Wed, 8 Dec 2010 13:48:29 +0000 (+0000) Subject: [Development] Preserve SecurityTypes value during "reconnect" in Win vncviewer. X-Git-Tag: v1.0.90~101 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3fed5a4ab8e36bf537b32e6680d3a86cbf0f8917;p=tigervnc.git [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 2f889dd0..f4085b4d 100644 --- a/win/vncviewer/CConnOptions.cxx +++ b/win/vncviewer/CConnOptions.cxx @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -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::iterator i; + for (i = secTypes.begin(); i != secTypes.end(); i++) + fprintf(f, "%s,", secTypeName(*i)); + fprintf(f, "\n"); + fclose(f); f=0; setConfigFileName(filename); diff --git a/win/vncviewer/CConnOptions.h b/win/vncviewer/CConnOptions.h index d010d172..76f0d68e 100644 --- a/win/vncviewer/CConnOptions.h +++ b/win/vncviewer/CConnOptions.h @@ -24,8 +24,11 @@ #ifndef __RFB_WIN32_CCONN_OPTIONS_H__ #define __RFB_WIN32_CCONN_OPTIONS_H__ +#include #include +#include + namespace rfb { namespace win32 { @@ -69,6 +72,7 @@ namespace rfb { bool acceptBell; bool autoScaling; int scale; + std::list secTypes; CharArray userName; void setUserName(const char* user); PlainPasswd password; diff --git a/win/vncviewer/OptionsDialog.cxx b/win/vncviewer/OptionsDialog.cxx index abdd921c..c7188e13 100644 --- a/win/vncviewer/OptionsDialog.cxx +++ b/win/vncviewer/OptionsDialog.cxx @@ -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: