]> repos.lx-s.de Git - winmute.git/commitdiff
Added double click on quiet hours entry
authorlx-s <lx-s@users.noreply.github.com>
Sun, 8 Mar 2026 08:58:26 +0000 (09:58 +0100)
committerlx-s <lx-s@users.noreply.github.com>
Sun, 8 Mar 2026 08:58:26 +0000 (09:58 +0100)
Translations/lang-de.json
Translations/lang-en.json
WinMute/Settings_QuietHoursDlg.cpp

index 051462752d9c9bb89c2bbcba3ed75c747e123169..d2df353bb4c7820ca91f3abcb34910416b508560 100644 (file)
@@ -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",
index f62e52d10b21419fac547009ca824aa5ac894335..3f6bb7d34ecaea970f0850f4c8f9ce76d0bb7a6a 100644 (file)
   "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",
index 68645ea52314d6295fe929f286cda086fdff0dae..9eb5c798baef586f29c00c93ea5936489820395d 100644 (file)
@@ -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<const NMHDR *>(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<const LPNMITEMACTIVATE>(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<std::pair<DWORD, DWORD>> 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<QuietHoursEntry *>(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<LPARAM>(&editCopy)) == 0)
-               {
-                  if (HasOverlapWithExistingEntries(hQuietHoursTimes, &editCopy, sel))
-                  {
+                       reinterpret_cast<LPARAM>(&editCopy)) == 0) {
+                  if (HasOverlapWithExistingEntries(hQuietHoursTimes, &editCopy, sel)) {
                      ShowOverlapError(hDlg);
-                  }
-                  else
-                  {
+                  } else {
                      entry->start = editCopy.start;
                      entry->end = editCopy.end;
                      UpdateListViewItem(hQuietHoursTimes, sel, entry);