/**
* Asks the user for confirmation if needed, then quits.
*/
public void tryQuit() {
YesNoCancel shouldStop = YesNoCancel.NO;
if (model.isServerStartedOrAboutTo() && mainView != null) {
shouldStop = mainView.askToStop();
}
if (shouldStop != YesNoCancel.CANCEL) {
doQuit(shouldStop == YesNoCancel.YES, true);