diff options
| author | Tannin <devnull@localhost> | 2015-01-22 19:50:51 +0100 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2015-01-22 19:50:51 +0100 |
| commit | b0fe23a71188757095b7917db5139a089266c256 (patch) | |
| tree | ea1785dae88ac72dc788c159529bd857d633259a /src/mainwindow.cpp | |
| parent | c2edbcf90ff78bb6040cdcd8538468d6e3d1d42e (diff) | |
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
Diffstat (limited to 'src/mainwindow.cpp')
| -rw-r--r-- | src/mainwindow.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
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 += "<li>" + QFileInfo(name).completeBaseName() + "</li>"; + if (count < 10) { + savesMsgLabel += "<li>" + QFileInfo(name).completeBaseName() + "</li>"; + } + ++count; deleteFiles << save->saveFiles(); } + if (count > 10) { + savesMsgLabel += "<li><i>... " + tr("%1 more").arg(count - 10) + "</i></li>"; + } + if (QMessageBox::question(this, tr("Confirm"), tr("Are you sure you want to remove the following %n save(s)?<br><ul>%1</ul><br>Removed saves will be sent to the Recycle Bin.", "", selectedIndexes.count()) .arg(savesMsgLabel), QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) { |
