diff --git a/openvpn-gui-res.h b/openvpn-gui-res.h index 2eedc13..18d0358 100644 --- a/openvpn-gui-res.h +++ b/openvpn-gui-res.h @@ -111,6 +111,8 @@ #define ID_RB_BALLOON2 241 #define ID_CHK_SHOW_SCRIPT_WIN 242 #define ID_CHK_ALWAYS_USE_ISERVICE 243 +#define ID_RB_BALLOON3 244 +#define ID_RB_BALLOON4 245 /* Proxy Auth Dialog */ #define ID_DLG_PROXY_AUTH 250 @@ -134,6 +136,7 @@ #define ID_EDT_DISCONNECT_TIMEOUT 284 #define ID_EDT_MGMT_PORT 285 #define ID_TXT_FOLDER1 286 +#define ID_EDT_POPUP_MUTE 287 /* Connections dialog */ #define ID_DLG_CONNECTIONS 290 diff --git a/options.c b/options.c index f37201f..ab8012b 100644 --- a/options.c +++ b/options.c @@ -586,6 +586,14 @@ CheckAdvancedDlgParams (HWND hdlg) 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; } @@ -624,6 +632,9 @@ SaveAdvancedDlgParams (HWND hdlg) tmp = GetDlgItemInt (hdlg, ID_EDT_MGMT_PORT, &status, FALSE); if (status) o.mgmt_port_offset = tmp; + tmp = GetDlgItemInt (hdlg, ID_EDT_POPUP_MUTE, &status, FALSE); + if (status) o.popup_mute_interval = tmp; + SaveRegistryKeys (); ExpandOptions (); @@ -640,12 +651,19 @@ LoadAdvancedDlgParams (HWND hdlg) SetDlgItemInt (hdlg, ID_EDT_CONNECT_TIMEOUT, o.connectscript_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_POPUP_MUTE, o.popup_mute_interval, FALSE); if (o.config_menu_view == 0) CheckRadioButton (hdlg, ID_RB_BALLOON0, ID_RB_BALLOON2, ID_RB_BALLOON0); else if (o.config_menu_view == 1) CheckRadioButton (hdlg, ID_RB_BALLOON0, ID_RB_BALLOON2, ID_RB_BALLOON1); else if (o.config_menu_view == 2) 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 @@ -699,8 +717,12 @@ AdvancedSettingsDlgProc (HWND hwndDlg, UINT msg, UNUSED WPARAM wParam, LPARAM lP o.config_menu_view = 2; else if (IsDlgButtonChecked(hwndDlg, ID_RB_BALLOON1)) o.config_menu_view = 1; - else + else if (IsDlgButtonChecked(hwndDlg, ID_RB_BALLOON0)) 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; } diff --git a/res/openvpn-gui-res-en.rc b/res/openvpn-gui-res-en.rc index fecc5a9..27887d9 100644 --- a/res/openvpn-gui-res-en.rc +++ b/res/openvpn-gui-res-en.rc @@ -184,7 +184,7 @@ BEGIN END /* 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 CAPTION "Advanced" FONT 8, "Microsoft Sans Serif" @@ -218,6 +218,14 @@ BEGIN AUTORADIOBUTTON "&Auto", ID_RB_BALLOON0, 28, 210, 50, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "&Flat", ID_RB_BALLOON1, 88, 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 /* About Dialog */