Reimplement e129755d
properly.
Before this commit, quitting through menu would bring up the dialog twice when declining to save the file.pull/10/head
parent
9c08398f51
commit
ddc0dd7194
|
@ -1176,8 +1176,6 @@ const void *SolveSpace::LoadResource(const std::string &name, size_t *size) {
|
|||
}
|
||||
|
||||
- (void)applicationWillTerminate:(NSNotification *)aNotification {
|
||||
SolveSpace::SK.Clear();
|
||||
SolveSpace::SS.Clear();
|
||||
SolveSpace::SS.Exit();
|
||||
}
|
||||
|
||||
|
@ -1211,5 +1209,8 @@ int main(int argc, const char *argv[]) {
|
|||
[NSApp activateIgnoringOtherApps:YES];
|
||||
[NSApp run];
|
||||
|
||||
SolveSpace::SK.Clear();
|
||||
SolveSpace::SS.Clear();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -642,6 +642,7 @@ protected:
|
|||
}
|
||||
|
||||
bool on_delete_event(GdkEventAny *) override {
|
||||
if(!SS.OkayToStartNewFile()) return true;
|
||||
SS.Exit();
|
||||
|
||||
return true;
|
||||
|
|
|
@ -147,9 +147,6 @@ bool SolveSpaceUI::OpenFile(const std::string &filename) {
|
|||
}
|
||||
|
||||
void SolveSpaceUI::Exit() {
|
||||
if(!OkayToStartNewFile())
|
||||
return;
|
||||
|
||||
// Recent files
|
||||
for(int i = 0; i < MAX_RECENT; i++)
|
||||
CnfFreezeString(RecentFile[i], "RecentFile_" + std::to_string(i));
|
||||
|
|
Loading…
Reference in New Issue