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?

This commit is contained in:
Steve Checkoway
2003-09-16 06:59:18 +00:00
parent 131f6aba13
commit ad28963ad2
2 changed files with 7 additions and 0 deletions
@@ -20,4 +20,5 @@
- (void)finishedInstalling:(BOOL)success;
- (BOOL)askQuestion:(NSString *)question;
- (IBAction)pushedQuestionButton:(id)sender;
- (void)windowWillClose:(NSNotification *)notification;
@end
@@ -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