]> source.dussan.org Git - tigervnc.git/commitdiff
added option to disable system bell. added missing callback for setting options dialo...
authorBrian Hinz <bphinz@users.sourceforge.net>
Thu, 18 Aug 2011 04:47:09 +0000 (04:47 +0000)
committerBrian Hinz <bphinz@users.sourceforge.net>
Thu, 18 Aug 2011 04:47:09 +0000 (04:47 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4637 3789f03b-4d11-0410-bbf8-ca57d06f2519

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

index 27f9dc60cef5d6ec70e0cf7aa2a8275d6ac410f3..c715514ff93550b3e70ba2bca67e84e6550828d8 100644 (file)
@@ -386,7 +386,10 @@ public class CConn extends CConnection
     desktop.setColourMapEntries(firstColour, nColours, rgbs);
   }
 
-  public void bell() { desktop.getToolkit().beep(); }
+  public void bell() { 
+    if (viewer.acceptBell.getValue())
+      desktop.getToolkit().beep(); 
+  }
 
   public void serverCutText(String str, int len) {
     if (viewer.acceptClipboard.getValue())
@@ -790,6 +793,7 @@ public class CConn extends CConnection
     options.fullScreen.setSelected(fullScreen);
     options.useLocalCursor.setSelected(viewer.useLocalCursor.getValue());
     options.fastCopyRect.setSelected(viewer.fastCopyRect.getValue());
+    options.acceptBell.setSelected(viewer.acceptBell.getValue());
   }
 
   public void getOptions() {
@@ -844,6 +848,8 @@ public class CConn extends CConnection
     viewer.viewOnly.setParam(options.viewOnly.isSelected());
     viewer.acceptClipboard.setParam(options.acceptClipboard.isSelected());
     viewer.sendClipboard.setParam(options.sendClipboard.isSelected());
+    viewer.fastCopyRect.setParam(options.fastCopyRect.isSelected());
+    viewer.acceptBell.setParam(options.acceptBell.isSelected());
     clipboardDialog.setSendingEnabled(viewer.sendClipboard.getValue());
     menuKey = (int)(options.menuKey.getSelectedIndex()+0xFFBE);
     F8Menu.f8.setLabel("Send F"+(menuKey-Keysyms.F1+1));
index 9b73cc47c5ce7751c493ed96c97dc3aedeb9c090..6eb290990593dadc1e9bd609df44429b1b625dc3 100644 (file)
@@ -46,7 +46,7 @@ class OptionsDialog extends Dialog implements
   ButtonGroup encodingGroup, colourGroup;
   JRadioButton zrle, hextile, tight, raw;
   JRadioButton fullColour, mediumColour, lowColour, veryLowColour;
-  JCheckBox viewOnly, acceptClipboard, sendClipboard;
+  JCheckBox viewOnly, acceptClipboard, sendClipboard, acceptBell;
   JCheckBox fullScreen, shared, useLocalCursor, fastCopyRect;
   JCheckBox secVeNCrypt, encNone, encTLS, encX509;
   JCheckBox secNone, secVnc, secPlain, secIdent, sendLocalUsername;
@@ -158,10 +158,13 @@ class OptionsDialog extends Dialog implements
     useLocalCursor.addItemListener(this);
     fastCopyRect = new JCheckBox("Fast CopyRect");
     fastCopyRect.addItemListener(this);
+    acceptBell = new JCheckBox("Beep when requested by the server");
+    acceptBell.addItemListener(this);
     addGBComponent(fullScreen,MiscPanel,     0, 0, 1, 1, 0, 0, 1, 0, GridBagConstraints.HORIZONTAL, GridBagConstraints.LINE_START, new Insets(4,4,0,4));
     addGBComponent(shared,MiscPanel,         0, 1, 1, 1, 0, 0, 1, 0, GridBagConstraints.HORIZONTAL, GridBagConstraints.LINE_START, new Insets(4,4,0,4));
     addGBComponent(useLocalCursor,MiscPanel, 0, 2, 1, 1, 0, 0, 1, 0, GridBagConstraints.HORIZONTAL, GridBagConstraints.LINE_START, new Insets(4,4,0,4));
-    addGBComponent(fastCopyRect,MiscPanel,   0, 3, 1, GridBagConstraints.REMAINDER, 0, 0, 1, 1, GridBagConstraints.HORIZONTAL, GridBagConstraints.FIRST_LINE_START, new Insets(4,4,0,4));
+    addGBComponent(fastCopyRect,MiscPanel,   0, 3, 1, 1, 0, 0, 1, 0, GridBagConstraints.HORIZONTAL, GridBagConstraints.LINE_START, new Insets(4,4,0,4));
+    addGBComponent(acceptBell,MiscPanel,     0, 4, 1, GridBagConstraints.REMAINDER, 0, 0, 1, 1, GridBagConstraints.HORIZONTAL, GridBagConstraints.FIRST_LINE_START, new Insets(4,4,0,4));
 
     // load/save tab
     DefaultsPanel=new JPanel(new GridBagLayout());
index 119b6adcac74c09dd34f88922030c89bea8e6e0f..c2b39bfeedc6bf3f3f2316ce07dc3ae66d1a2b36 100644 (file)
@@ -246,6 +246,10 @@ public class VncViewer extends java.applet.Applet implements Runnable
   = new IntParameter("Port",
                          "The VNC server's port number, assuming it is on "+
                          "the host from which the applet was downloaded", 0);
+  BoolParameter acceptBell
+  = new BoolParameter("AcceptBell",
+                      "Produce a system beep when requested to by the server.", 
+                      true);
   BoolParameter customCompressLevel
   = new BoolParameter("CustomCompressLevel",
                           "Use custom compression level. "+