diff --git a/launcher/lobby/lobby.cpp b/launcher/lobby/lobby.cpp index 29201780b..126c62a33 100644 --- a/launcher/lobby/lobby.cpp +++ b/launcher/lobby/lobby.cpp @@ -30,6 +30,7 @@ void SocketLobby::connectServer(const QString & host, int port, const QString & if(!socket->waitForDisconnected(timeout) && !isConnected) { emit text("Error: " + socket->errorString()); + emit disconnect(); } } diff --git a/launcher/lobby/lobby_moc.cpp b/launcher/lobby/lobby_moc.cpp index 0df92824e..fd12700d6 100644 --- a/launcher/lobby/lobby_moc.cpp +++ b/launcher/lobby/lobby_moc.cpp @@ -40,6 +40,8 @@ void Lobby::serverCommand(const ServerCommand & command) try case SRVERROR: protocolAssert(args.size()); chatMessage("System error", args[0], true); + if(authentificationStatus == 0) + authentificationStatus = 2; break; case CREATED: @@ -138,6 +140,11 @@ void Lobby::serverCommand(const ServerCommand & command) try chatMessage(args[0], msg); break; } + + if(authentificationStatus == 2) + socketLobby.disconnectServer(); + else + authentificationStatus = 1; } catch(const ProtocolError & e) { @@ -170,6 +177,7 @@ catch(const ProtocolError & e) void Lobby::onDisconnected() { + authentificationStatus = 0; ui->stackedWidget->setCurrentWidget(ui->sessionsPage); ui->connectButton->setChecked(false); } @@ -209,6 +217,7 @@ void Lobby::on_connectButton_toggled(bool checked) { if(checked) { + authentificationStatus = 0; username = ui->userEdit->text(); const int connectionTimeout = settings["launcher"]["connectionTimeout"].Integer(); diff --git a/launcher/lobby/lobby_moc.h b/launcher/lobby/lobby_moc.h index ee5782bdb..605bc9ef3 100644 --- a/launcher/lobby/lobby_moc.h +++ b/launcher/lobby/lobby_moc.h @@ -42,6 +42,8 @@ private: QString username; QStringList gameArgs; + int authentificationStatus = 0; + private: void protocolAssert(bool); }; diff --git a/launcher/mainwindow_moc.cpp b/launcher/mainwindow_moc.cpp index c6b3994f7..9a828178a 100644 --- a/launcher/mainwindow_moc.cpp +++ b/launcher/mainwindow_moc.cpp @@ -85,9 +85,9 @@ MainWindow::MainWindow(QWidget * parent) } ui->tabListWidget->setCurrentIndex(0); - ui->settingsView->isExtraResolutionsModEnabled = ui->stackedWidgetPage2->isExtraResolutionsModEnabled(); + ui->settingsView->isExtraResolutionsModEnabled = ui->modlistView->isExtraResolutionsModEnabled(); ui->settingsView->setDisplayList(); - connect(ui->stackedWidgetPage2, &CModListView::extraResolutionsEnabledChanged, + connect(ui->modlistView, &CModListView::extraResolutionsEnabledChanged, ui->settingsView, &CSettingsView::fillValidResolutions); connect(ui->tabSelectList, &QListWidget::currentRowChanged, [this](int i) { diff --git a/launcher/mainwindow_moc.ui b/launcher/mainwindow_moc.ui index 446488ef0..4c23a1ff2 100644 --- a/launcher/mainwindow_moc.ui +++ b/launcher/mainwindow_moc.ui @@ -152,9 +152,9 @@ - 2 + 0 - + diff --git a/launcher/modManager/cmodlistview_moc.cpp b/launcher/modManager/cmodlistview_moc.cpp index 351564527..00f575964 100644 --- a/launcher/modManager/cmodlistview_moc.cpp +++ b/launcher/modManager/cmodlistview_moc.cpp @@ -825,3 +825,9 @@ void CModListView::on_showInfoButton_clicked() { showModInfo(); } + +const CModList & CModListView::getModList() const +{ + assert(modModel); + return *modModel; +} diff --git a/launcher/modManager/cmodlistview_moc.h b/launcher/modManager/cmodlistview_moc.h index 2cc93f64e..688a79d05 100644 --- a/launcher/modManager/cmodlistview_moc.h +++ b/launcher/modManager/cmodlistview_moc.h @@ -18,6 +18,7 @@ class CModListView; } class CModManager; +class CModList; class CModListModel; class CModFilterModel; class CDownloadManager; @@ -80,6 +81,8 @@ public: void selectMod(const QModelIndex & index); bool isExtraResolutionsModEnabled() const; + const CModList & getModList() const; + private slots: void dataChanged(const QModelIndex & topleft, const QModelIndex & bottomRight); void modSelected(const QModelIndex & current, const QModelIndex & previous);