From: lx-s Date: Mon, 18 Dec 2023 15:36:53 +0000 (+0100) Subject: Small redesign wifi, bluetooth and endpoint dialog X-Git-Tag: 2.4.9.0~48 X-Git-Url: https://repos.lx-s.de/gitweb/?a=commitdiff_plain;h=250bc1fb2d22d022bc90ed52568b4577ee21186f;p=winmute.git Small redesign wifi, bluetooth and endpoint dialog --- diff --git a/Translations/lang-en.json b/Translations/lang-en.json index dc932ce..8f51bbf 100644 --- a/Translations/lang-en.json +++ b/Translations/lang-en.json @@ -1,124 +1,125 @@ { - "meta.lang.name": "English", - "meta.lang.mode": "ltr", - "init.error.settings.title": "Failed to initialize settings", - "init.error.settings.text": "Critical error while initializing WinMute", - "init.error.already-running.title": "WinMute is already running", - "init.error.already-running.text": "Please look for a winmutes application icon in the Windows taskbar notification area.", - "init.error.winmute.title": "Failed to start WinMute.", - "init.error.winmute.text": "WinMute encountered a critical error while initializing and must shut down.", - "init.error.winmute.platform-support.title": "Only Windows Vista and newer is supported", - "init.error.winmute.platform-support.text": "If Windows XP support is needed, please download WinMute version 1.4.2 or lower.", - "general.error.winapi.text": "{} failed with error {}: {}", - "general.error.audio-service-shutdown.title": "The audio service has been shut down.", - "general.error.audio-service-shutdown.text": "WinMute is not able to recover from that condition.\nPlease try to restart the program.", - "popup.remote-session-detected.title": "Remote Session detected", - "popup.remote-session-detected.text": "All audio endpoints have been muted", - "popup.bluetooth-muting-disabled.title": "Bluetooth muting disabled", - "popup.bluetooth-muting-disabled.text": "Bluetooth is not available or disabled.\nBluetooth muting will be disabled on this computer.", - "popup.wlan-muting-disabled.title": "WLAN muting disabled", - "popup.wlan-muting-disabled.text": "WLAN is not available or disabled.\nWLAN muting will be disabled on this computer.", - "popup.quiet-hours-started.title": "Quiet hours started", - "popup.quiet-hours-started.text": "Computer audio will now be muted.", - "popup.quiet-hours-ended.title": "Quiet Hours ended", - "popup.quiet-hours-ended.text": "Computer audio has been restored.", - "popup.workstation-muted.title": "Audio muted", - "popup.wlan-not-on-mute-list.text": "WLAN network \"{}\" is not on allowed list.", - "popup.wlan-is-on-mute-list.text": "WLAN network \"{}\" is configured for AutoMute.", - "popup.muting-workstation-after-delay.title": "Muting computer after delay", - "popup.muting-workstation-after-delay.text": "All endpoints have been muted", - "popup.volume-restored.title": "Volume restored", - "popup.volume-restored.text": "All endpoints have been restored to their previous configuration", - "popup.muting-workstation.title": "Muting computer", - "popup.muting-workstation.text": "All endpoints have been muted", - "popup.error.quiet-hours-start.title": "Quiet Hours Start", - "popup.error.quiet-hours-start.text": "Failed to register quiet hours start with windows timer system", - "popup.error.quiet-hours-stop.title": "Quiet Hours Stop", - "popup.error.quiet-hours-stop.text": "Failed to register end of quiet hours with windows timer system", - "traymenu.info": "About", - "traymenu.mute-when": "Mute when...", - "traymenu.mute-on-lock": "... computer is locked", - "traymenu.mute-on-screen-suspend": "... screen turns of", - "traymenu.restore-volume": "Restore volume afterwards", - "traymenu.mute-no-restore": "Mute on (no volume restore)...", - "traymenu.mute-on-shutdown": "... shutdown", - "traymenu.mute-on-sleep": "... sleep", - "traymenu.mute-on-logout": "... logout", - "traymenu.mute-all-devices": "Mute all devices", - "traymenu.settings": "Settings...", - "traymenu.exit": "Exit", - "settings.title": "Settings", - "settings.btn-save": "Save", - "settings.btn-cancel": "Cancel", - "settings.btn-add": "Add", - "settings.btn-edit": "Edit", - "settings.btn-remove": "Remove", - "settings.btn-remove-all": "Remove all", - "settings.tab.general": "General", - "settings.tab.mute": "Mute", - "settings.tab.quiet-hours": "Quiet Hours", - "settings.tab.bluetooth": "Bluetooth", - "settings.tab.wifi": "WLAN", - "settings.bluetooth.add-edit.add-title": "Add Bluetooth device", - "settings.bluetooth.add-edit.edit-title": "Edit Bluetooth device", - "settings.bluetooth.add-edit.device-name-label": "Bluetooth device name:", - "settings.general.run-on-startup": "Start WinMute on system startup", - "settings.general.enable-logging": "Enable logging", - "settings.general.btn-open-log-file": "Open log file...", - "settings.general.select-language-label": "Language", - "settings.bluetooth.add-edit.enter-device-name-placeholder": "Please enter a Bluetooth device name", - "settings.bluetooth.description": "\"Bluetooth Muting\" allows disabling the audio if an audio-class bluetooth device is disconnected, and re-enables it if a device is reconnected to the computer.\n\nThis behaviour can be enabled for all bluetooth audio-devices or only for a specific set.", - "settings.bluetooth.enable-muting": "Enable Bluetooth-based muting", - "settings.bluetooth.enable-muting-filter": "Enable only for these devices:", - "settings.bluetooth-disabled-info": "Note: Bluetooth is not available on this device.\nSome options have been disabled.", - "settings.mute.general-title": "General", - "settings.mute.show-mute-event-notifications": "Show mute event notifications", - "settings.mute.manage-endpoints-individually": "Manage audio endpoints individually", - "settings.mute.btn-manage-endpoints": "Manage endpoints...", - "settings.mute.mute-with-restore.title": "Mute with volume restore, when...", - "settings.mute.mute-with-restore.when-workstation-is-locked": "... the computer is locked", - "settings.mute.mute-with-restore.when-screen-turns-off": "... the screen turns off", - "settings.mute.mute-with-restore.restore-volume": "Restore volume afterwards", - "settings.mute.mute-with-restore.restore-volume-delay-label": "seconds delay before muting.", - "settings.mute.mute-without-restore.title": "Mute without volume restore, when...", - "settings.mute.mute-without-restore.when-computer-shuts-down": "... the computer shuts down", - "settings.mute.mute-without-restore.when-computer-goes-to-sleep": "... the computer goes into sleep/hibernate", - "settings.mute.mute-without-restore.when-user-logs-out": "... the user logs out", - "settings.mute.mute-without-restore.when-rdp-session-starts": "... WinMute is started within a RDP session", - "settings.quiet-hours.intro": "During Quiet Hours WinMute automatically mutes the computers audio endpoints and unmutes them afterwards.", - "settings.quiet-hours.enable": "Enable Quiet Hours", - "settings.quiet-hours.start-time-label": "Start time:", - "settings.quiet-hours.end-time-label": "End time:", - "settings.quiet-hours.force-unmute": "Force unmute", - "settings.quiet-hours.force-unmute-description": "If force unmute is enabled, WinMute will unmute the computers audio endpoints when quiet hours end and not take into account if they were already muted before quiet hours started.", - "settings.quiet-hours.show-notifications": "Show Quiet Hours notifications", - "settings.quiet-hours.error.invalid-time-range.title": "Invalid time range", - "settings.quiet-hours.error.invalid-time-range.text": "Start and stop must not be the same time.", - "settings.quiet-hours.error.error-while-saving.title": "Failed to save quiet hours settings", - "settings.quiet-hours.error.error-while-saving.text": "Something went wrong while saving the settings", - "settings.wifi.intro": "\"WLAN Mute\" mutes the computer based on the name of the connected wireless network.", - "settings.wifi.enable": "Enable WLAN based muting", - "settings.wifi.mute-when-not-in-list": "Mute computer if the WLAN network name is NOT in the list\n(default: mute if it is on the list)", - "settings.wifi.wifi-disabled-info": "Note: WLAN is not available on this device.\nSome options have been disabled.", - "settings.wifi.add-edit.add-title": "Add WiFi network", - "settings.wifi.add-edit.edit-title": "Edit WiFi network", - "settings.wifi.add-edit.ssid-name-label": "SSID/WiFi Name:", - "settings.wifi.add-edit.enter-device-name-placeholder": "Please enter a SSID/WiFi name", - "settings.mute.manage-endpoints.title": "Manage audio endpoints", - "settings.mute.manage-endpoints.list-behaviour.title": "List behaviour", - "settings.mute.manage-endpoints.list-behaviour.mute-only-listed": "Mute only listed endpoints", - "settings.mute.manage-endpoints.list-behaviour.mute-all-but-listed": "Mute all but listed endpoints", - "settings.mute.manage-endpoints.endpoints.title": "Endpoints", - "settings.mute.manage-endpoints.add-edit.add-title": "Add Endpoint", - "settings.mute.manage-endpoints.add-edit.edit-title": "Edit Endpoint", - "settings.mute.manage-endpoints.add-edit.endpoint-name-placeholder": "Please enter a endpoint name", - "settings.mute.manage-endpoints.add-edit.endpoint-name-label": "Endpoint name:", - "about.title": "About WinMute", - "about.general.author-site-label": "Author: www.lx-s.de", - "about.general.project-site-label": "Project Site && Code", - "about.general.support-label": "Support", - "about.general.description": "WinMute is developed by Alexander Steinhoefer his spare time. The code as well as new releases for this tool can be found on GitHub. Contributions in the form of code, tickets or feature requests are very welcome. Thanks for using this little tool!", - "about.tab.winmute": "WinMute", - "about.tab.license": "License", - "about.btn-close": "OK" + "meta.lang.name": "English", + "meta.lang.mode": "ltr", + "init.error.settings.title": "Failed to initialize settings", + "init.error.settings.text": "Critical error while initializing WinMute", + "init.error.already-running.title": "WinMute is already running", + "init.error.already-running.text": "Please look for a winmutes application icon in the Windows taskbar notification area.", + "init.error.winmute.title": "Failed to start WinMute.", + "init.error.winmute.text": "WinMute encountered a critical error while initializing and must shut down.", + "init.error.winmute.platform-support.title": "Only Windows Vista and newer is supported", + "init.error.winmute.platform-support.text": "If Windows XP support is needed, please download WinMute version 1.4.2 or lower.", + "general.error.winapi.text": "{} failed with error {}: {}", + "general.error.audio-service-shutdown.title": "The audio service has been shut down.", + "general.error.audio-service-shutdown.text": "WinMute is not able to recover from that condition.\nPlease try to restart the program.", + "popup.remote-session-detected.title": "Remote Session detected", + "popup.remote-session-detected.text": "All audio endpoints have been muted", + "popup.bluetooth-muting-disabled.title": "Bluetooth muting disabled", + "popup.bluetooth-muting-disabled.text": "Bluetooth is not available or disabled.\nBluetooth muting will be disabled on this computer.", + "popup.wlan-muting-disabled.title": "WLAN muting disabled", + "popup.wlan-muting-disabled.text": "WLAN is not available or disabled.\nWLAN muting will be disabled on this computer.", + "popup.quiet-hours-started.title": "Quiet hours started", + "popup.quiet-hours-started.text": "Computer audio will now be muted.", + "popup.quiet-hours-ended.title": "Quiet Hours ended", + "popup.quiet-hours-ended.text": "Computer audio has been restored.", + "popup.workstation-muted.title": "Audio muted", + "popup.wlan-not-on-mute-list.text": "WLAN network \"{}\" is not on allowed list.", + "popup.wlan-is-on-mute-list.text": "WLAN network \"{}\" is configured for AutoMute.", + "popup.muting-workstation-after-delay.title": "Muting computer after delay", + "popup.muting-workstation-after-delay.text": "All endpoints have been muted", + "popup.volume-restored.title": "Volume restored", + "popup.volume-restored.text": "All endpoints have been restored to their previous configuration", + "popup.muting-workstation.title": "Muting computer", + "popup.muting-workstation.text": "All endpoints have been muted", + "popup.error.quiet-hours-start.title": "Quiet Hours Start", + "popup.error.quiet-hours-start.text": "Failed to register quiet hours start with windows timer system", + "popup.error.quiet-hours-stop.title": "Quiet Hours Stop", + "popup.error.quiet-hours-stop.text": "Failed to register end of quiet hours with windows timer system", + "traymenu.info": "About", + "traymenu.mute-when": "Mute when...", + "traymenu.mute-on-lock": "... computer is locked", + "traymenu.mute-on-screen-suspend": "... screen turns of", + "traymenu.restore-volume": "Restore volume afterwards", + "traymenu.mute-no-restore": "Mute on (no volume restore)...", + "traymenu.mute-on-shutdown": "... shutdown", + "traymenu.mute-on-sleep": "... sleep", + "traymenu.mute-on-logout": "... logout", + "traymenu.mute-all-devices": "Mute all devices", + "traymenu.settings": "Settings...", + "traymenu.exit": "Exit", + "settings.title": "Settings", + "settings.btn-save": "Save", + "settings.btn-cancel": "Cancel", + "settings.btn-add": "Add", + "settings.btn-edit": "Edit", + "settings.btn-remove": "Remove", + "settings.btn-remove-all": "Remove all", + "settings.tab.general": "General", + "settings.tab.mute": "Mute", + "settings.tab.quiet-hours": "Quiet Hours", + "settings.tab.bluetooth": "Bluetooth", + "settings.tab.wifi": "WLAN", + "settings.bluetooth.add-edit.add-title": "Add Bluetooth device", + "settings.bluetooth.add-edit.edit-title": "Edit Bluetooth device", + "settings.bluetooth.add-edit.device-name-label": "Bluetooth device name:", + "settings.general.run-on-startup": "Start WinMute on system startup", + "settings.general.enable-logging": "Enable logging", + "settings.general.btn-open-log-file": "Open log file...", + "settings.general.select-language-label": "Language", + "settings.bluetooth.add-edit.enter-device-name-placeholder": "Please enter a Bluetooth device name", + "settings.bluetooth.description": "\"Bluetooth Muting\" allows disabling the audio if an audio-class bluetooth device is disconnected, and re-enables it if a device is reconnected to the computer.\n\nThis behaviour can be enabled for all bluetooth audio-devices or only for a specific set.", + "settings.bluetooth.enable-muting": "Enable Bluetooth-based muting", + "settings.bluetooth.enable-muting-filter": "Enable only for these devices:", + "settings.bluetooth-disabled-info": "Note: Bluetooth is not available on this device.\nSome options have been disabled.", + "settings.mute.general-title": "General", + "settings.mute.show-mute-event-notifications": "Show mute event notifications", + "settings.mute.manage-endpoints-individually": "Manage audio endpoints individually", + "settings.mute.btn-manage-endpoints": "Manage endpoints...", + "settings.mute.mute-with-restore.title": "Mute with volume restore, when...", + "settings.mute.mute-with-restore.when-workstation-is-locked": "... the computer is locked", + "settings.mute.mute-with-restore.when-screen-turns-off": "... the screen turns off", + "settings.mute.mute-with-restore.restore-volume": "Restore volume afterwards", + "settings.mute.mute-with-restore.restore-volume-delay-label": "seconds delay before muting.", + "settings.mute.mute-without-restore.title": "Mute without volume restore, when...", + "settings.mute.mute-without-restore.when-computer-shuts-down": "... the computer shuts down", + "settings.mute.mute-without-restore.when-computer-goes-to-sleep": "... the computer goes into sleep/hibernate", + "settings.mute.mute-without-restore.when-user-logs-out": "... the user logs out", + "settings.mute.mute-without-restore.when-rdp-session-starts": "... WinMute is started within a RDP session", + "settings.quiet-hours.intro": "During Quiet Hours WinMute automatically mutes the computers audio endpoints and unmutes them afterwards.", + "settings.quiet-hours.enable": "Enable Quiet Hours", + "settings.quiet-hours.start-time-label": "Start time:", + "settings.quiet-hours.end-time-label": "End time:", + "settings.quiet-hours.force-unmute": "Force unmute", + "settings.quiet-hours.force-unmute-description": "If force unmute is enabled, WinMute will unmute the computers audio endpoints when quiet hours end and not take into account if they were already muted before quiet hours started.", + "settings.quiet-hours.show-notifications": "Show Quiet Hours notifications", + "settings.quiet-hours.error.invalid-time-range.title": "Invalid time range", + "settings.quiet-hours.error.invalid-time-range.text": "Start and stop must not be the same time.", + "settings.quiet-hours.error.error-while-saving.title": "Failed to save quiet hours settings", + "settings.quiet-hours.error.error-while-saving.text": "Something went wrong while saving the settings", + "settings.wifi.intro": "\"WLAN Mute\" mutes the computer based on the name of the connected wireless network.", + "settings.wifi.enable": "Enable WLAN based muting", + "settings.wifi.mute-when-in-list": "Mute if connected WLAN is in list", + "settings.wifi.mute-when-not-in-list": "Mute if connected WLAN is not in list", + "settings.wifi.wifi-disabled-info": "Note: WLAN is not available on this device.\nSome options have been disabled.", + "settings.wifi.add-edit.add-title": "Add WiFi network", + "settings.wifi.add-edit.edit-title": "Edit WiFi network", + "settings.wifi.add-edit.ssid-name-label": "SSID/WiFi Name:", + "settings.wifi.add-edit.enter-device-name-placeholder": "Please enter a SSID/WiFi name", + "settings.mute.manage-endpoints.title": "Manage audio endpoints", + "settings.mute.manage-endpoints.list-behaviour.title": "List behaviour", + "settings.mute.manage-endpoints.list-behaviour.mute-only-listed": "Mute only listed endpoints", + "settings.mute.manage-endpoints.list-behaviour.mute-all-but-listed": "Mute all but listed endpoints", + "settings.mute.manage-endpoints.endpoints.title": "Endpoints", + "settings.mute.manage-endpoints.add-edit.add-title": "Add Endpoint", + "settings.mute.manage-endpoints.add-edit.edit-title": "Edit Endpoint", + "settings.mute.manage-endpoints.add-edit.endpoint-name-placeholder": "Please enter a endpoint name", + "settings.mute.manage-endpoints.add-edit.endpoint-name-label": "Endpoint name:", + "about.title": "About WinMute", + "about.general.author-site-label": "Author: www.lx-s.de", + "about.general.project-site-label": "Project Site && Code", + "about.general.support-label": "Support", + "about.general.description": "WinMute is developed by Alexander Steinhoefer his spare time. The code as well as new releases for this tool can be found on GitHub. Contributions in the form of code, tickets or feature requests are very welcome. Thanks for using this little tool!", + "about.tab.winmute": "WinMute", + "about.tab.license": "License", + "about.btn-close": "OK" } diff --git a/WinMute/Settings_BluetoothDlg.cpp b/WinMute/Settings_BluetoothDlg.cpp index 47aacb6..6414dac 100644 --- a/WinMute/Settings_BluetoothDlg.cpp +++ b/WinMute/Settings_BluetoothDlg.cpp @@ -197,7 +197,6 @@ static void LoadBluetoothDlgTranslation(HWND hDlg) i18n.SetItemText(hDlg, IDC_BLUETOOTH_EDIT, "settings.btn-edit"); i18n.SetItemText(hDlg, IDC_BLUETOOTH_REMOVE, "settings.btn-remove"); i18n.SetItemText(hDlg, IDC_BLUETOOTH_REMOVEALL, "settings.btn-remove-all"); - i18n.SetItemText(hDlg, IDC_STATIC_BLUETOOTH_NOT_AVAILABLE, "settings.bluetooth-disabled-info"); } INT_PTR CALLBACK Settings_BluetoothDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) @@ -247,16 +246,15 @@ INT_PTR CALLBACK Settings_BluetoothDlgProc(HWND hDlg, UINT msg, WPARAM wParam, L // Hide all child windows, except the notice EnumChildWindows(hDlg, ShowChildWindow, SW_HIDE); - HWND hBtNotAvail = GetDlgItem(hDlg, IDC_STATIC_BLUETOOTH_NOT_AVAILABLE); + HWND hDescription = GetDlgItem(hDlg, IDC_STATIC_BLUETOOTH_NOT_AVAILABLE); + WMi18n::GetInstance().SetItemText(hDescription, "settings.bluetooth-disabled-info"); RECT r; - GetClientRect(hBtNotAvail, &r); + GetClientRect(hDescription, &r); constexpr int margin = 20; SetWindowPos( - hBtNotAvail, HWND_TOP, + hDescription, HWND_TOP, margin, margin, r.right, r.bottom, SWP_SHOWWINDOW); - } else { - ShowWindow(GetDlgItem(hDlg, IDC_STATIC_BLUETOOTH_NOT_AVAILABLE), SW_HIDE); } return TRUE; } diff --git a/WinMute/Settings_WifiDlg.cpp b/WinMute/Settings_WifiDlg.cpp index 7ee4bc7..060b194 100644 --- a/WinMute/Settings_WifiDlg.cpp +++ b/WinMute/Settings_WifiDlg.cpp @@ -158,7 +158,8 @@ static void LoadWifiDlgTranslation(HWND hDlg) i18n.SetItemText(hDlg, IDC_WIFI_EDIT, "settings.btn-edit"); i18n.SetItemText(hDlg, IDC_WIFI_REMOVE, "settings.btn-remove"); i18n.SetItemText(hDlg, IDC_WIFI_REMOVEALL, "settings.btn-remove-all"); - i18n.SetItemText(hDlg, IDC_STATIC_WLAN_NOT_AVAILABLE, "settings.wifi.wifi-disabled-info"); + i18n.SetItemText(hDlg, IDC_WLAN_LIST_IS_ALLOWLIST, "settings.wifi.mute-when-in-list"); + i18n.SetItemText(hDlg, IDC_WLAN_LIST_IS_BLOCKLIST, "settings.wifi.mute-when-not-in-list"); } INT_PTR CALLBACK Settings_WifiDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) @@ -177,10 +178,13 @@ INT_PTR CALLBACK Settings_WifiDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM DWORD enabled = settings->QueryValue(SettingsKey::MUTE_ON_WLAN); Button_SetCheck(GetDlgItem(hDlg, IDC_ENABLE_WIFI_MUTE), enabled ? BST_CHECKED : BST_UNCHECKED); - Button_Enable(GetDlgItem(hDlg, IDC_IS_PERMITLIST), enabled); + Button_Enable(GetDlgItem(hDlg, IDC_WLAN_LIST_IS_ALLOWLIST), enabled == BST_CHECKED); + Button_Enable(GetDlgItem(hDlg, IDC_WLAN_LIST_IS_BLOCKLIST), enabled == BST_CHECKED); enabled = settings->QueryValue(SettingsKey::MUTE_ON_WLAN_ALLOWLIST); - Button_SetCheck(GetDlgItem(hDlg, IDC_IS_PERMITLIST), + Button_SetCheck(GetDlgItem(hDlg, IDC_WLAN_LIST_IS_ALLOWLIST), enabled ? BST_CHECKED : BST_UNCHECKED); + Button_SetCheck(GetDlgItem(hDlg, IDC_WLAN_LIST_IS_BLOCKLIST), + !enabled ? BST_CHECKED : BST_UNCHECKED); Button_Enable(GetDlgItem(hDlg, IDC_WIFI_EDIT), FALSE); Button_Enable(GetDlgItem(hDlg, IDC_WIFI_REMOVE), FALSE); @@ -197,30 +201,32 @@ INT_PTR CALLBACK Settings_WifiDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM // Set defaults Button_SetCheck(GetDlgItem(hDlg, IDC_ENABLE_WIFI_MUTE), BST_UNCHECKED); Button_Enable(GetDlgItem(hDlg, IDC_ENABLE_WIFI_MUTE), FALSE); - Button_SetCheck(GetDlgItem(hDlg, IDC_IS_PERMITLIST), BST_UNCHECKED); - Button_Enable(GetDlgItem(hDlg, IDC_IS_PERMITLIST), FALSE); + Button_SetCheck(GetDlgItem(hDlg, IDC_WLAN_LIST_IS_ALLOWLIST), BST_CHECKED); + Button_Enable(GetDlgItem(hDlg, IDC_WLAN_LIST_IS_ALLOWLIST), FALSE); + Button_SetCheck(GetDlgItem(hDlg, IDC_WLAN_LIST_IS_BLOCKLIST), BST_UNCHECKED); + Button_Enable(GetDlgItem(hDlg, IDC_WLAN_LIST_IS_BLOCKLIST), FALSE); // Hide all child windows, except the notice EnumChildWindows(hDlg, ShowChildWindow, SW_HIDE); - HWND hWifiNotAvail = GetDlgItem(hDlg, IDC_STATIC_WLAN_NOT_AVAILABLE); + HWND hDescription = GetDlgItem(hDlg, IDC_WIFI_INTRO); + WMi18n::GetInstance().SetItemText(hDescription, "settings.wifi.wifi-disabled-info"); RECT r; - GetClientRect(hWifiNotAvail, &r); + GetClientRect(hDescription, &r); const int margin = 20; SetWindowPos( - hWifiNotAvail, HWND_TOP, + hDescription, HWND_TOP, margin, margin, r.right, r.bottom, SWP_SHOWWINDOW); - } else { - ShowWindow(GetDlgItem(hDlg, IDC_STATIC_WLAN_NOT_AVAILABLE), SW_HIDE); } return TRUE; } case WM_COMMAND: { if (LOWORD(wParam) == IDC_ENABLE_WIFI_MUTE) { - const DWORD checked = Button_GetCheck(GetDlgItem(hDlg, IDC_ENABLE_WIFI_MUTE)); - Button_Enable(GetDlgItem(hDlg, IDC_IS_PERMITLIST), checked == BST_CHECKED); + const DWORD wlanEnabled = Button_GetCheck(GetDlgItem(hDlg, IDC_ENABLE_WIFI_MUTE)); + Button_Enable(GetDlgItem(hDlg, IDC_WLAN_LIST_IS_ALLOWLIST), wlanEnabled == BST_CHECKED); + Button_Enable(GetDlgItem(hDlg, IDC_WLAN_LIST_IS_BLOCKLIST), wlanEnabled == BST_CHECKED); } else if (LOWORD(wParam) == IDC_WIFI_LIST) { HWND hList = GetDlgItem(hDlg, IDC_WIFI_LIST); if (HIWORD(wParam) == LBN_SELCHANGE || HIWORD(wParam) == LBN_SELCANCEL) { @@ -309,7 +315,7 @@ INT_PTR CALLBACK Settings_WifiDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM DWORD checked = Button_GetCheck(GetDlgItem(hDlg, IDC_ENABLE_WIFI_MUTE)); settings->SetValue(SettingsKey::MUTE_ON_WLAN, checked == BST_CHECKED); - checked = Button_GetCheck(GetDlgItem(hDlg, IDC_IS_PERMITLIST)); + checked = Button_GetCheck(GetDlgItem(hDlg, IDC_WLAN_LIST_IS_ALLOWLIST)); settings->SetValue(SettingsKey::MUTE_ON_WLAN_ALLOWLIST, checked == BST_CHECKED); return 0; diff --git a/WinMute/WinMute.rc b/WinMute/WinMute.rc index 181a4ce..e4278ed 100644 --- a/WinMute/WinMute.rc +++ b/WinMute/WinMute.rc @@ -155,16 +155,17 @@ IDD_SETTINGS_WIFI DIALOGEX 0, 0, 242, 216 STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN - LISTBOX IDC_WIFI_LIST,7,99,170,86,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Add",IDC_WIFI_ADD,179,97,56,16 - PUSHBUTTON "Edit",IDC_WIFI_EDIT,179,116,56,16 - PUSHBUTTON "Remove",IDC_WIFI_REMOVE,179,135,56,16 - PUSHBUTTON "Remove all",IDC_WIFI_REMOVEALL,179,155,56,16 - LTEXT "Note: WLAN is not available on your device, so some options have been disabled.",IDC_STATIC_WLAN_NOT_AVAILABLE,7,191,228,18 + LISTBOX IDC_WIFI_LIST,7,88,166,121,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Add",IDC_WIFI_ADD,179,87,56,16 + PUSHBUTTON "Edit",IDC_WIFI_EDIT,179,106,56,16 + PUSHBUTTON "Remove",IDC_WIFI_REMOVE,179,125,56,16 + PUSHBUTTON "Remove all",IDC_WIFI_REMOVEALL,179,193,56,16 CONTROL "Enable WLAN based muting",IDC_ENABLE_WIFI_MUTE,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,7,44,228,14 - CONTROL "Mute workstation if the WLAN network name is NOT in the list\n(default: mute if it is on the list)\nLine3",IDC_IS_PERMITLIST, - "Button",BS_AUTOCHECKBOX | BS_LEFT | BS_TOP | BS_MULTILINE | WS_TABSTOP,20,59,215,31 - LTEXT """WLAN Mute"" allows you to mute your workstation based on the name of the connected wireless network.",IDC_WIFI_INTRO,7,7,228,35 + LTEXT "Description\nDescription\nDescription\nDescription",IDC_WIFI_INTRO,7,7,228,37 + CONTROL "Mute if connected WLAN is in list",IDC_WLAN_LIST_IS_ALLOWLIST, + "Button",BS_AUTORADIOBUTTON,17,60,209,10 + CONTROL "Mute if connected WLAN is not in list",IDC_WLAN_LIST_IS_BLOCKLIST, + "Button",BS_AUTORADIOBUTTON,17,73,207,10 END IDD_SETTINGS_WIFI_ADD DIALOGEX 0, 0, 201, 62 @@ -183,17 +184,16 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD EXSTYLE WS_EX_CONTROLPARENT FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN - LISTBOX IDC_BLUETOOTH_LIST,7,121,170,73,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Add",IDC_BLUETOOTH_ADD,179,120,56,16 - PUSHBUTTON "Edit",IDC_BLUETOOTH_EDIT,179,140,56,16 - PUSHBUTTON "Remove",IDC_BLUETOOTH_REMOVE,179,158,56,16 - PUSHBUTTON "Remove all",IDC_BLUETOOTH_REMOVEALL,179,178,56,16 - LTEXT "Note: Bluetooth is not available on your device, so some options have been disabled.",IDC_STATIC_BLUETOOTH_NOT_AVAILABLE,7,197,228,18 + LISTBOX IDC_BLUETOOTH_LIST,7,95,168,120,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Add",IDC_BLUETOOTH_ADD,181,94,56,16 + PUSHBUTTON "Edit",IDC_BLUETOOTH_EDIT,181,113,56,16 + PUSHBUTTON "Remove",IDC_BLUETOOTH_REMOVE,181,132,56,16 + PUSHBUTTON "Remove all",IDC_BLUETOOTH_REMOVEALL,181,199,56,16 CONTROL "Enable Bluetooth based muting",IDC_ENABLE_BLUETOOTH_MUTE, - "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,7,67,228,14 - CONTROL "Only mute when one of the following devices connect to or disconnect from your PC.",IDC_ENABLE_BLUETOOTH_MUTE_DEVICE_LIST, - "Button",BS_AUTOCHECKBOX | BS_TOP | BS_MULTILINE | WS_TABSTOP,20,84,215,27 - LTEXT "Description\nDescription\nDescription\nDescription\nDescription",IDC_BLUETOOTH_DESCRIPTION_LABEL,7,7,230,53 + "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,7,62,228,14 + CONTROL "Enable only for these devices:",IDC_ENABLE_BLUETOOTH_MUTE_DEVICE_LIST, + "Button",BS_AUTOCHECKBOX | BS_TOP | BS_MULTILINE | WS_TABSTOP,20,78,215,12 + LTEXT "Description\nDescription\nDescription\nDescription\nDescription\nDescription",IDC_BLUETOOTH_DESCRIPTION_LABEL,7,7,230,51 END IDD_SETTINGS_BLUETOOTH_ADD DIALOGEX 0, 0, 201, 62 @@ -214,11 +214,11 @@ FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "Save",IDOK,133,179,50,14 PUSHBUTTON "Cancel",IDCANCEL,184,179,50,14 - LISTBOX IDC_ENDPOINT_LIST,13,60,159,110,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + LISTBOX IDC_ENDPOINT_LIST,13,60,156,110,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "Add",IDC_ENDPOINT_ADD,175,60,56,16 PUSHBUTTON "Edit",IDC_ENDPOINT_EDIT,175,78,56,16 PUSHBUTTON "Remove",IDC_ENDPOINT_REMOVE,175,97,56,16 - PUSHBUTTON "Remove all",IDC_ENDPOINT_REMOVEALL,175,120,56,16 + PUSHBUTTON "Remove all",IDC_ENDPOINT_REMOVEALL,178,155,56,16 CONTROL "Mute only listed endpoints",IDC_ENDPOINT_LIST_IS_ALLOWLIST, "Button",BS_AUTORADIOBUTTON,13,19,209,10 CONTROL "Mute all but the listed endpoints",IDC_ENDPOINT_LIST_IS_BLOCKLIST, diff --git a/WinMute/WinMute.vcxproj b/WinMute/WinMute.vcxproj index cbdaf4c..52f2d23 100644 --- a/WinMute/WinMute.vcxproj +++ b/WinMute/WinMute.vcxproj @@ -204,8 +204,8 @@ + - diff --git a/WinMute/WinMute.vcxproj.filters b/WinMute/WinMute.vcxproj.filters index aeb2222..7514fe5 100644 --- a/WinMute/WinMute.vcxproj.filters +++ b/WinMute/WinMute.vcxproj.filters @@ -60,6 +60,9 @@ {959a5f00-8238-460f-aaba-1b1d9e9ea7ca} + + {825b7134-b70c-4e13-a95a-0a72645b1ec4} + @@ -104,10 +107,10 @@ Source Files\Base\Settings - - Source Files - + + Source Files\_External + diff --git a/WinMute/common.h b/WinMute/common.h index 33fd317..6ef6ca7 100644 --- a/WinMute/common.h +++ b/WinMute/common.h @@ -98,7 +98,7 @@ namespace fs = std::filesystem; #include "libs/json.hpp" -#include "resource_winmute.h" +#include "resource.h" #include "WMi18n.h" #include "WMSettings.h" diff --git a/WinMute/resource.h b/WinMute/resource.h index 419849b..60e06c8 100644 --- a/WinMute/resource.h +++ b/WinMute/resource.h @@ -103,6 +103,9 @@ #define IDC_GROUP_LIST_BEHAVIOUR 1066 #define IDC_GROUP_ENDPOINTS 1067 #define IDC_ENDPOINT_NAME_LABEL 1068 +#define IDC_WLAN_LIST_IS_ALLOWLIST 1069 +#define IDC_WLAN_LIST_IS_BLOCKLIST 1070 +#define IDC_RADIO1 1071 #define ID_TRAYMENU_INFO 40001 #define ID_TRAYMENU_ 40002 #define ID_TRAYMENU_MUTEON 40003 @@ -150,7 +153,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 141 #define _APS_NEXT_COMMAND_VALUE 40041 -#define _APS_NEXT_CONTROL_VALUE 1069 +#define _APS_NEXT_CONTROL_VALUE 1072 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif diff --git a/WinMute/resource_winmute.h b/WinMute/resource_winmute.h deleted file mode 100644 index 2d45435..0000000 --- a/WinMute/resource_winmute.h +++ /dev/null @@ -1,156 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by WinMute.rc -// -#define IDI_APP 5 -#define IDD_ABOUT 9 -#define IDI_TRAY_BRIGHT 104 -#define IDI_TRAY_DARK 105 -#define IDR_TRAYMENU 106 -#define IDD_SETTINGS 109 -#define IDD_SETTINGS_GENERAL 114 -#define IDD_SETTINGS_QUIETHOURS 116 -#define IDD_ABOUT_LICENSE 118 -#define IDD_ABOUT_WINMUTE 120 -#define IDI_ICON1 122 -#define IDI_SETTINGS 122 -#define IDD_SETTINGS_MUTE 123 -#define IDD_SETTINGS_WIFI 127 -#define IDD_SETTINGS_WIFI_ADD 129 -#define IDD_SETTINGS_BLUETOOTH 131 -#define IDD_DIALOG1 133 -#define IDD_SETTINGS_BLUETOOTH_ADD 133 -#define IDD_MANAGE_ENDPOINTS 135 -#define IDD_DIALOG2 137 -#define IDD_MANAGE_ENDPOINTS_ADD 137 -#define IDC_LINK_HOMEPAGE 1001 -#define IDC_LINK_SUPPORT 1002 -#define IDC_LINK_PROJECT 1002 -#define IDC_ENABLEQUIETHOURS 1003 -#define IDC_LINK_TICKETS 1003 -#define IDC_QUIETHOURS_START 1004 -#define IDC_QUIETHOURS_END 1005 -#define IDC_FORCEUNMUTE 1006 -#define IDC_SHOWNOTIFICATIONS 1007 -#define IDC_TREE1 1008 -#define IDC_MANAGE_AUDIO_ENDPOINTS_INDIVIDUALLY 1008 -#define IDC_TAB1 1010 -#define IDC_SETTINGS_TAB 1010 -#define IDC_CHECK1 1011 -#define IDC_RUNONSTARTUP 1011 -#define IDC_MUTE_WHEN_WS_LOCKED 1011 -#define IDC_ENABLE_WIFI_MUTE 1011 -#define IDC_ENABLELOGGING 1012 -#define IDC_CHECK3 1013 -#define IDC_OPENLOG 1014 -#define IDC_LICENSETEXT 1015 -#define IDC_ABOUT_TAB 1016 -#define IDC_ABOUTTEXT 1019 -#define IDC_TITLE 1020 -#define IDC_ABOUT_TITLE 1020 -#define IDC_MUTE_WHEN_SCREENSAVER_STARTS 1021 -#define IDC_MUTE_WHEN_SCREEN_OFF 1022 -#define IDC_MUTE_WHEN_RDP_SESSION 1023 -#define IDC_WIFI_LIST 1023 -#define IDC_RESTOREVOLUME 1024 -#define IDC_WIFI_ADD 1024 -#define IDC_MUTE_WHEN_SHUTDOWN 1025 -#define IDC_WIFI_REMOVE 1025 -#define IDC_WIFI_NAME 1025 -#define IDC_MUTE_WHEN_LOGOUT 1026 -#define IDC_WIFI_EDIT 1026 -#define IDC_MUTE_WHEN_SLEEP 1027 -#define IDC_WIFI_REMOVE2 1027 -#define IDC_WIFI_REMOVEALL 1027 -#define IDC_CHECK2 1028 -#define IDC_IS_PERMITLIST 1028 -#define IDC_STATIC_WLAN_NOT_AVAILABLE 1029 -#define IDC_STATIC_BLUETOOTH_NOT_AVAILABLE 1030 -#define IDC_BLUETOOTH_ADD 1031 -#define IDC_BLUETOOTH_EDIT 1032 -#define IDC_BLUETOOTH_REMOVE 1033 -#define IDC_BLUETOOTH_REMOVEALL 1034 -#define IDC_BLUETOOTH_LIST 1035 -#define IDC_ENABLE_BLUETOOTH_MUTE 1036 -#define IDC_ENABLE_BLUETOOTH_MUTE_DEVICE_LIST 1037 -#define IDC_BT_DEVICE_NAME 1038 -#define IDC_LOGFILEPATH 1040 -#define IDC_BUTTON1 1041 -#define IDC_MANAGE_ENDPOINTS 1041 -#define IDC_ENDPOINT_LIST_IS_ALLOWLIST 1042 -#define IDC_ENDPOINT_LIST_IS_BLOCKLIST 1043 -#define IDC_ENDPOINT_LIST 1044 -#define IDC_ENDPOINT_ADD 1045 -#define IDC_ENDPOINT_EDIT 1046 -#define IDC_ENDPOINT_REMOVE 1047 -#define IDC_ENDPOINT_REMOVEALL 1048 -#define IDC_ENDPOINT_NAME 1049 -#define IDC_MUTEDELAY 1050 -#define IDC_LANGUAGE 1051 -#define IDC_LABEL_BT_DEVICE_NAME 1052 -#define IDC_BLUETOOTH_DESCRIPTION_LABEL 1053 -#define IDC_SELECT_LANGUAGE_LABEL 1054 -#define IDC_GROUP_GENERAL 1055 -#define IDC_GROUP_MUTE_WITH_RESTORE 1056 -#define IDC_GROUP_MUTE_WITHOUT_RESTORE 1057 -#define IDC_DELAY_MUTING_LABEL 1058 -#define IDC_QUIET_HOURS_DESCRIPTION 1059 -#define IDC_QUIET_HOURS_START_LABEL 1060 -#define IDC_QUIET_HOURS_END_LABEL 1061 -#define IDC_QUIET_HOURS_FORCE_UNMUTE_DESCRIPTION 1062 -#define IDC_WIFI_INTRO 1063 -#define IDC_WIFI_NAME_LABEL 1064 -#define IDC_GROUP_LIST_BEHAVIOUR 1066 -#define IDC_GROUP_ENDPOINTS 1067 -#define IDC_ENDPOINT_NAME_LABEL 1068 -#define ID_TRAYMENU_INFO 40001 -#define ID_TRAYMENU_ 40002 -#define ID_TRAYMENU_MUTEON 40003 -#define ID_TRAYMENU_ID 40004 -#define ID_TRAYMENU_MUTEONSCREENSAVER 40005 -#define ID_TRAYMENU_40006 40006 -#define ID_TRAYMENU_RESTOREAUDIO 40007 -#define ID_TRAYMENU_40008 40008 -#define ID_TRAYMENU_CONFIGUREQUIETHOURS 40009 -#define ID_TRAYMENU_40010 40010 -#define ID_TRAYMENU_MUTEON40011 40011 -#define ID_TRAYMENU_AFTERWARDS 40012 -#define ID_TRAYMENU_40013 40013 -#define ID_TRAYMENU_MUTEONSHUTDOWN 40014 -#define ID_TRAYMENU_40015 40015 -#define ID_TRAYMENU_MUTEONSUSPEND 40016 -#define ID_TRAYMENU_40017 40017 -#define ID_TRAYMENU_MUTEONLOGOUT 40018 -#define ID_TRAYMENU_40019 40019 -#define ID_TRAYMENU_MUTENOW 40020 -#define ID_TRAYMENU_40021 40021 -#define ID_TRAYMENU_EXIT 40022 -#define ID_TRAYMENU_MUTE 40023 -#define ID_TRAYMENU_MUTEONLOCK 40024 -#define ID_TRAYMENU_SETTINGS 40025 -#define ID_TRAYMENU_SCREENTURNSOFF 40026 -#define ID_TRAYMENU_SCREENSUSPEND 40027 -#define ID_TRAYMENU_40028 40028 -#define ID_TRAYMENU_40029 40029 -#define ID_TRAYMENU_BLUETOOTH 40030 -#define ID_TRAYMENU_MUTEONBLUETOOTH 40031 -#define ID_TRAYMENU_MUTEONSCREENSUSPEND 40032 -#define ID_TRAYMENU_SPECIAL 40033 -#define ID_TRAYMENU_40034 40034 -#define ID_TRAYMENU_WIFIMUTING 40035 -#define ID_TRAYMENU_MUTEONWIFI 40036 -#define ID_TRAYMENU_LABEL_MUTEWHEN 40037 -#define ID_TRAYMENU_LABEL_MUTEON 40038 -#define ID_TRAYMENU_MUTEONSCREE 40039 -#define ID_TRAYMENU_LABEL_MUTEON_NO_RESTORE 40040 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 141 -#define _APS_NEXT_COMMAND_VALUE 40041 -#define _APS_NEXT_CONTROL_VALUE 1069 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif