diff options
author | Brian Hinz <bphinz@users.sourceforge.net> | 2011-08-18 01:09:19 +0000 |
---|---|---|
committer | Brian Hinz <bphinz@users.sourceforge.net> | 2011-08-18 01:09:19 +0000 |
commit | 849cfbe473a987d34e2e00cc73bfd2173dd36c0f (patch) | |
tree | 563c974f5b3c9ea5f7dedce420a9e6b5abce6ead /java/src/com/tigervnc/vncviewer/CConn.java | |
parent | 12c81df882452e715e0cc1684b81ef347b6508fe (diff) | |
download | tigervnc-849cfbe473a987d34e2e00cc73bfd2173dd36c0f.tar.gz tigervnc-849cfbe473a987d34e2e00cc73bfd2173dd36c0f.zip |
add support for "hidden" compression levels 0,7,8,9 in the gui (JComboBox is now editable). Also addded some sanity checks to make sure only 0-9 can be passed in via the gui or the command line.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4636 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'java/src/com/tigervnc/vncviewer/CConn.java')
-rw-r--r-- | java/src/com/tigervnc/vncviewer/CConn.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/java/src/com/tigervnc/vncviewer/CConn.java b/java/src/com/tigervnc/vncviewer/CConn.java index 2d4276ec..27f9dc60 100644 --- a/java/src/com/tigervnc/vncviewer/CConn.java +++ b/java/src/com/tigervnc/vncviewer/CConn.java @@ -681,7 +681,11 @@ public class CConn extends CConnection options.customCompressLevel.setSelected(viewer.customCompressLevel.getValue()); digit = 0 + viewer.compressLevel.getValue(); - options.compressLevel.setSelectedItem(digit); + if (digit >= 0 && digit <= 9) { + options.compressLevel.setSelectedItem(digit); + } else { + options.compressLevel.setSelectedItem(Integer.parseInt(viewer.compressLevel.getDefaultStr())); + } options.noJpeg.setSelected(!viewer.noJpeg.getValue()); digit = 0 + viewer.qualityLevel.getValue(); options.qualityLevel.setSelectedItem(digit); @@ -815,7 +819,12 @@ public class CConn extends CConnection cp.customCompressLevel = viewer.customCompressLevel.getValue(); encodingChange = true; } - viewer.compressLevel.setParam(options.compressLevel.getSelectedItem().toString()); + if (Integer.parseInt(options.compressLevel.getSelectedItem().toString()) >= 0 && + Integer.parseInt(options.compressLevel.getSelectedItem().toString()) <= 9) { + viewer.compressLevel.setParam(options.compressLevel.getSelectedItem().toString()); + } else { + viewer.compressLevel.setParam(viewer.compressLevel.getDefaultStr()); + } if (cp.compressLevel != viewer.compressLevel.getValue()) { cp.compressLevel = viewer.compressLevel.getValue(); encodingChange = true; |