summaryrefslogtreecommitdiff
path: root/src/createinstancedialogpages.cpp
diff options
context:
space:
mode:
authorMikaël Capelle <capelle.mikael@gmail.com>2024-05-26 11:09:56 +0200
committerMikaël Capelle <capelle.mikael@gmail.com>2024-05-26 11:12:08 +0200
commit1871f32a8db7e707a6d96a41f09147d8558e0003 (patch)
tree9408b610e0373dbf8ff48c04a1dd0ad7098c79b4 /src/createinstancedialogpages.cpp
parentfa82d1cca1544c401bc06c341ce265a346a498b9 (diff)
Use `lootGameName()` and `displayGameName()` in initial places. (#2030)
* Use `displayGameName()` in create instance dialogs & the main window, this doesn't cover all places `gameName()` was being used for purely display reasons, but it covers the bulk. * Use `lootGameName()` instead of `gameShortName()` for LOOT cli initiation. * Use game display name in status bar. --------- Co-authored-by: Twinki <Twinki@users.noreply.github.com>
Diffstat (limited to 'src/createinstancedialogpages.cpp')
-rw-r--r--src/createinstancedialogpages.cpp32
1 files changed, 18 insertions, 14 deletions
diff --git a/src/createinstancedialogpages.cpp b/src/createinstancedialogpages.cpp
index 27bd4062..66f4c31c 100644
--- a/src/createinstancedialogpages.cpp
+++ b/src/createinstancedialogpages.cpp
@@ -296,7 +296,8 @@ void GamePage::select(IPluginGame* game, const QString& dir)
// ask the user
const auto path = QFileDialog::getExistingDirectory(
- &m_dlg, QObject::tr("Find game installation for %1").arg(game->gameName()));
+ &m_dlg,
+ QObject::tr("Find game installation for %1").arg(game->displayGameName()));
if (path.isEmpty()) {
// cancelled
@@ -388,7 +389,7 @@ void GamePage::warnUnrecognized(const QString& path)
// put the list of supported games in the details textbox
QString supportedGames;
for (auto* game : sortedGamePlugins()) {
- supportedGames += game->gameName() + "\n";
+ supportedGames += game->displayGameName() + "\n";
}
QMessageBox dlg(&m_dlg);
@@ -417,7 +418,7 @@ std::vector<IPluginGame*> GamePage::sortedGamePlugins() const
// natsort
std::sort(v.begin(), v.end(), [](auto* a, auto* b) {
- return (naturalCompare(a->gameName(), b->gameName()) < 0);
+ return (naturalCompare(a->displayGameName(), b->displayGameName()) < 0);
});
return v;
@@ -469,7 +470,7 @@ void GamePage::updateButton(Game* g)
return;
}
- g->button->setText(g->game->gameName().replace("&", "&&"));
+ g->button->setText(g->game->displayGameName().replace("&", "&&"));
g->button->setIcon(g->game->gameIcon());
if (g->installed) {
@@ -570,7 +571,8 @@ void GamePage::fillList()
continue;
}
- if (!m_filter.matches(g->game->gameName())) {
+ if (!m_filter.matches(g->game->gameName()) &&
+ !m_filter.matches(g->game->displayGameName())) {
// filtered out
continue;
}
@@ -667,9 +669,10 @@ bool GamePage::confirmMicrosoftStore(const QString& path, IPluginGame* game)
"Organizer"
" and will not work properly.")
.arg(path))
- .button({game ? QObject::tr("Use this folder for %1").arg(game->gameName())
- : QObject::tr("Use this folder"),
- QObject::tr("I know what I'm doing"), QMessageBox::Ignore})
+ .button(
+ {game ? QObject::tr("Use this folder for %1").arg(game->displayGameName())
+ : QObject::tr("Use this folder"),
+ QObject::tr("I know what I'm doing"), QMessageBox::Ignore})
.button({QObject::tr("Cancel"), QMessageBox::Cancel})
.exec();
@@ -688,8 +691,8 @@ bool GamePage::confirmUnknown(const QString& path, IPluginGame* game)
"bold;\">%2</span> or "
"for any other game Mod Organizer can manage.")
.arg(path)
- .arg(game->gameName()))
- .button({QObject::tr("Use this folder for %1").arg(game->gameName()),
+ .arg(game->displayGameName()))
+ .button({QObject::tr("Use this folder for %1").arg(game->displayGameName()),
QObject::tr("I know what I'm doing"), QMessageBox::Ignore})
.button({QObject::tr("Cancel"), QMessageBox::Cancel})
.exec();
@@ -711,11 +714,12 @@ IPluginGame* GamePage::confirmOtherGame(const QString& path, IPluginGame* select
"not "
"<span style=\"white-space: nowrap; font-weight: bold;\">%3</span>.")
.arg(path)
- .arg(guessedGame->gameName())
- .arg(selectedGame->gameName()))
- .button({QObject::tr("Manage %1 instead").arg(guessedGame->gameName()),
+ .arg(guessedGame->displayGameName())
+ .arg(selectedGame->displayGameName()))
+ .button({QObject::tr("Manage %1 instead").arg(guessedGame->displayGameName()),
QMessageBox::Ok})
- .button({QObject::tr("Use this folder for %1").arg(selectedGame->gameName()),
+ .button({QObject::tr("Use this folder for %1")
+ .arg(selectedGame->displayGameName()),
QObject::tr("I know what I'm doing"), QMessageBox::Ignore})
.button({QObject::tr("Cancel"), QMessageBox::Cancel})
.exec();