aboutsummaryrefslogtreecommitdiff
path: root/qdeduper
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2022-09-19 11:07:14 -0400
committerGravatar Chris Xiong <chirs241097@gmail.com> 2022-09-19 11:07:14 -0400
commit64571c7b4dd72fecf6551029ac03079908867b92 (patch)
tree2c5aa0936c5e72df8950cb5acca03a0a597b6220 /qdeduper
parent6bb947010cdb8fd195accf66cb025d163c298ddf (diff)
downloaddeduper-64571c7b4dd72fecf6551029ac03079908867b92.tar.xz
Actually use update_actions().
Diffstat (limited to 'qdeduper')
-rw-r--r--qdeduper/mingui.cpp8
1 files changed, 7 insertions, 1 deletions
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<fs::path> &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)