diff options
author | Brian P. Hinz <bphinz@users.sf.net> | 2016-08-27 17:33:04 -0400 |
---|---|---|
committer | Brian P. Hinz <bphinz@users.sf.net> | 2016-08-27 17:33:04 -0400 |
commit | c456387fe1ed922c5bfb5daf0e780f0000cab2fb (patch) | |
tree | 269a8b95eff08344098afdf89a511ce443ec2bf1 /java/com/tigervnc/rfb/Security.java | |
parent | da33c36638482d014996a3d99c90e2781304cebb (diff) | |
download | tigervnc-c456387fe1ed922c5bfb5daf0e780f0000cab2fb.tar.gz tigervnc-c456387fe1ed922c5bfb5daf0e780f0000cab2fb.zip |
Make all viewer parameters static. Viewer instances are isolated from each other by spawning a completely new process for each viewer, rather than simply starting a new thread. All dialogs were redesigned to better match the look of the native viewer, and also to be more tolerant of sizing differences between platforms.
Diffstat (limited to 'java/com/tigervnc/rfb/Security.java')
-rw-r--r-- | java/com/tigervnc/rfb/Security.java | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/java/com/tigervnc/rfb/Security.java b/java/com/tigervnc/rfb/Security.java index a68ae3e9..e256e6eb 100644 --- a/java/com/tigervnc/rfb/Security.java +++ b/java/com/tigervnc/rfb/Security.java @@ -60,6 +60,8 @@ public class Security { public static final int secResultFailed = 1; public static final int secResultTooMany = 2; // deprecated + public Security() { } + public Security(StringParameter secTypes) { String secTypesStr; @@ -70,9 +72,9 @@ public class Security { secTypesStr = null; } - public static List<Integer> enabledSecTypes = new ArrayList<Integer>(); + private List<Integer> enabledSecTypes = new ArrayList<Integer>(); - public static final List<Integer> GetEnabledSecTypes() + public final List<Integer> GetEnabledSecTypes() { List<Integer> result = new ArrayList<Integer>(); @@ -98,7 +100,7 @@ public class Security { return (result); } - public static final List<Integer> GetEnabledExtSecTypes() + public final List<Integer> GetEnabledExtSecTypes() { List<Integer> result = new ArrayList<Integer>(); @@ -111,7 +113,7 @@ public class Security { return (result); } - public static final void EnableSecType(int secType) + public final void EnableSecType(int secType) { for (Iterator<Integer> i = enabledSecTypes.iterator(); i.hasNext(); ) @@ -134,7 +136,29 @@ public class Security { return false; } - public static void DisableSecType(int secType) { enabledSecTypes.remove((Object)secType); } + public String ToString() + { + Iterator<Integer> i; + String out = new String(""); + boolean firstpass = true; + String name; + + for (i = enabledSecTypes.iterator(); i.hasNext(); ) { + name = secTypeName((Integer)i.next()); + if (name.startsWith("[")) /* Unknown security type */ + continue; + + if (!firstpass) + out = out.concat(","); + else + firstpass = false; + out = out.concat(name); + } + + return out; + } + + public void DisableSecType(int secType) { enabledSecTypes.remove((Object)secType); } public static int secTypeNum(String name) { if (name.equalsIgnoreCase("None")) return secTypeNone; @@ -203,7 +227,9 @@ public class Security { return (result); } - public final void SetSecTypes(List<Integer> secTypes) { enabledSecTypes = secTypes; } + public final void SetSecTypes(List<Integer> secTypes) { + enabledSecTypes = secTypes; + } static LogWriter vlog = new LogWriter("Security"); } |