Fixed warnings panel
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@569 72836036-5685-4462-b002-a69064685172
This commit is contained in:
parent
79ae31b1c7
commit
62a55c0a91
2 changed files with 38 additions and 8 deletions
|
@ -43,14 +43,7 @@ public class ApplicationControl {
|
|||
|
||||
addQuitGameHandlers();
|
||||
|
||||
view.getNetworkGameEvent().add(new IListener() {
|
||||
@Override
|
||||
public void handle() {
|
||||
abortControls();
|
||||
|
||||
createLoginControl(true);
|
||||
}
|
||||
});
|
||||
addNewNetworkGameHandler();
|
||||
|
||||
saveControl.getLoadEvent().add(
|
||||
new IListener3<GameSettings, GameState, IRoundState>() {
|
||||
|
@ -72,6 +65,33 @@ public class ApplicationControl {
|
|||
});
|
||||
}
|
||||
|
||||
private void addNewNetworkGameHandler() {
|
||||
view.getNetworkGameEvent().add(new IListener() {
|
||||
@Override
|
||||
public void handle() {
|
||||
if (gameControl == null) {
|
||||
abortControls();
|
||||
createLoginControl(true);
|
||||
} else {
|
||||
showQuitWarning();
|
||||
}
|
||||
view.getQuitWarningPanel().setMode(QuitMode.QUIT_PROCESS);
|
||||
view.showQuitWarningPanel(true);
|
||||
tempConnection = view.getQuitWarningPanel().getQuitEvent()
|
||||
.add(new IListener() {
|
||||
@Override
|
||||
public void handle() {
|
||||
abortControls();
|
||||
createLoginControl(true);
|
||||
tempConnection.remove();
|
||||
tempConnection = null;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void addQuitGameHandlers() {
|
||||
view.getMenuNewGameEvent().add(new IListener() {
|
||||
@Override
|
||||
|
|
|
@ -60,6 +60,16 @@ public class SaveControl {
|
|||
});
|
||||
}
|
||||
});
|
||||
view.getQuitWarningPanel().getCancelEvent().add(new IListener() {
|
||||
@Override
|
||||
public void handle() {
|
||||
view.showQuitWarningPanel(false);
|
||||
if (tempConnection != null) {
|
||||
tempConnection.remove();
|
||||
tempConnection = null;
|
||||
}
|
||||
}
|
||||
});
|
||||
view.getLoadFileEvent().add(new IListener1<File>() {
|
||||
@Override
|
||||
public void handle(final File file) {
|
||||
|
|
Reference in a new issue