Reimplement e129755d properly.

Before this commit, quitting through menu would bring up the dialog
twice when declining to save the file.
This commit is contained in:
whitequark 2016-05-20 21:48:10 +00:00
parent 44c152ccd0
commit daee939714
3 changed files with 4 additions and 5 deletions

View File

@ -1156,8 +1156,6 @@ std::vector<std::string> SolveSpace::GetFontFiles() {
}
- (void)applicationWillTerminate:(NSNotification *)aNotification {
SolveSpace::SK.Clear();
SolveSpace::SS.Clear();
SolveSpace::SS.Exit();
}
@ -1191,5 +1189,8 @@ int main(int argc, const char *argv[]) {
[NSApp activateIgnoringOtherApps:YES];
[NSApp run];
SolveSpace::SK.Clear();
SolveSpace::SS.Clear();
return 0;
}

View File

@ -650,6 +650,7 @@ protected:
}
virtual bool on_delete_event(GdkEventAny *) {
if(!SS.OkayToStartNewFile()) return true;
SS.Exit();
return true;

View File

@ -144,9 +144,6 @@ bool SolveSpaceUI::OpenFile(const std::string &filename) {
}
void SolveSpaceUI::Exit(void) {
if(!OkayToStartNewFile())
return;
// Recent files
for(int i = 0; i < MAX_RECENT; i++)
CnfFreezeString(RecentFile[i], "RecentFile_" + std::to_string(i));