From: lx-s Date: Sun, 8 Mar 2026 08:58:26 +0000 (+0100) Subject: Added double click on quiet hours entry X-Git-Tag: 2.6.0.0~103^2~3 X-Git-Url: https://repos.lx-s.de/gitweb/?a=commitdiff_plain;h=6d62eada5146d16d59e756ad8d75c54a6d21c55b;p=winmute.git Added double click on quiet hours entry --- diff --git a/Translations/lang-de.json b/Translations/lang-de.json index 0514627..d2df353 100644 --- a/Translations/lang-de.json +++ b/Translations/lang-de.json @@ -92,8 +92,8 @@ "settings.mute.try-resume-media-on-unmute": "Versuche Medien beim Wiederherstellen wieder abzuspielen.", "settings.quiet-hours.intro": "Während der Ruhezeit schaltet WinMute alle Audiogeräte auf Stumm und stellt anschließend die Lautstärke wieder her.", "settings.quiet-hours.enable": "Ruhzeit aktivieren", - "settings.quiet-hours.start-time-label": "Beginn:", - "settings.quiet-hours.end-time-label": "Ende:", + "settings.quiet-hours.start-time-label": "Beginn", + "settings.quiet-hours.end-time-label": "Ende", "settings.quiet-hours.force-unmute": "Lautstärkewiederherstellung erzwingen", "settings.quiet-hours.force-unmute-description": "Die Lautstärke wird von allen Audiogeräten wiederhergestellt, unabhängig davon ob diese vor der Ruhezeit stumm geschaltet waren, oder nicht.", "settings.quiet-hours.show-notifications": "Benachrichtigungen zur Ruhezeit anzeigen", diff --git a/Translations/lang-en.json b/Translations/lang-en.json index f62e52d..3f6bb7d 100644 --- a/Translations/lang-en.json +++ b/Translations/lang-en.json @@ -102,8 +102,8 @@ "settings.mute.try-resume-media-on-unmute": "Try resuming media when unmuting.", "settings.quiet-hours.intro": "During Quiet Hours WinMute automatically mutes the computers audio devices 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.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 devices 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", diff --git a/WinMute/Settings_QuietHoursDlg.cpp b/WinMute/Settings_QuietHoursDlg.cpp index 68645ea..9eb5c79 100644 --- a/WinMute/Settings_QuietHoursDlg.cpp +++ b/WinMute/Settings_QuietHoursDlg.cpp @@ -233,8 +233,7 @@ static INT_PTR CALLBACK Settings_QuietHoursAddDlgProc(HWND hDlg, UINT msg, WPARA return TRUE; } case WM_COMMAND: - if (LOWORD(wParam) == IDOK) - { + if (LOWORD(wParam) == IDOK) { HWND hStart = GetDlgItem(hDlg, IDC_QUIET_HOURS_START_PICKER); HWND hEnd = GetDlgItem(hDlg, IDC_QUIET_HOURS_END_PICKER); SYSTEMTIME start{}; @@ -362,8 +361,7 @@ INT_PTR CALLBACK Settings_QuietHoursDlgProc(HWND hDlg, UINT msg, WPARAM wParam, SetupListView(hQuietHoursTimes); - for (const auto &t : settings->GetQuietHoursTimes()) - { + for (const auto &t : settings->GetQuietHoursTimes()) { auto *entry = new QuietHoursEntry(); entry->start = t.first; entry->end = t.second; @@ -380,11 +378,15 @@ INT_PTR CALLBACK Settings_QuietHoursDlgProc(HWND hDlg, UINT msg, WPARAM wParam, case WM_NOTIFY: { const NMHDR *pnmh = reinterpret_cast(lParam); - if (pnmh->idFrom == IDC_QUIET_HOURS_TIMES && pnmh->code == LVN_ITEMCHANGED) - { + if (pnmh->idFrom == IDC_QUIET_HOURS_TIMES && pnmh->code == LVN_ITEMCHANGED) { HWND hQuietHoursTimes = GetDlgItem(hDlg, IDC_QUIET_HOURS_TIMES); const bool qhEnabled = Button_GetCheck(GetDlgItem(hDlg, IDC_ENABLEQUIETHOURS)) == BST_CHECKED; UpdateButtonStates(hDlg, hQuietHoursTimes, qhEnabled); + } else if (pnmh->idFrom == IDC_QUIET_HOURS_TIMES && pnmh->code == NM_DBLCLK) { + auto nmItemActivate = reinterpret_cast(lParam); + if (nmItemActivate->iItem != -1) { + SendMessage(hDlg, WM_COMMAND, MAKEWPARAM(IDC_QUIET_HOURS_EDIT, 0), 0); + } } return 0; } @@ -403,8 +405,7 @@ INT_PTR CALLBACK Settings_QuietHoursDlgProc(HWND hDlg, UINT msg, WPARAM wParam, const int entries = ListView_GetItemCount(hQuietHoursTimes); std::vector> times; times.reserve(entries); - for (int i = 0; i < entries; ++i) - { + for (int i = 0; i < entries; ++i) { LVITEM lvi{}; lvi.iItem = i; lvi.mask = LVIF_PARAM; @@ -458,8 +459,7 @@ INT_PTR CALLBACK Settings_QuietHoursDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LVITEM lvi{}; lvi.mask = LVIF_PARAM; lvi.iItem = sel; - if (ListView_GetItem(hQuietHoursTimes, &lvi) && lvi.lParam != 0) - { + if (ListView_GetItem(hQuietHoursTimes, &lvi) && lvi.lParam != 0) { QuietHoursEntry *entry = reinterpret_cast(lvi.lParam); QuietHoursEntry editCopy = *entry; if (DialogBoxParam( @@ -467,14 +467,10 @@ INT_PTR CALLBACK Settings_QuietHoursDlgProc(HWND hDlg, UINT msg, WPARAM wParam, MAKEINTRESOURCE(IDD_SETTINGS_QUIETHOURS_ADD), hDlg, Settings_QuietHoursAddDlgProc, - reinterpret_cast(&editCopy)) == 0) - { - if (HasOverlapWithExistingEntries(hQuietHoursTimes, &editCopy, sel)) - { + reinterpret_cast(&editCopy)) == 0) { + if (HasOverlapWithExistingEntries(hQuietHoursTimes, &editCopy, sel)) { ShowOverlapError(hDlg); - } - else - { + } else { entry->start = editCopy.start; entry->end = editCopy.end; UpdateListViewItem(hQuietHoursTimes, sel, entry);