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:
parent
44c152ccd0
commit
daee939714
|
@ -1156,8 +1156,6 @@ std::vector<std::string> SolveSpace::GetFontFiles() {
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)applicationWillTerminate:(NSNotification *)aNotification {
|
- (void)applicationWillTerminate:(NSNotification *)aNotification {
|
||||||
SolveSpace::SK.Clear();
|
|
||||||
SolveSpace::SS.Clear();
|
|
||||||
SolveSpace::SS.Exit();
|
SolveSpace::SS.Exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1191,5 +1189,8 @@ int main(int argc, const char *argv[]) {
|
||||||
[NSApp activateIgnoringOtherApps:YES];
|
[NSApp activateIgnoringOtherApps:YES];
|
||||||
[NSApp run];
|
[NSApp run];
|
||||||
|
|
||||||
|
SolveSpace::SK.Clear();
|
||||||
|
SolveSpace::SS.Clear();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -650,6 +650,7 @@ protected:
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool on_delete_event(GdkEventAny *) {
|
virtual bool on_delete_event(GdkEventAny *) {
|
||||||
|
if(!SS.OkayToStartNewFile()) return true;
|
||||||
SS.Exit();
|
SS.Exit();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -144,9 +144,6 @@ bool SolveSpaceUI::OpenFile(const std::string &filename) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SolveSpaceUI::Exit(void) {
|
void SolveSpaceUI::Exit(void) {
|
||||||
if(!OkayToStartNewFile())
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Recent files
|
// Recent files
|
||||||
for(int i = 0; i < MAX_RECENT; i++)
|
for(int i = 0; i < MAX_RECENT; i++)
|
||||||
CnfFreezeString(RecentFile[i], "RecentFile_" + std::to_string(i));
|
CnfFreezeString(RecentFile[i], "RecentFile_" + std::to_string(i));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user