From 64571c7b4dd72fecf6551029ac03079908867b92 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Mon, 19 Sep 2022 11:07:14 -0400 Subject: Actually use update_actions(). --- qdeduper/mingui.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'qdeduper') diff --git a/qdeduper/mingui.cpp b/qdeduper/mingui.cpp index f409187..8811feb 100644 --- a/qdeduper/mingui.cpp +++ b/qdeduper/mingui.cpp @@ -64,6 +64,7 @@ DeduperMainWindow::DeduperMainWindow() this->setFont(QFontDatabase::systemFont(QFontDatabase::SystemFont::FixedFont)); this->setWindowTitle("deduper"); this->setup_menu(); + this->update_actions(); sb = this->statusBar(); sb->addPermanentWidget(permamsg = new QLabel()); QLabel *opm = new QLabel(); @@ -195,7 +196,7 @@ void DeduperMainWindow::setup_menu() menuact["prev_group"] = prvgrp; prvgrp->setShortcut(QKeySequence(Qt::Key::Key_Z)); QObject::connect(prvgrp, &QAction::triggered, [this] { - if (this->sdb && curgroup > 1) + if (this->sdb && curgroup > 0) this->show_group(--curgroup); }); this->addAction(prvgrp); @@ -240,8 +241,12 @@ void DeduperMainWindow::update_actions() { menuact["next_group"]->setEnabled(false); menuact["prev_group"]->setEnabled(false); + menuact["skip_group"]->setEnabled(false); return; } + menuact["skip_group"]->setEnabled(true); + menuact["prev_group"]->setEnabled(curgroup > 0); + menuact["next_group"]->setEnabled(curgroup + 1 < sdb->num_groups()); } void DeduperMainWindow::show_images(const std::vector &fns) @@ -406,6 +411,7 @@ void DeduperMainWindow::show_group(size_t gid) this->show_images(current_set); this->update_distances(sdb->group_distances(gid)); this->update_viewstatus(gid, sdb->num_groups()); + this->update_actions(); } void DeduperMainWindow::mark_toggle(size_t x) -- cgit v1.2.3