Log presets feature (#3509)

* 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

---------

Co-authored-by: w1naenator <valdis.bogdans@hotmail.com>
This commit is contained in:
Valdis Bogdāns
2025-09-05 09:50:59 +03:00
committed by GitHub
parent b2269f628a
commit 5f0b13ac57
5 changed files with 486 additions and 0 deletions

View File

@@ -26,6 +26,7 @@
#include "background_music_player.h"
#include "common/logging/backend.h"
#include "common/logging/filter.h"
#include "log_presets_dialog.h"
#include "settings_dialog.h"
#include "ui_settings_dialog.h"
#include "video_core/renderer_vulkan/vk_instance.h"
@@ -386,6 +387,14 @@ SettingsDialog::SettingsDialog(std::shared_ptr<gui_settings> gui_settings,
Common::FS::GetUserPath(Common::FS::PathType::LogDir));
QDesktopServices::openUrl(QUrl::fromLocalFile(userPath));
});
// Log presets popup button
connect(ui->logPresetsButton, &QPushButton::clicked, this, [this]() {
auto dlg = new LogPresetsDialog(m_gui_settings, this);
connect(dlg, &LogPresetsDialog::PresetChosen, this,
[this](const QString& filter) { ui->logFilterLineEdit->setText(filter); });
dlg->exec();
});
}
// GRAPHICS TAB