diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/mainwindow.cpp | 14 | ||||
| -rw-r--r-- | src/modlist.cpp | 11 | ||||
| -rw-r--r-- | src/profile.cpp | 4 |
3 files changed, 15 insertions, 14 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 9516f818..10985b0b 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -3293,8 +3293,8 @@ void MainWindow::checkModsForUpdates() void MainWindow::changeVersioningScheme() { if (QMessageBox::question(this, tr("Continue?"), - tr("This will try to change the versioning scheme so that the newest version is interpreted as an update to " - "the installed version."), + tr("The versioning scheme decides which version is considered newer than another.\n" + "This function will guess the versioning scheme under the assumption that the installed version is outdated."), QMessageBox::Yes | QMessageBox::Cancel) == QMessageBox::Yes) { ModInfo::Ptr info = ModInfo::getByIndex(m_ContextRow); @@ -3492,10 +3492,12 @@ void MainWindow::on_modList_customContextMenuRequested(const QPoint &pos) if (info->downgradeAvailable()) { menu.addAction(tr("Change versioning scheme"), this, SLOT(changeVersioningScheme())); } - if (info->updateIgnored()) { - menu.addAction(tr("Un-ignore update"), this, SLOT(unignoreUpdate())); - } else { - menu.addAction(tr("Ignore update"), this, SLOT(ignoreUpdate())); + if (info->updateAvailable() || info->downgradeAvailable()) { + if (info->updateIgnored()) { + menu.addAction(tr("Un-ignore update"), this, SLOT(unignoreUpdate())); + } else { + menu.addAction(tr("Ignore update"), this, SLOT(ignoreUpdate())); + } } menu.addSeparator(); diff --git a/src/modlist.cpp b/src/modlist.cpp index 7367b2ae..786f6f17 100644 --- a/src/modlist.cpp +++ b/src/modlist.cpp @@ -144,15 +144,13 @@ QVariant ModList::data(const QModelIndex &modelIndex, int role) const return modInfo->name(); } else if (column == COL_VERSION) { VersionInfo verInfo = modInfo->getVersion(); - if (role == Qt::EditRole) { - return verInfo.canonicalString(); - } else { - QString version = verInfo.displayString(); + QString version = verInfo.displayString(); + if (role != Qt::EditRole) { if (version.isEmpty() && modInfo->canBeUpdated()) { version = "?"; } - return version; } + return version; } else if (column == COL_PRIORITY) { int priority = modInfo->getFixedPriority(); if (priority != INT_MIN) { @@ -405,7 +403,8 @@ bool ModList::setData(const QModelIndex &index, const QVariant &value, int role) } break; case COL_VERSION: { ModInfo::Ptr info = ModInfo::getByIndex(modID); - VersionInfo version(value.toString()); + VersionInfo::VersionScheme scheme = info->getVersion().scheme(); + VersionInfo version(value.toString(), scheme); if (version.isValid()) { info->setVersion(version); return true; diff --git a/src/profile.cpp b/src/profile.cpp index 3da12d7d..e075a4e6 100644 --- a/src/profile.cpp +++ b/src/profile.cpp @@ -185,7 +185,7 @@ void Profile::writeModlistNow(bool onlyOnTimer) const QString fileName = getModlistFileName(); if (QFile::exists(fileName)) { - shellDelete(QStringList(fileName), false, QApplication::activeModalWidget()); + shellDeleteQuiet(fileName); } if (!file.copy(fileName)) { @@ -205,7 +205,7 @@ void Profile::createTweakedIniFile() { QString tweakedIni = m_Directory.absoluteFilePath("initweaks.ini"); - if (QFile::exists(tweakedIni) && !shellDelete(QStringList(tweakedIni))) { + if (QFile::exists(tweakedIni) && !shellDeleteQuiet(tweakedIni)) { reportError(tr("failed to update tweaked ini file, wrong settings may be used: %1").arg(windowsErrorString(::GetLastError()))); return; } |
