Correctly reset network control after a game was aborted

git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@582 72836036-5685-4462-b002-a69064685172
This commit is contained in:
Matthias Schiffer 2011-06-22 07:16:40 +02:00
parent ada8c1869c
commit 936a22ff77

View file

@ -240,6 +240,12 @@ public class NetworkControl {
view.showGameListPanel(false); view.showGameListPanel(false);
view.showConnectPanel(false); view.showConnectPanel(false);
abortControls();
connectionControl.disconnect();
}
private void abortControls() {
if (settingsControl != null) { if (settingsControl != null) {
settingsControl.abort(); settingsControl.abort();
settingsControl = null; settingsControl = null;
@ -256,8 +262,6 @@ public class NetworkControl {
gameControl.abortGame(); gameControl.abortGame();
gameControl = null; gameControl = null;
} }
connectionControl.disconnect();
} }
/** /**
@ -355,6 +359,7 @@ public class NetworkControl {
@Override @Override
public void handle() { public void handle() {
view.setBottomPanel(BottomPanelType.START_GAME_PANEL); view.setBottomPanel(BottomPanelType.START_GAME_PANEL);
abortControls();
view.showGameListPanel(true); view.showGameListPanel(true);
} }
}); });
@ -362,6 +367,7 @@ public class NetworkControl {
@Override @Override
public void handle() { public void handle() {
view.setBottomPanel(BottomPanelType.START_GAME_PANEL); view.setBottomPanel(BottomPanelType.START_GAME_PANEL);
abortControls();
view.showGameListPanel(true); view.showGameListPanel(true);
} }
}); });