AutoSelect if default only if not using PreferredEncoding or FullColor.
CustomCompressLevel is default if CompressLevel is specified.

This gives backwards compatibility with the old vncviewer, but at the
same time making it possible to fully specify the internal state of
the viewer wrt AutoSelect, CustomCompressLevel and CompressLevel. For
example, it's now possible to start the client with CompressLevel=4
specified, but with CustomCompressLevel=0 (thus the option
grayed-out).


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@79 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/rfb/Configuration.cxx b/rfb/Configuration.cxx
index 048fb77..fc68210 100644
--- a/rfb/Configuration.cxx
+++ b/rfb/Configuration.cxx
@@ -67,6 +67,7 @@
         strncasecmp(current->getName(), name, len) == 0)
     {
       bool b = current->setParam(val);
+      current->setHasBeenSet(); 
       if (b && immutable)
         current->setImmutable();
       return b;
@@ -91,6 +92,7 @@
     while (current) {
       if (strcasecmp(current->getName(), config) == 0) {
         bool b = current->setParam();
+	current->setHasBeenSet(); 
         if (b && immutable)
           current->setImmutable();
         return b;
@@ -152,7 +154,7 @@
 // -=- VoidParameter
 
 VoidParameter::VoidParameter(const char* name_, const char* desc_)
-  : immutable(false), name(name_), description(desc_) {
+  : immutable(false), _hasBeenSet(false), name(name_), description(desc_) {
   _next = Configuration::head;
   Configuration::head = this;
 }
@@ -184,6 +186,16 @@
   immutable = true;
 }
 
+void
+VoidParameter::setHasBeenSet() {
+  _hasBeenSet = true;
+} 
+
+bool
+VoidParameter::hasBeenSet() {
+  return _hasBeenSet;
+}
+
 // -=- AliasParameter
 
 AliasParameter::AliasParameter(const char* name_, const char* desc_,