From: Brian Hinz Date: Sat, 28 May 2011 14:24:19 +0000 (+0000) Subject: [java client] improve gui set/get methods for compression & quality levels. X-Git-Tag: v1.1.90~322 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d790715df1cc503c7e07e13c9dfe5edec2304fa5;p=tigervnc.git [java client] improve gui set/get methods for compression & quality levels. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4456 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- diff --git a/java/src/com/tigervnc/vncviewer/CConn.java b/java/src/com/tigervnc/vncviewer/CConn.java index 5e2e51ee..28b5d295 100644 --- a/java/src/com/tigervnc/vncviewer/CConn.java +++ b/java/src/com/tigervnc/vncviewer/CConn.java @@ -659,10 +659,10 @@ public class CConn extends CConnection options.customCompressLevel.setSelected(viewer.customCompressLevel.getValue()); digit = 0 + viewer.compressLevel.getValue(); - options.compressLevel.setSelectedIndex(digit); + options.compressLevel.setSelectedItem(digit); options.noJpeg.setSelected(!viewer.noJpeg.getValue()); digit = 0 + viewer.qualityLevel.getValue(); - options.qualityLevel.setSelectedIndex(digit); + options.qualityLevel.setSelectedItem(digit); options.viewOnly.setSelected(viewer.viewOnly.getValue()); options.acceptClipboard.setSelected(viewer.acceptClipboard.getValue()); @@ -784,7 +784,7 @@ public class CConn extends CConnection cp.customCompressLevel = viewer.customCompressLevel.getValue(); encodingChange = true; } - viewer.compressLevel.setParam(Integer.toString(options.compressLevel.getSelectedIndex())); + viewer.compressLevel.setParam(options.compressLevel.getSelectedItem().toString()); if (cp.compressLevel != viewer.compressLevel.getValue()) { cp.compressLevel = viewer.compressLevel.getValue(); encodingChange = true; @@ -794,7 +794,7 @@ public class CConn extends CConnection cp.noJpeg = viewer.noJpeg.getValue(); encodingChange = true; } - viewer.qualityLevel.setParam(Integer.toString(options.qualityLevel.getSelectedIndex())); + viewer.qualityLevel.setParam(options.qualityLevel.getSelectedItem().toString()); if (cp.qualityLevel != viewer.qualityLevel.getValue()) { cp.qualityLevel = viewer.qualityLevel.getValue(); encodingChange = true; diff --git a/java/src/com/tigervnc/vncviewer/OptionsDialog.java b/java/src/com/tigervnc/vncviewer/OptionsDialog.java index 7e1828e7..b38c00c5 100644 --- a/java/src/com/tigervnc/vncviewer/OptionsDialog.java +++ b/java/src/com/tigervnc/vncviewer/OptionsDialog.java @@ -87,12 +87,12 @@ class OptionsDialog extends Dialog implements JPanel tightPanel = new JPanel(new GridBagLayout()); customCompressLevel = new JCheckBox("Custom Compression Level"); customCompressLevel.addItemListener(this); - String[] compressionLevels = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; + Object[] compressionLevels = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }; compressLevel = new JComboBox(compressionLevels); JLabel compressionLabel = new JLabel("Level (1=fast, 9=best)"); noJpeg = new JCheckBox("Allow JPEG Compression"); noJpeg.addItemListener(this); - String[] qualityLevels = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; + Object[] qualityLevels = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }; qualityLevel = new JComboBox(qualityLevels); JLabel qualityLabel = new JLabel("Level (1=poor, 9=best)"); addGBComponent(customCompressLevel, tightPanel, 0, 0, 2, 1, 2, 2, 1, 0, GridBagConstraints.HORIZONTAL, GridBagConstraints.FIRST_LINE_START, new Insets(0,2,0,0));