From b0fe23a71188757095b7917db5139a089266c256 Mon Sep 17 00:00:00 2001 From: Tannin Date: Thu, 22 Jan 2015 19:50:51 +0100 Subject: bugfix: When displaying the list of save games to delete the list is capped to 10 entries, otherwise the window may extend beyond the screen --- src/mainwindow.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 17308ab8..97ba1da1 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -4051,15 +4051,24 @@ void MainWindow::deleteSavegame_clicked() QString savesMsgLabel; QStringList deleteFiles; + int count = 0; + foreach (const QModelIndex &idx, selectedIndexes) { QString name = idx.data().toString(); SaveGame *save = new SaveGame(this, idx.data(Qt::UserRole).toString()); - savesMsgLabel += "
  • " + QFileInfo(name).completeBaseName() + "
  • "; + if (count < 10) { + savesMsgLabel += "
  • " + QFileInfo(name).completeBaseName() + "
  • "; + } + ++count; deleteFiles << save->saveFiles(); } + if (count > 10) { + savesMsgLabel += "
  • ... " + tr("%1 more").arg(count - 10) + "
  • "; + } + if (QMessageBox::question(this, tr("Confirm"), tr("Are you sure you want to remove the following %n save(s)?

    Removed saves will be sent to the Recycle Bin.", "", selectedIndexes.count()) .arg(savesMsgLabel), QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) { -- cgit v1.3.1