Bläddra i källkod

[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
tags/v1.0.90
Adam Tkac 13 år sedan
förälder
incheckning
3fed5a4ab8
3 ändrade filer med 27 tillägg och 0 borttagningar
  1. 16
    0
      win/vncviewer/CConnOptions.cxx
  2. 4
    0
      win/vncviewer/CConnOptions.h
  3. 7
    0
      win/vncviewer/OptionsDialog.cxx

+ 16
- 0
win/vncviewer/CConnOptions.cxx Visa fil

@@ -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);

+ 4
- 0
win/vncviewer/CConnOptions.h Visa fil

@@ -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;

+ 7
- 0
win/vncviewer/OptionsDialog.cxx Visa fil

@@ -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:

Laddar…
Avbryt
Spara