From e69210b3a78c4a6c63086d84e6bdb2c3b47d8944 Mon Sep 17 00:00:00 2001 From: Tannin Date: Sat, 18 Jan 2014 19:51:58 +0100 Subject: - when a download server returns a text file, it's assumed to be an error and the text displayed as an error - save games can now be deleted from inside MO - bugfix: removing the pending download entry failed if the download-url request failed - bugfix: download manager didn't stop automatically resuming failed downloads under certain circumstances - bugfix: uninstalled downloads were treated as not-finished when refreshing the download list - bugfix: updating the filesystem watcher on the saves directory didn't work correctly --- src/mainwindow.cpp | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 14e27e76..582bc283 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -66,6 +66,7 @@ along with Mod Organizer. If not, see . #include #include #include +#include #include #include #include @@ -1737,6 +1738,9 @@ void MainWindow::refreshSaveList() savesDir.setPath(QDir::fromNativeSeparators(ToQString(GameInfo::instance().getDocumentsDir() + L"\\" + path))); } + if (m_SavesWatcher.directories().length() > 0) { + m_SavesWatcher.removePaths(m_SavesWatcher.directories()); + } m_SavesWatcher.addPath(savesDir.absolutePath()); QStringList filters; @@ -3868,6 +3872,22 @@ void MainWindow::on_categoriesList_itemSelectionChanged() } +void MainWindow::deleteSavegame_clicked() +{ + QListWidgetItem *selectedItem = ui->savegameList->item(m_SelectedSaveGame); + if (selectedItem == NULL) { + return; + } + + QString fileName = selectedItem->data(Qt::UserRole).toString(); + + if (QMessageBox::question(this, tr("Confirm"), tr("Really delete \"%1\"?").arg(selectedItem->text()), + QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) { + shellDelete(QStringList() << fileName); + } +} + + void MainWindow::fixMods_clicked() { QListWidgetItem *selectedItem = ui->savegameList->item(m_SelectedSaveGame); @@ -3973,6 +3993,7 @@ void MainWindow::on_savegameList_customContextMenuRequested(const QPoint &pos) QMenu menu; menu.addAction(tr("Fix Mods..."), this, SLOT(fixMods_clicked())); + menu.addAction(tr("Delete"), this, SLOT(deleteSavegame_clicked())); menu.exec(ui->savegameList->mapToGlobal(pos)); } @@ -4721,7 +4742,7 @@ void MainWindow::nxmDownloadURLs(int, int, QVariant, QVariant resultData, int) } -void MainWindow::nxmRequestFailed(int modID, QVariant, int, const QString &errorString) +void MainWindow::nxmRequestFailed(int modID, int, QVariant, int, const QString &errorString) { if (modID == -1) { // must be the update-check that failed -- cgit v1.3.1