From 50683a3b870a10dbf7342503a85be80d72556d87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valdis=20Bogd=C4=81ns?= Date: Fri, 5 Sep 2025 22:51:53 +0300 Subject: [PATCH] Log filters presets feature update (#3529) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Log presets feature - Add “Load Presets…” button in Logger → Log Filter (settings_dialog.ui) - Implement LogPresetsDialog (table: Comment, Filter) - Support add (+), multi-remove (−), load via button or double-click - Persist presets via QSettings at logger_presets/entries (qt_ui.ini) - Wire button to open dialog and set logFilterLineEdit - Update CMakeLists.txt to include new dialog sources * CLang fix * CLang fix again * Log Presets: checkbox selection + tri-state header - Added first column with per-row checkboxes - Implemented header checkbox with tri-state; click toggles select-all/none - Synced checkboxes and row selection in both directions - Header toggle also updates row selection to match - Remove operates on checked rows; falls back to selected rows if none checked - Load uses first checked row; falls back to first selected row - Double-click row triggers the same action as Load - Load button visible only when exactly one row is selected - Remove button visible only when at least one row is selected - Dialog opens with no selected rows and no focused buttons; focus set to table - New rows start editing in the Comment column - Serialization updated for new column indices; checkbox state not persisted - Cleanups: removed unused include and empty helper; pruned temporary comments * Clang * Fix: tri‑state header checkbox visible and aligned - Overlay real QCheckBox in header section 0 (tri‑state) - Align with row checkboxes using SE_ItemViewItemCheckIndicator - Reposition on header resize and geometry changes - Header click + checkbox click toggle select‑all/none - Tri‑state reflects per‑row checkbox states * CLang * feat: add clear button to Log Filter input field --------- Co-authored-by: w1naenator --- src/qt_gui/settings_dialog.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/qt_gui/settings_dialog.cpp b/src/qt_gui/settings_dialog.cpp index c46e2b8e3..5a77f633e 100644 --- a/src/qt_gui/settings_dialog.cpp +++ b/src/qt_gui/settings_dialog.cpp @@ -88,6 +88,9 @@ SettingsDialog::SettingsDialog(std::shared_ptr gui_settings, ui->setupUi(this); ui->tabWidgetSettings->setUsesScrollButtons(false); + // Add a small clear "x" button inside the Log Filter input + ui->logFilterLineEdit->setClearButtonEnabled(true); + initialHeight = this->height(); const auto config_dir = Common::FS::GetUserPath(Common::FS::PathType::UserDir);