From b41305a7ef92977fe24d365393242e963ceed40f Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Fri, 23 Sep 2022 00:52:40 -0400 Subject: Add menu item for single item mode. --- qdeduper/mingui.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/qdeduper/mingui.cpp b/qdeduper/mingui.cpp index 29cf416..4f5b854 100644 --- a/qdeduper/mingui.cpp +++ b/qdeduper/mingui.cpp @@ -146,6 +146,7 @@ DeduperMainWindow::DeduperMainWindow() QTimer::singleShot(5, [this, i] { lv->scrollTo(im->index(i, 0), QAbstractItemView::ScrollHint::PositionAtTop);}); } + menuact["single_mode_toggle"]->setChecked(id->is_single_item_mode()); }); selhk.push_back(ca); } @@ -302,6 +303,14 @@ void DeduperMainWindow::setup_menu() }); this->addAction(skip); + view->addSeparator(); + QAction *singlemode = view->addAction("Single Item Mode"); + singlemode->setCheckable(true); + menuact["single_mode_toggle"] = singlemode; + QObject::connect(singlemode, &QAction::triggered, [this] (bool c) { + id->set_single_item_mode(c); + }); + view->addSeparator(); QMenu *sort = view->addMenu("Sort by"); sort->addAction("File size"); -- cgit v1.2.3