mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
fix(ScreenshotsPage): disable "Copy Image" when selecting multiple screenshots
Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
parent
7a1d2e41a1
commit
08de904e21
1 changed files with 5 additions and 3 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue