Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added "Hide End of Stream Error" option #199

Merged
merged 3 commits into from
Jul 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion vncviewer/ClientConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2511,7 +2511,7 @@ void ClientConnection::NegotiateProtocolVersion()
"- Another viewer using a DSMPlugin is already connected to the Server (more than one is forbidden)\r\n"
,1003
);
else
else if (!m_pApp->m_options.m_HideEndOfStreamError)
throw WarningException("Connection failed - End of Stream\r\n\r\n"
"Possible causes:\r\r"
"- Another user is already listening on this ID\r\n"
Expand Down
2 changes: 2 additions & 0 deletions vncviewer/SessionDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ SessionDialog::SessionDialog(VNCOptions* pOpt, ClientConnection* pCC, CDSMPlugin
restricted = m_pOpt->m_restricted;
AllowUntrustedServers = m_pOpt->m_AllowUntrustedServers;
NoStatus = m_pOpt->m_NoStatus;
HideEndOfStreamError = m_pOpt->m_HideEndOfStreamError;
NoHotKeys = m_pOpt->m_NoHotKeys;
setdefaults = false;
/////////////////////////////////////////////////
Expand Down Expand Up @@ -699,6 +700,7 @@ bool SessionDialog::connect(HWND hwnd)
m_pOpt->m_restricted = restricted;
m_pOpt->m_AllowUntrustedServers = AllowUntrustedServers;
m_pOpt->m_NoStatus = NoStatus;
m_pOpt->m_HideEndOfStreamError = HideEndOfStreamError;
m_pOpt->m_NoHotKeys = NoHotKeys;

if (fUseDSMPlugin) {
Expand Down
1 change: 1 addition & 0 deletions vncviewer/SessionDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ class SessionDialog
bool restricted;
bool AllowUntrustedServers;
bool NoStatus;
bool HideEndOfStreamError;
bool NoHotKeys;
bool setdefaults;
bool connect(HWND hwnd);
Expand Down
7 changes: 7 additions & 0 deletions vncviewer/SessionDialogTabs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -940,6 +940,8 @@ void SessionDialog::InitDlgProcMisc()
SetDlgItemText(hwnd, IDC_PREFIX, prefix);
HWND hNoStatus = GetDlgItem(hwnd, IDC_HIDESTATUS);
SendMessage(hNoStatus, BM_SETCHECK, NoStatus, 0);
HWND hHideEndOfStreamError = GetDlgItem(hwnd, IDC_HIDEENDOFSTREAMERROR);
SendMessage(hHideEndOfStreamError, BM_SETCHECK, HideEndOfStreamError, 0);
HWND hcomboscreen = GetDlgItem(hwnd, IDC_IMAGEFORMAT);
SendMessage(hcomboscreen, CB_RESETCONTENT, 0, 0);
SendMessage(hcomboscreen, CB_ADDSTRING, 0, (LPARAM)".jpeg");
Expand Down Expand Up @@ -1205,6 +1207,10 @@ void SessionDialog::ReadDlgProcMisc()

HWND hNoStatus = GetDlgItem(hwnd, IDC_HIDESTATUS);
NoStatus = (SendMessage(hNoStatus, BM_GETCHECK, 0, 0) == BST_CHECKED);

HWND hHideEndOfStreamError = GetDlgItem(hwnd, IDC_HIDEENDOFSTREAMERROR);
HideEndOfStreamError = (SendMessage(hHideEndOfStreamError, BM_GETCHECK, 0, 0) == BST_CHECKED);

GetDlgItemText(hwnd, IDC_IMAGEFORMAT, imageFormat, 56);
}
////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -1562,6 +1568,7 @@ void SessionDialog::StartListener()
m_pOpt->m_restricted = restricted;
m_pOpt->m_AllowUntrustedServers = AllowUntrustedServers;
m_pOpt->m_NoStatus = NoStatus;
m_pOpt->m_HideEndOfStreamError = HideEndOfStreamError;
m_pOpt->m_NoHotKeys = NoHotKeys;
#ifdef _Gii
m_pOpt->m_giiEnable = giiEnable;
Expand Down
10 changes: 9 additions & 1 deletion vncviewer/VNCOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,9 @@ VNCOptions::VNCOptions()
m_keepAliveInterval = KEEPALIVE_INTERVAL;
m_IdleInterval = 0;
m_throttleMouse = 0; // adzm 2010-10

m_HideEndOfStreamError = false;

setDefaultOptionsFileName(m_optionfile);
LoadOptions(getDefaultOptionsFileName());
}
Expand Down Expand Up @@ -607,6 +610,9 @@ void VNCOptions::SetFromCommandLine(LPTSTR szCmdLine) {
else if (SwitchMatch(args[j], _T("nostatus"))) {
m_NoStatus = true;
}
else if (SwitchMatch(args[j], _T("hideendofstreamerror"))) {
m_HideEndOfStreamError = true;
}
else if (SwitchMatch(args[j], _T("nohotkeys"))) {
m_NoHotKeys = true;
}
Expand Down Expand Up @@ -1140,6 +1146,7 @@ void VNCOptions::SaveOptions(char* fname)
saveInt("AllowUntrustedServers", m_AllowUntrustedServers, fname);
saveInt("viewonly", m_ViewOnly, fname);
saveInt("nostatus", m_NoStatus, fname);
saveInt("HideEOStreamError", m_HideEndOfStreamError, fname);
saveInt("nohotkeys", m_NoHotKeys, fname);
saveInt("showtoolbar", m_ShowToolbar, fname);
saveInt("fullscreen", m_FullScreen, fname);
Expand Down Expand Up @@ -1236,6 +1243,7 @@ void VNCOptions::LoadOptions(char* fname)
m_AllowUntrustedServers = readInt("AllowUntrustedServers", m_AllowUntrustedServers, fname) != 0;
m_ViewOnly = readInt("viewonly", m_ViewOnly, fname) != 0;
m_NoStatus = readInt("nostatus", m_NoStatus, fname) != 0;
m_HideEndOfStreamError = readInt("HideEOStreamError", m_HideEndOfStreamError, fname) != 0;
m_NoHotKeys = readInt("nohotkeys", m_NoHotKeys, fname) != 0;
m_ShowToolbar = readInt("showtoolbar", m_ShowToolbar, fname) != 0;
m_FullScreen = readInt("fullscreen", m_FullScreen, fname) != 0;
Expand Down Expand Up @@ -1350,7 +1358,7 @@ void VNCOptions::ShowUsage(LPTSTR info) {
" [/encodings xz zrle ...] (in order of priority)\r\n"
" [/autoacceptincoming] [/autoacceptnodsm] [/disablesponsor][/InfoMsg \"Messages need quotes\"]\r\n" //adzm 2009-06-21, adzm 2009-07-19
" [/requireencryption] [/enablecache] [/throttlemouse n] [/socketkeepalivetimeout n]\r\n" //adzm 2010-05-12
" [/gnome]\r\n"
" [/gnome] [/hideendofstreamerror]\r\n"
"For full details see documentation."),
tmpinf);
yesUVNCMessageBox(NULL, msg, sz_A2, MB_ICONINFORMATION);
Expand Down
2 changes: 2 additions & 0 deletions vncviewer/VNCOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ class VNCOptions
char m_InfoMsg[255]{ 0 };
char m_ClassName[255]{ 0 };

bool m_HideEndOfStreamError;

private:
void ShowUsage(LPTSTR info = NULL);
void FixScaling();
Expand Down
1 change: 1 addition & 0 deletions vncviewer/res/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@
#define IDC_PREFIX 1184
#define IDC_RADIO3 1185
#define IDC_RADIO_NOVIRT 1185
#define IDC_HIDEENDOFSTREAMERROR 1186
#define IDC_ENCODING_BASE 1199
#define IDC_RAWRADIO 2000
#define IDC_RRERADIO 2002
Expand Down
1 change: 1 addition & 0 deletions vncviewer/res/vncviewer.rc
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,7 @@ BEGIN
CONTROL "Do not display the sponsor advertisement",IDC_CHECK1,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,4,100,164,10
CONTROL "Hide status window",IDC_HIDESTATUS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,4,112,128,10
CONTROL "Hide End of Stream error", IDC_HIDEENDOFSTREAMERROR, "Button", BS_AUTOCHECKBOX | WS_TABSTOP,4,124,164,10
LTEXT "Folder",IDC_STATIC,4,18,36,9
LTEXT "Prefix",IDC_STATIC,4,36,36,8
LTEXT "Snapshot folder and prefix",IDC_STATIC,4,4,232,8
Expand Down
1 change: 1 addition & 0 deletions vncviewer/sessiondialogLoadSave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ void SessionDialog::SaveToFile(char *fname, bool asDefault)
saveInt("restricted", restricted, fname); //hide menu
saveInt("AllowUntrustedServers", AllowUntrustedServers, fname);
saveInt("nostatus", NoStatus, fname); //hide status window
saveInt("HideEOStreamError", HideEndOfStreamError, fname); // hide End of Stream error
saveInt("nohotkeys", NoHotKeys, fname); //disable hotkeys
saveInt("sponsor", g_disable_sponsor, fname);
saveInt("PreemptiveUpdates", preemptiveUpdates, fname);
Expand Down