From 08de904e21c8baedb78b0a9835fd74fe2c136567 Mon Sep 17 00:00:00 2001 From: Octol1ttle Date: Mon, 13 Apr 2026 23:13:28 +0500 Subject: [PATCH] fix(ScreenshotsPage): disable "Copy Image" when selecting multiple screenshots Signed-off-by: Octol1ttle --- launcher/ui/pages/instance/ScreenshotsPage.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/launcher/ui/pages/instance/ScreenshotsPage.cpp b/launcher/ui/pages/instance/ScreenshotsPage.cpp index 1d85dfd3b..3e4a0098f 100644 --- a/launcher/ui/pages/instance/ScreenshotsPage.cpp +++ b/launcher/ui/pages/instance/ScreenshotsPage.cpp @@ -360,12 +360,14 @@ void ScreenshotsPage::onItemActivated(QModelIndex index) const DesktopServices::openPath(info); } -void ScreenshotsPage::onCurrentSelectionChanged(const QItemSelection& selected) const +void ScreenshotsPage::onCurrentSelectionChanged(const QItemSelection& /*selected*/) const { + const auto selected = ui->listView->selectionModel()->selectedIndexes(); + bool allReadable = !selected.isEmpty(); bool allWritable = !selected.isEmpty(); - for (auto index : selected.indexes()) { + for (auto index : selected) { if (!index.isValid()) { break; } @@ -379,7 +381,7 @@ void ScreenshotsPage::onCurrentSelectionChanged(const QItemSelection& selected) } ui->actionUpload->setEnabled(allReadable); - ui->actionCopy_Image->setEnabled(allReadable); + ui->actionCopy_Image->setEnabled(allReadable && selected.size() == 1); ui->actionCopy_File_s->setEnabled(allReadable); ui->actionDelete->setEnabled(allWritable); ui->actionRename->setEnabled(allWritable);