summaryrefslogtreecommitdiffstats
path: root/vncviewer/OptionsDialog.cxx
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2011-05-16 12:46:51 +0000
committerPierre Ossman <ossman@cendio.se>2011-05-16 12:46:51 +0000
commit61fd486451639c282f47d8ff58d22c7a8344703b (patch)
tree2bed2c65c6d2ad4d33de7de60ab98b6af52d0c87 /vncviewer/OptionsDialog.cxx
parente5fe0701176438e373ca283cc0d08fe8e6ba8255 (diff)
downloadtigervnc-61fd486451639c282f47d8ff58d22c7a8344703b.tar.gz
tigervnc-61fd486451639c282f47d8ff58d22c7a8344703b.zip
Implement support for storing settings from the options dialog.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4419 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'vncviewer/OptionsDialog.cxx')
-rw-r--r--vncviewer/OptionsDialog.cxx81
1 files changed, 81 insertions, 0 deletions
diff --git a/vncviewer/OptionsDialog.cxx b/vncviewer/OptionsDialog.cxx
index 4c9e0880..f69a2998 100644
--- a/vncviewer/OptionsDialog.cxx
+++ b/vncviewer/OptionsDialog.cxx
@@ -16,6 +16,8 @@
* USA.
*/
+#include <stdlib.h>
+
#include <list>
#include <FL/Fl_Tabs.H>
@@ -252,6 +254,85 @@ void OptionsDialog::loadOptions(void)
void OptionsDialog::storeOptions(void)
{
+ /* Compression */
+ autoSelect.setParam(autoselectCheckbox->value());
+
+ if (tightButton->value())
+ preferredEncoding.setParam(encodingName(encodingTight));
+ else if (zrleButton->value())
+ preferredEncoding.setParam(encodingName(encodingZRLE));
+ else if (hextileButton->value())
+ preferredEncoding.setParam(encodingName(encodingHextile));
+ else if (rawButton->value())
+ preferredEncoding.setParam(encodingName(encodingRaw));
+
+ fullColour.setParam(fullcolorCheckbox->value());
+ if (mediumcolorCheckbox->value())
+ lowColourLevel.setParam(0);
+ else if (lowcolorCheckbox->value())
+ lowColourLevel.setParam(1);
+ else if (verylowcolorCheckbox->value())
+ lowColourLevel.setParam(2);
+
+ customCompressLevel.setParam(compressionCheckbox->value());
+ noJpeg.setParam(!jpegCheckbox->value());
+ compressLevel.setParam(atoi(compressionInput->value()));
+ qualityLevel.setParam(atoi(jpegInput->value()));
+
+#ifdef HAVE_GNUTLS
+ /* Security */
+ Security security;
+
+ /* Process security types which don't use encryption */
+ if (encNoneCheckbox->value()) {
+ if (authNoneCheckbox->value())
+ security.EnableSecType(secTypeNone);
+ if (authVncCheckbox->value())
+ security.EnableSecType(secTypeVncAuth);
+
+ if (vencryptCheckbox->value()) {
+ if (authPlainCheckbox->value())
+ security.EnableSecType(secTypePlain);
+ }
+ }
+
+ if (vencryptCheckbox->value()) {
+ /* Process security types which use TLS encryption */
+ if (encTLSCheckbox->value()) {
+ if (authNoneCheckbox->value())
+ security.EnableSecType(secTypeTLSNone);
+ if (authVncCheckbox->value())
+ security.EnableSecType(secTypeTLSVnc);
+ if (authPlainCheckbox->value())
+ security.EnableSecType(secTypeTLSPlain);
+ }
+
+ /* Process security types which use X509 encryption */
+ if (encX509Checkbox->value()) {
+ if (authNoneCheckbox->value())
+ security.EnableSecType(secTypeX509None);
+ if (authVncCheckbox->value())
+ security.EnableSecType(secTypeX509Vnc);
+ if (authPlainCheckbox->value())
+ security.EnableSecType(secTypeX509Plain);
+ }
+ }
+
+ CSecurityTLS::x509ca.setParam(caInput->value());
+ CSecurityTLS::x509crl.setParam(crlInput->value());
+#endif
+
+ /* Input */
+ viewOnly.setParam(viewOnlyCheckbox->value());
+ acceptClipboard.setParam(acceptClipboardCheckbox->value());
+ sendClipboard.setParam(sendClipboardCheckbox->value());
+ sendPrimary.setParam(sendPrimaryCheckbox->value());
+
+ /* Misc. */
+ shared.setParam(sharedCheckbox->value());
+ fullScreen.setParam(fullScreenCheckbox->value());
+ useLocalCursor.setParam(localCursorCheckbox->value());
+ dotWhenNoCursor.setParam(dotCursorCheckbox->value());
}