From f8e43cf120dc1efad62e47292a589cf40eda3bd6 Mon Sep 17 00:00:00 2001 From: Andy Ford Date: Fri, 26 May 2023 17:04:48 +0100 Subject: [PATCH] feat: allow users to set preference on release messages --- resource/UKControllerPlugin.rc | 18 ++++++++++-------- resource/resource.h | 4 +++- src/plugin/euroscope/GeneralSettingsDialog.cpp | 11 +++++++++++ 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/resource/UKControllerPlugin.rc b/resource/UKControllerPlugin.rc index ce802de8a..c467a6756 100644 --- a/resource/UKControllerPlugin.rc +++ b/resource/UKControllerPlugin.rc @@ -106,20 +106,22 @@ BEGIN CONTROL "Enable Prenote Notifications",GS_DIALOG_PRENOTE_CHECK, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,16,96,10 CONTROL "Automatically Assign Initial Altitudes",GS_DIALOG_IA_CHECK, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,34,122,10 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,43,122,10 CONTROL "Automatically Assign Squawks",GS_DIALOG_SQUAWK_CHECK, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,54,107,10 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,63,107,10 CONTROL "Enable QNH Change Notifications",GS_DIALOG_QNH_CHECK, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,65,117,10 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,74,117,10 CONTROL "Display Unknown Times As Blank",GS_TIME_FORMAT_CHECK, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,76,117,10 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,85,117,10 CONTROL "Automatically Assign Initial Headings",GS_DIALOG_IH_CHECK, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,44,126,10 - LTEXT "Experimental settings, modify at your own risk:",IDC_GEN_SETTINGS_EXPERIMENTAL,14,90,136,8 - COMBOBOX IDC_RELEASE_CHANNEL,14,104,66,35,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP - LTEXT "Update Channel",IDC_STATIC,87,106,50,8 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,53,126,10 + LTEXT "Experimental settings, modify at your own risk:",IDC_GEN_SETTINGS_EXPERIMENTAL,14,99,136,8 + COMBOBOX IDC_RELEASE_CHANNEL,14,113,66,35,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP + LTEXT "Update Channel",IDC_STATIC,87,115,50,8 CONTROL "Notify Prenote Activity In Chat Area",IDC_PRENOTE_CHAT_MESSAGE, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,25,118,10 + CONTROL "Notify Departure Release Activity In Chat Area",IDC_RELEASE_CHAT_MESSAGE, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,34,152,10 END IDD_TIMER_CONFIGURATION DIALOGEX 0, 0, 179, 158 diff --git a/resource/resource.h b/resource/resource.h index 3bf3a24fa..ba52f5463 100644 --- a/resource/resource.h +++ b/resource/resource.h @@ -202,6 +202,8 @@ #define IDC_GEN_SETTINGS_EXPERIMENTAL 1142 #define IDC_RELEASE_CHANNEL 1143 #define IDC_API_KEY_STATIC 1144 +#define IDC_ 1145 +#define IDC_RELEASE_CHAT_MESSAGE 1145 // Next default values for new objects // @@ -209,7 +211,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 145 #define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1145 +#define _APS_NEXT_CONTROL_VALUE 1146 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif diff --git a/src/plugin/euroscope/GeneralSettingsDialog.cpp b/src/plugin/euroscope/GeneralSettingsDialog.cpp index 016949fa3..44e8ed0ad 100644 --- a/src/plugin/euroscope/GeneralSettingsDialog.cpp +++ b/src/plugin/euroscope/GeneralSettingsDialog.cpp @@ -39,6 +39,11 @@ namespace UKControllerPlugin { IDC_PRENOTE_CHAT_MESSAGE, this->GetCheckboxStateFromSettings(GeneralSettingsEntries::prenoteChatAreaMessagesSettingsKey)); + CheckDlgButton( + hwnd, + IDC_RELEASE_CHAT_MESSAGE, + this->GetCheckboxStateFromSettings(GeneralSettingsEntries::releaseChatAreaMessagesSettingsKey)); + CheckDlgButton( hwnd, GS_DIALOG_IA_CHECK, @@ -105,6 +110,12 @@ namespace UKControllerPlugin { GeneralSettingsEntries::prenoteChatAreaMessagesSettingsDescription, this->GetSettingFromCheckboxState(hwnd, IDC_PRENOTE_CHAT_MESSAGE)); + // Releases in chat area + this->userSettings.Save( + GeneralSettingsEntries::releaseChatAreaMessagesSettingsKey, + GeneralSettingsEntries::releaseChatAreaMessagesSettingsDescription, + this->GetSettingFromCheckboxState(hwnd, IDC_RELEASE_CHAT_MESSAGE)); + // Initial Altitudes Toggle this->userSettings.Save( GeneralSettingsEntries::initialAltitudeToggleSettingsKey,