aboutsummaryrefslogtreecommitdiff
path: root/launcher/LaunchController.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/LaunchController.cpp')
-rw-r--r--launcher/LaunchController.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/launcher/LaunchController.cpp b/launcher/LaunchController.cpp
index 792d8381..4cb62e69 100644
--- a/launcher/LaunchController.cpp
+++ b/launcher/LaunchController.cpp
@@ -71,7 +71,10 @@ void LaunchController::executeTask()
return;
}
- JavaCommon::checkJVMArgs(m_instance->settings()->get("JvmArgs").toString(), m_parentWidget);
+ if(!JavaCommon::checkJVMArgs(m_instance->settings()->get("JvmArgs").toString(), m_parentWidget)) {
+ emitFailed(tr("Invalid Java arguments specified. Please fix this first."));
+ return;
+ }
login();
}
@@ -166,13 +169,14 @@ void LaunchController::login() {
if(!m_session->wants_online) {
// we ask the user for a player name
bool ok = false;
- QString usedname = m_session->player_name;
+ QString lastOfflinePlayerName = APPLICATION->settings()->get("LastOfflinePlayerName").toString();
+ QString usedname = lastOfflinePlayerName.isEmpty() ? m_session->player_name : lastOfflinePlayerName;
QString name = QInputDialog::getText(
m_parentWidget,
tr("Player name"),
tr("Choose your offline mode player name."),
QLineEdit::Normal,
- m_session->player_name,
+ usedname,
&ok
);
if (!ok)
@@ -183,6 +187,7 @@ void LaunchController::login() {
if (name.length())
{
usedname = name;
+ APPLICATION->settings()->set("LastOfflinePlayerName", usedname);
}
m_session->MakeOffline(usedname);
// offline flavored game from here :3