From 3aa7e3221436599a6e1461bb71f2fce9cef7c2ac Mon Sep 17 00:00:00 2001 From: saturneric Date: Sun, 26 Jan 2025 19:52:33 +0100 Subject: feat: add ui ability to switch batch mode --- src/ui/widgets/FileTreeView.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/ui/widgets/FileTreeView.cpp') diff --git a/src/ui/widgets/FileTreeView.cpp b/src/ui/widgets/FileTreeView.cpp index d50f8726..616cffb4 100644 --- a/src/ui/widgets/FileTreeView.cpp +++ b/src/ui/widgets/FileTreeView.cpp @@ -49,7 +49,7 @@ FileTreeView::FileTreeView(QWidget* parent, const QString& target_path) slot_create_popup_menu(); this->setContextMenuPolicy(Qt::CustomContextMenu); - this->setSelectionMode(QAbstractItemView::MultiSelection); + this->setSelectionMode(QAbstractItemView::SingleSelection); connect(this, &QWidget::customContextMenuRequested, this, &FileTreeView::slot_show_custom_context_menu); @@ -439,4 +439,10 @@ void FileTreeView::slot_adjust_column_widths() { } } +void FileTreeView::SlotSwitchBatchMode(bool batch) { + this->setSelectionMode(batch ? QAbstractItemView::MultiSelection + : QAbstractItemView::SingleSelection); + selectionModel()->clearSelection(); +} + } // namespace GpgFrontend::UI -- cgit v1.2.3