Connect/disconnect from the menu

This commit is contained in:
simon.kagstrom 2010-03-10 06:37:25 +00:00
parent b5392e248b
commit 6fdceb0a26
2 changed files with 5 additions and 3 deletions

View File

@ -1241,7 +1241,7 @@ bool Network::ConnectToPeer()
void Network::Disconnect()
{
printf("Disconnecting\n");
Gui::gui->status_bar->queueMessage("Disconnecting");
this->ResetNetworkUpdate();
NetworkUpdate *disconnect = InitNetworkUpdate(this->cur_ud, DISCONNECT,

View File

@ -69,7 +69,9 @@ public:
Gui::gui->pushView(Gui::gui->nrv);
break;
case 4:
if ( strncmp(Gui::gui->np->NetworkName, "Unset", strlen("Unset")) == 0)
if (TheC64->network)
TheC64->network->Disconnect();
else if ( strncmp(Gui::gui->np->NetworkName, "Unset", strlen("Unset")) == 0)
Gui::gui->pushDialogueBox(new DialogueBox(network_unset_name_dlg));
else
{
@ -130,7 +132,7 @@ private:
this->messages[2] = this->strs[2];
this->messages[3] = " ";
this->messages[4] = "Connect to the network!";
this->messages[4] = TheC64->network ? "Disconnect" : "Connect to the network!";
this->messages[5] = " ";
this->messages[6] = "Post network message";
this->messages[7] = "Post peer message";