aboutsummaryrefslogtreecommitdiffstats
path: root/java/com/tigervnc/vncviewer/OptionsDialog.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/com/tigervnc/vncviewer/OptionsDialog.java')
-rw-r--r--java/com/tigervnc/vncviewer/OptionsDialog.java54
1 files changed, 44 insertions, 10 deletions
diff --git a/java/com/tigervnc/vncviewer/OptionsDialog.java b/java/com/tigervnc/vncviewer/OptionsDialog.java
index 927fdf21..9c442cbc 100644
--- a/java/com/tigervnc/vncviewer/OptionsDialog.java
+++ b/java/com/tigervnc/vncviewer/OptionsDialog.java
@@ -152,9 +152,11 @@ class OptionsDialog extends Dialog {
/* Misc. */
JCheckBox sharedCheckbox;
- JCheckBox dotWhenNoCursorCheckbox;
+ JCheckBox alwaysCursorCheckbox;
JCheckBox acceptBellCheckbox;
+ JComboBox cursorTypeChoice;
+
/* SSH */
JCheckBox tunnelCheckbox;
JCheckBox viaCheckbox;
@@ -175,7 +177,7 @@ class OptionsDialog extends Dialog {
@SuppressWarnings({"rawtypes","unchecked"})
public OptionsDialog() {
super(true);
- setTitle("VNC viewer options");
+ setTitle("TigerVNC options");
setResizable(false);
getContentPane().setLayout(
@@ -311,6 +313,7 @@ class OptionsDialog extends Dialog {
handleAutoselect();
handleCompression();
handleJpeg();
+ handleAlwaysCursor();
/* Security */
Security security = new Security(SecurityClient.secTypes);
@@ -458,7 +461,9 @@ class OptionsDialog extends Dialog {
/* Misc. */
sharedCheckbox.setSelected(shared.getValue());
- dotWhenNoCursorCheckbox.setSelected(dotWhenNoCursor.getValue());
+ alwaysCursorCheckbox.setSelected(alwaysCursor.getValue());
+ String cursorTypeStr = cursorType.getValueStr();
+ cursorTypeChoice.setSelectedItem(cursorTypeStr);
acceptBellCheckbox.setSelected(acceptBell.getValue());
/* SSH */
@@ -613,8 +618,9 @@ class OptionsDialog extends Dialog {
/* Misc. */
shared.setParam(sharedCheckbox.isSelected());
- dotWhenNoCursor.setParam(dotWhenNoCursorCheckbox.isSelected());
+ alwaysCursor.setParam(alwaysCursorCheckbox.isSelected());
acceptBell.setParam(acceptBellCheckbox.isSelected());
+ cursorType.setParam((String)cursorTypeChoice.getSelectedItem());
/* SSH */
tunnel.setParam(tunnelCheckbox.isSelected());
@@ -1173,31 +1179,54 @@ class OptionsDialog extends Dialog {
MiscPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 0, 5));
sharedCheckbox =
new JCheckBox("Shared (don't disconnect other viewers)");
- dotWhenNoCursorCheckbox = new JCheckBox("Show dot when no cursor");
+ alwaysCursorCheckbox = new JCheckBox("Show local cursor when not provided by server");
+ alwaysCursorCheckbox.addItemListener(new ItemListener() {
+ public void itemStateChanged(ItemEvent e) {
+ handleAlwaysCursor();
+ }
+ });
+ JLabel cursorTypeLabel = new JLabel("Cursor type:");
+ String[] cursorTypes = {"Dot", "System"};
+ cursorTypeChoice = new MyJComboBox(cursorTypes);
+ cursorTypeChoice.setPrototypeDisplayValue("System.");
acceptBellCheckbox = new JCheckBox("Beep when requested by the server");
MiscPanel.add(sharedCheckbox,
new GridBagConstraints(0, 0,
- 1, 1,
+ REMAINDER, 1,
LIGHT, LIGHT,
LINE_START, NONE,
new Insets(0, 0, 4, 0),
NONE, NONE));
- MiscPanel.add(dotWhenNoCursorCheckbox,
+ MiscPanel.add(alwaysCursorCheckbox,
new GridBagConstraints(0, 1,
- 1, 1,
+ REMAINDER, 1,
LIGHT, LIGHT,
LINE_START, NONE,
new Insets(0, 0, 4, 0),
NONE, NONE));
- MiscPanel.add(acceptBellCheckbox,
+ MiscPanel.add(cursorTypeLabel,
new GridBagConstraints(0, 2,
1, 1,
LIGHT, LIGHT,
LINE_START, NONE,
new Insets(0, 0, 4, 0),
NONE, NONE));
- MiscPanel.add(Box.createRigidArea(new Dimension(5, 0)),
+ MiscPanel.add(cursorTypeChoice,
+ new GridBagConstraints(1, 2,
+ 1, 1,
+ LIGHT, LIGHT,
+ LINE_START, NONE,
+ new Insets(0, 5, 4, 0),
+ NONE, NONE));
+ MiscPanel.add(acceptBellCheckbox,
new GridBagConstraints(0, 3,
+ REMAINDER, 1,
+ LIGHT, LIGHT,
+ LINE_START, NONE,
+ new Insets(0, 0, 4, 0),
+ NONE, NONE));
+ MiscPanel.add(Box.createRigidArea(new Dimension(5, 0)),
+ new GridBagConstraints(0, 4,
REMAINDER, REMAINDER,
HEAVY, HEAVY,
LINE_START, BOTH,
@@ -1633,5 +1662,10 @@ class OptionsDialog extends Dialog {
}
}
+ private void handleAlwaysCursor()
+ {
+ cursorTypeChoice.setEnabled(alwaysCursorCheckbox.isSelected());
+ }
+
static LogWriter vlog = new LogWriter("OptionsDialog");
}