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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user