diff --git a/lobby.cpp b/lobby.cpp index 9a649be..8a98632 100644 --- a/lobby.cpp +++ b/lobby.cpp @@ -48,6 +48,8 @@ Lobby::Lobby(AOApplication *p_ao_app) : QMainWindow() connect(ui_chatmessage, SIGNAL(returnPressed()), this, SLOT(on_chatfield_return_pressed())); connect(ui_cancel, SIGNAL(clicked()), ao_app, SLOT(loading_cancelled())); + ui_connect->setEnabled(false); + set_widgets(); } @@ -311,6 +313,8 @@ void Lobby::on_server_list_clicked(QModelIndex p_model) ui_player_count->setText("Offline"); + ui_connect->setEnabled(false); + ao_app->net_manager->connect_to_server(f_server); } @@ -371,6 +375,11 @@ void Lobby::set_player_count(int players_online, int max_players) ui_player_count->setText(f_string); } +void Lobby::enable_connect_button() +{ + ui_connect->setEnabled(true); +} + Lobby::~Lobby() { diff --git a/lobby.h b/lobby.h index 49d3d80..19276a7 100644 --- a/lobby.h +++ b/lobby.h @@ -37,6 +37,7 @@ public: void hide_loading_overlay(){ui_loading_background->hide();} QString get_chatlog(); int get_selected_server(); + void enable_connect_button(); void set_loading_value(int p_value); diff --git a/packet_distribution.cpp b/packet_distribution.cpp index a0d3cca..6a11958 100644 --- a/packet_distribution.cpp +++ b/packet_distribution.cpp @@ -206,6 +206,8 @@ void AOApplication::server_packet_received(AOPacket *p_packet) arup_enabled = true; if (f_packet.contains("modcall_reason",Qt::CaseInsensitive)) modcall_reason_enabled = true; + + w_lobby->enable_connect_button(); } else if (header == "PN") {