From ad28963ad2b690045bf81c1a56976d8421102d43 Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Tue, 16 Sep 2003 06:59:18 +0000 Subject: [PATCH] Set the close button to quit the application. Enable/disable the close button at the proper times. The user can still just quit in the middle of the installation using the application menu which might result in a file being left in /tmp but that's really their fault for quitting early isn't it? --- stepmania/PBProject/Installer/InstallerWindowController.h | 1 + stepmania/PBProject/Installer/InstallerWindowController.m | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/stepmania/PBProject/Installer/InstallerWindowController.h b/stepmania/PBProject/Installer/InstallerWindowController.h index 397abaad12..81f274a675 100644 --- a/stepmania/PBProject/Installer/InstallerWindowController.h +++ b/stepmania/PBProject/Installer/InstallerWindowController.h @@ -20,4 +20,5 @@ - (void)finishedInstalling:(BOOL)success; - (BOOL)askQuestion:(NSString *)question; - (IBAction)pushedQuestionButton:(id)sender; +- (void)windowWillClose:(NSNotification *)notification; @end diff --git a/stepmania/PBProject/Installer/InstallerWindowController.m b/stepmania/PBProject/Installer/InstallerWindowController.m index 037c50e751..6b39f3d4f8 100644 --- a/stepmania/PBProject/Installer/InstallerWindowController.m +++ b/stepmania/PBProject/Installer/InstallerWindowController.m @@ -21,6 +21,7 @@ if (finished) [NSApp terminate:self]; [sender setEnabled:NO]; + [[[self window] standardWindowButton:NSWindowCloseButton] setEnabled:NO]; [self postMessage:@"Starting installation."]; [NSThread detachNewThreadSelector:@selector(startHelper:) toTarget:helper withObject:self]; } @@ -36,6 +37,7 @@ - (void)finishedInstalling:(BOOL)success { + [[[self window] standardWindowButton:NSWindowCloseButton] setEnabled:YES]; if (success) { [button setTitle:@"Quit Installer"]; @@ -58,4 +60,8 @@ [NSApp stopModalWithCode:[sender tag]]; } +- (void)windowWillClose:(NSNotification *)notification +{ + [NSApp terminate:self]; +} @end