Use status bar messages

This commit is contained in:
simon.kagstrom 2010-02-14 09:24:49 +00:00
parent b7cf3c9aff
commit a28575b7ce

View File

@ -28,6 +28,7 @@
#include "utils.hh" #include "utils.hh"
#include "data_store.hh" #include "data_store.hh"
#include "gui/gui.hh" #include "gui/gui.hh"
#include "gui/status_bar.hh"
#include "gui/network_user_menu.hh" #include "gui/network_user_menu.hh"
#if defined(GEKKO) #if defined(GEKKO)
@ -1272,10 +1273,12 @@ network_connection_error_t Network::ConnectFSM()
{ {
case CONN_CONNECT_TO_BROKER: case CONN_CONNECT_TO_BROKER:
{ {
Gui::gui->status_bar->queueMessage("Connecting to broker...");
if (this->ConnectToBroker()) if (this->ConnectToBroker())
this->network_connection_state = CONN_WAIT_FOR_PEER_LIST; this->network_connection_state = CONN_WAIT_FOR_PEER_LIST;
} break; } break;
case CONN_WAIT_FOR_PEER_ADDRESS: case CONN_WAIT_FOR_PEER_ADDRESS:
Gui::gui->status_bar->queueMessage("Waiting for connection...");
TheC64->TheDisplay->display_status_string((char*)"WAITING FOR CONNECTION...", 1); TheC64->TheDisplay->display_status_string((char*)"WAITING FOR CONNECTION...", 1);
err = this->WaitForPeerAddress(); err = this->WaitForPeerAddress();
if (err == OK) if (err == OK)
@ -1284,6 +1287,7 @@ network_connection_error_t Network::ConnectFSM()
return err; return err;
break; break;
case CONN_WAIT_FOR_PEER_LIST: case CONN_WAIT_FOR_PEER_LIST:
Gui::gui->status_bar->queueMessage("Waiting for peer list...");
/* Also tells the broker that we want to connect */ /* Also tells the broker that we want to connect */
return this->WaitForPeerList(); return this->WaitForPeerList();
break; break;
@ -1301,6 +1305,7 @@ network_connection_error_t Network::ConnectFSM()
return err; return err;
break; break;
case CONN_CONNECT_TO_PEER: case CONN_CONNECT_TO_PEER:
Gui::gui->status_bar->queueMessage("Connecting to peer...");
if (this->ConnectToPeer() == false) if (this->ConnectToPeer() == false)
return AGAIN_ERROR; return AGAIN_ERROR;
/* Allow some transit time */ /* Allow some transit time */
@ -1312,7 +1317,6 @@ network_connection_error_t Network::ConnectFSM()
case CONN_WAIT_FOR_PEER_REPLY: case CONN_WAIT_FOR_PEER_REPLY:
/* Connect again in case the first sent was dropped on /* Connect again in case the first sent was dropped on
* its way to the peer */ * its way to the peer */
TheC64->TheDisplay->display_status_string((char*)"CONNECTING TO PEER", 1);
if (this->WaitForPeerReply() == true) if (this->WaitForPeerReply() == true)
this->network_connection_state = CONN_BANDWIDTH_PING; this->network_connection_state = CONN_BANDWIDTH_PING;
else else
@ -1336,7 +1340,7 @@ network_connection_error_t Network::ConnectFSM()
return err; return err;
} break; } break;
case CONN_CONNECTED: case CONN_CONNECTED:
TheC64->TheDisplay->display_status_string((char*)"CONNECTED!", 2); Gui::gui->status_bar->queueMessage("Connected!");
/* The lowest number is the default master */ /* The lowest number is the default master */
default: default:
return OK; return OK;