aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/widgets/FileTreeView.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2025-01-26 18:52:33 +0000
committersaturneric <[email protected]>2025-01-26 18:52:33 +0000
commit3aa7e3221436599a6e1461bb71f2fce9cef7c2ac (patch)
treec07c3701a05bbee4f6975ca790dc5a5a84bac593 /src/ui/widgets/FileTreeView.cpp
parentfix: improve code compatibility (diff)
downloadGpgFrontend-3aa7e3221436599a6e1461bb71f2fce9cef7c2ac.tar.gz
GpgFrontend-3aa7e3221436599a6e1461bb71f2fce9cef7c2ac.zip
feat: add ui ability to switch batch mode
Diffstat (limited to 'src/ui/widgets/FileTreeView.cpp')
-rw-r--r--src/ui/widgets/FileTreeView.cpp8
1 files changed, 7 insertions, 1 deletions
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