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
9c08398f51
commit
ddc0dd7194
@ -1176,8 +1176,6 @@ const void *SolveSpace::LoadResource(const std::string &name, size_t *size) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)applicationWillTerminate:(NSNotification *)aNotification {
|
- (void)applicationWillTerminate:(NSNotification *)aNotification {
|
||||||
SolveSpace::SK.Clear();
|
|
||||||
SolveSpace::SS.Clear();
|
|
||||||
SolveSpace::SS.Exit();
|
SolveSpace::SS.Exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1211,5 +1209,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;
|
||||||
}
|
}
|
||||||
|
@ -642,6 +642,7 @@ protected:
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool on_delete_event(GdkEventAny *) override {
|
bool on_delete_event(GdkEventAny *) override {
|
||||||
|
if(!SS.OkayToStartNewFile()) return true;
|
||||||
SS.Exit();
|
SS.Exit();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -147,9 +147,6 @@ bool SolveSpaceUI::OpenFile(const std::string &filename) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SolveSpaceUI::Exit() {
|
void SolveSpaceUI::Exit() {
|
||||||
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