aboutsummaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorAdam Tkac <atkac@redhat.com>2010-12-08 13:48:29 +0000
committerAdam Tkac <atkac@redhat.com>2010-12-08 13:48:29 +0000
commit3fed5a4ab8e36bf537b32e6680d3a86cbf0f8917 (patch)
tree8a0aca91f0eee0e4dbda8756dd465bde806d043d /win
parent243fd7c5046857f05eb13b646bbafdbe314db09f (diff)
downloadtigervnc-3fed5a4ab8e36bf537b32e6680d3a86cbf0f8917.tar.gz
tigervnc-3fed5a4ab8e36bf537b32e6680d3a86cbf0f8917.zip
[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
Diffstat (limited to 'win')
-rw-r--r--win/vncviewer/CConnOptions.cxx16
-rw-r--r--win/vncviewer/CConnOptions.h4
-rw-r--r--win/vncviewer/OptionsDialog.cxx7
3 files changed, 27 insertions, 0 deletions
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 <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);
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 <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;
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: