summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTannin <devnull@localhost>2013-10-06 13:34:34 +0200
committerTannin <devnull@localhost>2013-10-06 13:34:34 +0200
commit823dfd410b90407cf6a641226bc46291f23d0004 (patch)
tree430e9814c213899eaa937b2ca5d522d2874a1fde /src
parentba09054e6b22a134de03903ad91a206b9bbbb5d4 (diff)
- option to ignore/unignore updates is now only shown if there IS an update
- window now shouldn't lose focus on win 8 2 seconds after mod information gets invalidated - small bugfix related to new version scheme parsing
Diffstat (limited to 'src')
-rw-r--r--src/mainwindow.cpp14
-rw-r--r--src/modlist.cpp11
-rw-r--r--src/profile.cpp4
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;
}