]> source.dussan.org Git - tigervnc.git/commitdiff
[java client] improve gui set/get methods for compression & quality levels.
authorBrian Hinz <bphinz@users.sourceforge.net>
Sat, 28 May 2011 14:24:19 +0000 (14:24 +0000)
committerBrian Hinz <bphinz@users.sourceforge.net>
Sat, 28 May 2011 14:24:19 +0000 (14:24 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4456 3789f03b-4d11-0410-bbf8-ca57d06f2519

java/src/com/tigervnc/vncviewer/CConn.java
java/src/com/tigervnc/vncviewer/OptionsDialog.java

index 5e2e51ee4961e781eddb462cb71aa61627685ec5..28b5d295087307ad96d08a6ef0e113f62fcf0d55 100644 (file)
@@ -659,10 +659,10 @@ public class CConn extends CConnection
 \r
     options.customCompressLevel.setSelected(viewer.customCompressLevel.getValue());\r
     digit = 0 + viewer.compressLevel.getValue();\r
-    options.compressLevel.setSelectedIndex(digit);\r
+    options.compressLevel.setSelectedItem(digit);\r
     options.noJpeg.setSelected(!viewer.noJpeg.getValue());\r
     digit = 0 + viewer.qualityLevel.getValue();\r
-    options.qualityLevel.setSelectedIndex(digit);\r
+    options.qualityLevel.setSelectedItem(digit);\r
 \r
     options.viewOnly.setSelected(viewer.viewOnly.getValue());\r
     options.acceptClipboard.setSelected(viewer.acceptClipboard.getValue());\r
@@ -784,7 +784,7 @@ public class CConn extends CConnection
       cp.customCompressLevel = viewer.customCompressLevel.getValue();\r
       encodingChange = true;\r
     }\r
-    viewer.compressLevel.setParam(Integer.toString(options.compressLevel.getSelectedIndex()));\r
+    viewer.compressLevel.setParam(options.compressLevel.getSelectedItem().toString());\r
     if (cp.compressLevel != viewer.compressLevel.getValue()) {\r
       cp.compressLevel = viewer.compressLevel.getValue();\r
       encodingChange = true;\r
@@ -794,7 +794,7 @@ public class CConn extends CConnection
       cp.noJpeg = viewer.noJpeg.getValue();\r
       encodingChange = true;\r
     }\r
-    viewer.qualityLevel.setParam(Integer.toString(options.qualityLevel.getSelectedIndex()));\r
+    viewer.qualityLevel.setParam(options.qualityLevel.getSelectedItem().toString());\r
     if (cp.qualityLevel != viewer.qualityLevel.getValue()) {\r
       cp.qualityLevel = viewer.qualityLevel.getValue();\r
       encodingChange = true;\r
index 7e1828e7236df371a24b58a59f7893692dd3f3b9..b38c00c5eacb7206b02443813c8ea4444942bfe6 100644 (file)
@@ -87,12 +87,12 @@ class OptionsDialog extends Dialog implements
     JPanel tightPanel = new JPanel(new GridBagLayout());\r
     customCompressLevel = new JCheckBox("Custom Compression Level");\r
     customCompressLevel.addItemListener(this);\r
-    String[] compressionLevels = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };\r
+    Object[] compressionLevels = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };\r
     compressLevel  = new JComboBox(compressionLevels);\r
     JLabel compressionLabel = new JLabel("Level (1=fast, 9=best)");\r
     noJpeg = new JCheckBox("Allow JPEG Compression");\r
     noJpeg.addItemListener(this);\r
-    String[] qualityLevels = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };\r
+    Object[] qualityLevels = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };\r
     qualityLevel  = new JComboBox(qualityLevels);\r
     JLabel qualityLabel = new JLabel("Level (1=poor, 9=best)");\r
     addGBComponent(customCompressLevel, tightPanel, 0, 0, 2, 1, 2, 2, 1, 0, GridBagConstraints.HORIZONTAL, GridBagConstraints.FIRST_LINE_START, new Insets(0,2,0,0));\r