Option to disable echo messages from settings menu

- Also add an edit box for setting the mute interval for
  repeated echo messages. To be specified in hours
  >=0. A zero value disables muting.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
pull/437/head
Selva Nair 2021-01-18 22:57:17 -05:00
parent 6b4e6d301a
commit 7faa16846d
3 changed files with 35 additions and 2 deletions

View File

@ -111,6 +111,8 @@
#define ID_RB_BALLOON2 241 #define ID_RB_BALLOON2 241
#define ID_CHK_SHOW_SCRIPT_WIN 242 #define ID_CHK_SHOW_SCRIPT_WIN 242
#define ID_CHK_ALWAYS_USE_ISERVICE 243 #define ID_CHK_ALWAYS_USE_ISERVICE 243
#define ID_RB_BALLOON3 244
#define ID_RB_BALLOON4 245
/* Proxy Auth Dialog */ /* Proxy Auth Dialog */
#define ID_DLG_PROXY_AUTH 250 #define ID_DLG_PROXY_AUTH 250
@ -134,6 +136,7 @@
#define ID_EDT_DISCONNECT_TIMEOUT 284 #define ID_EDT_DISCONNECT_TIMEOUT 284
#define ID_EDT_MGMT_PORT 285 #define ID_EDT_MGMT_PORT 285
#define ID_TXT_FOLDER1 286 #define ID_TXT_FOLDER1 286
#define ID_EDT_POPUP_MUTE 287
/* Connections dialog */ /* Connections dialog */
#define ID_DLG_CONNECTIONS 290 #define ID_DLG_CONNECTIONS 290

View File

@ -586,6 +586,14 @@ CheckAdvancedDlgParams (HWND hdlg)
return false; return false;
} }
tmp = GetDlgItemInt (hdlg, ID_EDT_POPUP_MUTE, &status, FALSE);
if (!status || tmp < 0)
{
MessageBox (NULL, L"Specified mute interval is not valid (must be a positive integer)",
L"Option error", MB_OK);
return false;
}
return true; return true;
} }
@ -624,6 +632,9 @@ SaveAdvancedDlgParams (HWND hdlg)
tmp = GetDlgItemInt (hdlg, ID_EDT_MGMT_PORT, &status, FALSE); tmp = GetDlgItemInt (hdlg, ID_EDT_MGMT_PORT, &status, FALSE);
if (status) o.mgmt_port_offset = tmp; if (status) o.mgmt_port_offset = tmp;
tmp = GetDlgItemInt (hdlg, ID_EDT_POPUP_MUTE, &status, FALSE);
if (status) o.popup_mute_interval = tmp;
SaveRegistryKeys (); SaveRegistryKeys ();
ExpandOptions (); ExpandOptions ();
@ -640,12 +651,19 @@ LoadAdvancedDlgParams (HWND hdlg)
SetDlgItemInt (hdlg, ID_EDT_CONNECT_TIMEOUT, o.connectscript_timeout, FALSE); SetDlgItemInt (hdlg, ID_EDT_CONNECT_TIMEOUT, o.connectscript_timeout, FALSE);
SetDlgItemInt (hdlg, ID_EDT_DISCONNECT_TIMEOUT, o.disconnectscript_timeout, FALSE); SetDlgItemInt (hdlg, ID_EDT_DISCONNECT_TIMEOUT, o.disconnectscript_timeout, FALSE);
SetDlgItemInt (hdlg, ID_EDT_MGMT_PORT, o.mgmt_port_offset, FALSE); SetDlgItemInt (hdlg, ID_EDT_MGMT_PORT, o.mgmt_port_offset, FALSE);
SetDlgItemInt (hdlg, ID_EDT_POPUP_MUTE, o.popup_mute_interval, FALSE);
if (o.config_menu_view == 0) if (o.config_menu_view == 0)
CheckRadioButton (hdlg, ID_RB_BALLOON0, ID_RB_BALLOON2, ID_RB_BALLOON0); CheckRadioButton (hdlg, ID_RB_BALLOON0, ID_RB_BALLOON2, ID_RB_BALLOON0);
else if (o.config_menu_view == 1) else if (o.config_menu_view == 1)
CheckRadioButton (hdlg, ID_RB_BALLOON0, ID_RB_BALLOON2, ID_RB_BALLOON1); CheckRadioButton (hdlg, ID_RB_BALLOON0, ID_RB_BALLOON2, ID_RB_BALLOON1);
else if (o.config_menu_view == 2) else if (o.config_menu_view == 2)
CheckRadioButton (hdlg, ID_RB_BALLOON0, ID_RB_BALLOON2, ID_RB_BALLOON2); CheckRadioButton (hdlg, ID_RB_BALLOON0, ID_RB_BALLOON2, ID_RB_BALLOON2);
/* BALLOON3 sets echo msg display to auto, BALLOON4 to never */
if (o.disable_popup_messages)
CheckRadioButton (hdlg, ID_RB_BALLOON3, ID_RB_BALLOON4, ID_RB_BALLOON4);
else
CheckRadioButton (hdlg, ID_RB_BALLOON3, ID_RB_BALLOON4, ID_RB_BALLOON3);
} }
INT_PTR CALLBACK INT_PTR CALLBACK
@ -699,8 +717,12 @@ AdvancedSettingsDlgProc (HWND hwndDlg, UINT msg, UNUSED WPARAM wParam, LPARAM lP
o.config_menu_view = 2; o.config_menu_view = 2;
else if (IsDlgButtonChecked(hwndDlg, ID_RB_BALLOON1)) else if (IsDlgButtonChecked(hwndDlg, ID_RB_BALLOON1))
o.config_menu_view = 1; o.config_menu_view = 1;
else else if (IsDlgButtonChecked(hwndDlg, ID_RB_BALLOON0))
o.config_menu_view = 0; o.config_menu_view = 0;
else if (IsDlgButtonChecked(hwndDlg, ID_RB_BALLOON3))
o.disable_popup_messages = 0;
else if (IsDlgButtonChecked(hwndDlg, ID_RB_BALLOON4))
o.disable_popup_messages = 1;
break; break;
} }

View File

@ -184,7 +184,7 @@ BEGIN
END END
/* Advanced Dialog */ /* Advanced Dialog */
ID_DLG_ADVANCED DIALOGEX 6, 18, 252, 235 ID_DLG_ADVANCED DIALOGEX 6, 18, 252, 280
STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | DS_CENTER STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | DS_CENTER
CAPTION "Advanced" CAPTION "Advanced"
FONT 8, "Microsoft Sans Serif" FONT 8, "Microsoft Sans Serif"
@ -218,6 +218,14 @@ BEGIN
AUTORADIOBUTTON "&Auto", ID_RB_BALLOON0, 28, 210, 50, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "&Auto", ID_RB_BALLOON0, 28, 210, 50, 10, WS_GROUP | WS_TABSTOP
AUTORADIOBUTTON "&Flat", ID_RB_BALLOON1, 88, 210, 50, 10 AUTORADIOBUTTON "&Flat", ID_RB_BALLOON1, 88, 210, 50, 10
AUTORADIOBUTTON "&Nested", ID_RB_BALLOON2, 148, 210, 50, 10 AUTORADIOBUTTON "&Nested", ID_RB_BALLOON2, 148, 210, 50, 10
GROUPBOX "Echo message display", 207, 6, 233, 235, 45
AUTORADIOBUTTON "A&uto", ID_RB_BALLOON3, 28, 245, 50, 10, WS_GROUP | WS_TABSTOP
AUTORADIOBUTTON "Ne&ver", ID_RB_BALLOON4, 88, 245, 50, 10
LTEXT "Repeated messages are muted for: ", 208, 17, 260, 125, 10
EDITTEXT ID_EDT_POPUP_MUTE, 150, 258, 30, 12, ES_AUTOHSCROLL
LTEXT "hours", 209, 190, 260, 40, 10
END END
/* About Dialog */ /* About Dialog */