git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@62 3789f03b-4d11-0410-bbf8-ca57d06f2519tags/v0.0.90
@@ -74,6 +74,9 @@ CConn::CConn(Display* dpy_, int argc_, char** argv_, network::Socket* sock_, | |||
} | |||
cp.supportsDesktopResize = true; | |||
cp.supportsLocalCursor = useLocalCursor; | |||
cp.customCompressLevel = customCompressLevel; | |||
cp.compressLevel = compressLevel; | |||
cp.noJpeg = noJpeg; | |||
cp.qualityLevel = qualityLevel; | |||
initMenu(); | |||
@@ -480,6 +483,7 @@ void CConn::menuSelect(long id, TXMenu* m) { | |||
// options dialog's checkboxes. | |||
void CConn::setOptions() { | |||
char digit[2] = "0"; | |||
options.autoSelect.checked(autoSelect); | |||
options.fullColour.checked(fullColour); | |||
options.veryLowColour.checked(!fullColour && lowColourLevel == 0); | |||
@@ -489,6 +493,14 @@ void CConn::setOptions() { | |||
options.zrle.checked(currentEncoding == encodingZRLE); | |||
options.hextile.checked(currentEncoding == encodingHextile); | |||
options.raw.checked(currentEncoding == encodingRaw); | |||
options.customCompressLevel.checked(customCompressLevel); | |||
digit[0] = '0' + compressLevel; | |||
options.compressLevel.setText(digit); | |||
options.noJpeg.checked(!noJpeg); | |||
digit[0] = '0' + qualityLevel; | |||
options.qualityLevel.setText(digit); | |||
options.viewOnly.checked(viewOnly); | |||
options.acceptClipboard.checked(acceptClipboard); | |||
options.sendClipboard.checked(sendClipboard); | |||
@@ -523,6 +535,12 @@ void CConn::getOptions() { | |||
currentEncoding = newEncoding; | |||
encodingChange = true; | |||
} | |||
customCompressLevel.setParam(options.customCompressLevel.checked()); | |||
compressLevel.setParam(options.compressLevel.getText()); | |||
noJpeg.setParam(!options.noJpeg.checked()); | |||
qualityLevel.setParam(options.qualityLevel.getText()); | |||
viewOnly.setParam(options.viewOnly.checked()); | |||
acceptClipboard.setParam(options.acceptClipboard.checked()); | |||
sendClipboard.setParam(options.sendClipboard.checked()); |
@@ -36,10 +36,10 @@ public: | |||
}; | |||
class OptionsDialog : public TXDialog, public TXButtonCallback, | |||
public TXCheckboxCallback { | |||
public TXCheckboxCallback, public TXEntryCallback { | |||
public: | |||
OptionsDialog(Display* dpy, OptionsDialogCallback* cb_) | |||
: TXDialog(dpy, 400, 400, "VNC Viewer: Connection Options"), cb(cb_), | |||
: TXDialog(dpy, 400, 450, "VNC Viewer: Connection Options"), cb(cb_), | |||
formatAndEnc(dpy, "Encoding and Colour Level:", this), | |||
inputs(dpy, "Inputs:", this), | |||
misc(dpy, "Misc:", this), | |||
@@ -52,6 +52,12 @@ public: | |||
zrle(dpy, "ZRLE", this, true, this), | |||
hextile(dpy, "Hextile", this, true, this), | |||
raw(dpy, "Raw", this, true, this), | |||
customCompressLevel(dpy, "Custom compression level:", this, false, this), | |||
compressLevel(dpy, this, this, false, 30), | |||
compressLevelLabel(dpy, "level (1=fast, 9=best)", this), | |||
noJpeg(dpy, "Allow JPEG compression:", this, false, this), | |||
qualityLevel(dpy, this, this, false, 30), | |||
qualityLevelLabel(dpy, "quality (1=poor, 9=best)", this), | |||
viewOnly(dpy, "View only (ignore mouse & keyboard)", this, false, this), | |||
acceptClipboard(dpy, "Accept clipboard from server", this, false, this), | |||
sendClipboard(dpy, "Send clipboard to server", this, false, this), | |||
@@ -81,7 +87,19 @@ public: | |||
veryLowColour.move(x2, y); | |||
y += hextile.height(); | |||
raw.move(xPad, y); | |||
y += raw.height(); | |||
y += raw.height() + yPad; | |||
customCompressLevel.move(xPad, y); | |||
y += customCompressLevel.height(); | |||
compressLevel.move(xPad*10, y); | |||
compressLevelLabel.move(xPad*20, y); | |||
y += compressLevel.height(); | |||
noJpeg.move(xPad, y); | |||
y += noJpeg.height(); | |||
qualityLevel.move(xPad*10, y); | |||
qualityLevelLabel.move(xPad*20, y); | |||
y += qualityLevel.height(); | |||
y += yPad*4; | |||
inputs.move(xPad, y); | |||
@@ -126,6 +144,8 @@ public: | |||
veryLowColour.disabled(autoSelect.checked()); | |||
sendPrimary.disabled(!sendClipboard.checked()); | |||
dotWhenNoCursor.disabled(!useLocalCursor.checked()); | |||
compressLevel.disabled(!customCompressLevel.checked()); | |||
qualityLevel.disabled(!noJpeg.checked()); | |||
} | |||
virtual void takeFocus(Time time) { | |||
@@ -166,14 +186,25 @@ public: | |||
sendPrimary.disabled(!sendClipboard.checked()); | |||
} else if (checkbox == &useLocalCursor) { | |||
dotWhenNoCursor.disabled(!useLocalCursor.checked()); | |||
} else if (checkbox == &customCompressLevel) { | |||
compressLevel.disabled(!customCompressLevel.checked()); | |||
} else if (checkbox == &noJpeg) { | |||
qualityLevel.disabled(!noJpeg.checked()); | |||
} | |||
} | |||
virtual void entryCallback(TXEntry* e, Detail detail, Time time) { | |||
} | |||
OptionsDialogCallback* cb; | |||
TXLabel formatAndEnc, inputs, misc; | |||
TXCheckbox autoSelect; | |||
TXCheckbox fullColour, mediumColour, lowColour, veryLowColour; | |||
TXCheckbox tight, zrle, hextile, raw; | |||
TXCheckbox customCompressLevel; TXEntry compressLevel; TXLabel compressLevelLabel; | |||
TXCheckbox noJpeg; TXEntry qualityLevel; TXLabel qualityLevelLabel; | |||
TXCheckbox viewOnly, acceptClipboard, sendClipboard, sendPrimary; | |||
TXCheckbox shared, fullScreen, useLocalCursor, dotWhenNoCursor; | |||
TXButton okButton, cancelButton; |
@@ -37,6 +37,9 @@ extern rfb::BoolParameter sendClipboard; | |||
extern rfb::BoolParameter sendPrimary; | |||
extern rfb::BoolParameter fullScreen; | |||
extern rfb::StringParameter geometry; | |||
extern rfb::BoolParameter customCompressLevel; | |||
extern rfb::IntParameter compressLevel; | |||
extern rfb::BoolParameter noJpeg; | |||
extern rfb::IntParameter qualityLevel; | |||
extern char aboutText[]; |
@@ -91,10 +91,23 @@ BoolParameter listenMode("listen", "Listen for connections from VNC servers", | |||
StringParameter geometry("geometry", "X geometry specification", ""); | |||
StringParameter displayname("display", "The X display", ""); | |||
BoolParameter customCompressLevel("CustomCompressLevel", | |||
"Use custom compression level", | |||
false); | |||
IntParameter compressLevel("CompressLevel", | |||
"Use specified compression level" | |||
"0 = Low, 9 = High", | |||
6); | |||
BoolParameter noJpeg("NoJPEG", | |||
"Disable lossy JPEG compression in Tight encoding.", | |||
false); | |||
IntParameter qualityLevel("QualityLevel", | |||
"JPEG quality level. " | |||
"0 = Low, 9 = High", | |||
5); | |||
6); | |||
char aboutText[256]; | |||
char* programName; |