QTfrontend/util/platform/M3InstallController.m
changeset 8440 ea4d6a7a2937
parent 8381 588a8e6e2041
child 8449 2816230a107e
--- a/QTfrontend/util/platform/M3InstallController.m	Sat Jan 26 22:59:48 2013 +0400
+++ b/QTfrontend/util/platform/M3InstallController.m	Sat Jan 26 23:56:10 2013 +0100
@@ -37,61 +37,61 @@
 
 - (id) init {
         if ((self = [super init])) {
-		NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"];
-		NSString *title = [NSString stringWithFormat:NSLocalizedString(@"%@ is currently running from a disk image", @"AppName is currently running from a disk image"), appName];
-		NSString *body = [NSString stringWithFormat:NSLocalizedString(@"Would you like to install %@ in your applications folder before quitting?", @"Would you like to install App Name in your applications folder before quitting?"), appName];
-		alert = [[NSAlert alertWithMessageText:title
-								 defaultButton:NSLocalizedString(@"Install", @"Install")
-							   alternateButton:NSLocalizedString(@"Don't Install", @"Don't Install")
-								   otherButton:nil
-					 informativeTextWithFormat:body] retain];
-		//[alert setShowsSuppressionButton:YES];
-	}
-	return self;
+        NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"];
+        NSString *title = [NSString stringWithFormat:NSLocalizedString(@"%@ is currently running from a disk image", @"AppName is currently running from a disk image"), appName];
+        NSString *body = [NSString stringWithFormat:NSLocalizedString(@"Would you like to install %@ in your applications folder before quitting?", @"Would you like to install App Name in your applications folder before quitting?"), appName];
+        alert = [[NSAlert alertWithMessageText:title
+                                 defaultButton:NSLocalizedString(@"Install", @"Install")
+                               alternateButton:NSLocalizedString(@"Don't Install", @"Don't Install")
+                                   otherButton:nil
+                     informativeTextWithFormat:body] retain];
+        //[alert setShowsSuppressionButton:YES];
+    }
+    return self;
 }
 
 - (void)displayInstaller {
-	NSString *imageFilePath = [[[NSWorkspace sharedWorkspace] propertiesForPath:[[NSBundle mainBundle] bundlePath]] objectForKey:NSWorkspace_RBimagefilepath];
-	if (imageFilePath && ![imageFilePath isEqualToString:[NSString stringWithFormat:@"/Users/.%@/%@.sparseimage", NSUserName(), NSUserName()]] && ![[NSUserDefaults standardUserDefaults] boolForKey:@"M3DontAskInstallAgain"]) {
-		NSInteger returnValue = [alert runModal];
-		if (returnValue == NSAlertDefaultReturn) {
-			[self installApp];
-		}
-		if ([[alert suppressionButton] state] == NSOnState) {
-			[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"M3DontAskInstallAgain"];
-		}
-	}
+    NSString *imageFilePath = [[[NSWorkspace sharedWorkspace] propertiesForPath:[[NSBundle mainBundle] bundlePath]] objectForKey:NSWorkspace_RBimagefilepath];
+    if (imageFilePath && ![imageFilePath isEqualToString:[NSString stringWithFormat:@"/Users/.%@/%@.sparseimage", NSUserName(), NSUserName()]] && ![[NSUserDefaults standardUserDefaults] boolForKey:@"M3DontAskInstallAgain"]) {
+        NSInteger returnValue = [alert runModal];
+        if (returnValue == NSAlertDefaultReturn) {
+            [self installApp];
+        }
+        if ([[alert suppressionButton] state] == NSOnState) {
+            [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"M3DontAskInstallAgain"];
+        }
+    }
 }
 
 - (void)installApp {
-	NSString *appsPath = [[NSString stringWithString:@"/Applications"] stringByAppendingPathComponent:[[[NSBundle mainBundle] bundlePath] lastPathComponent]];
-	NSString *userAppsPath = [[[NSString stringWithString:@"~/Applications"] stringByAppendingPathComponent:[[[NSBundle mainBundle] bundlePath] lastPathComponent]] stringByExpandingTildeInPath];
-	NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"];
+    NSString *appsPath = [[NSString stringWithString:@"/Applications"] stringByAppendingPathComponent:[[[NSBundle mainBundle] bundlePath] lastPathComponent]];
+    NSString *userAppsPath = [[[NSString stringWithString:@"~/Applications"] stringByAppendingPathComponent:[[[NSBundle mainBundle] bundlePath] lastPathComponent]] stringByExpandingTildeInPath];
+    NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"];
 
-	//Delete the app that is installed
-	if ([[NSFileManager defaultManager] fileExistsAtPath:appsPath]) {
-		[[NSFileManager defaultManager] removeFileAtPath:appsPath handler:nil];
-	}
-	//Delete the app that is installed
-	if ([[NSFileManager defaultManager] copyPath:[[NSBundle mainBundle] bundlePath] toPath:appsPath
-										  handler:nil]) {
-		NSRunAlertPanel([NSString stringWithFormat:NSLocalizedString(@"%@ installed successfully", @"App Name installed successfully"), appName],
-						[NSString stringWithFormat:NSLocalizedString(@"%@ was installed in /Applications", @"App Name was installed in /Applications"), appName],
-						NSLocalizedString(@"Quit", @"Quit"), nil, nil);
-	} else {
-		if ([[NSFileManager defaultManager] fileExistsAtPath:userAppsPath]) {
-			[[NSFileManager defaultManager] removeFileAtPath:userAppsPath handler:nil];
-		}
-		if ([[NSFileManager defaultManager] copyPath:[[NSBundle mainBundle] bundlePath] toPath:userAppsPath
-												handler:nil]) {
-		NSRunAlertPanel([NSString stringWithFormat:NSLocalizedString(@"%@ installed successfully", @"AppName installed successfully"), appName],
-				[NSString stringWithFormat:NSLocalizedString(@"%@ was installed in %@", @"App Name was installed in %@"), appName, [[NSString stringWithString:@"~/Applications"] stringByExpandingTildeInPath]],
-						NSLocalizedString(@"Quit", @"Quit"), nil, nil);
-		} else {
-			NSRunAlertPanel([NSString stringWithFormat:NSLocalizedString(@"Could not install %@", @"Could not install App Name"), appName],
-							NSLocalizedString(@"An error occurred when installing", @"An error occurred when installing"), NSLocalizedString(@"Quit", @"Quit"), nil, nil);
-		}
-	}
+    //Delete the app that is installed
+    if ([[NSFileManager defaultManager] fileExistsAtPath:appsPath]) {
+        [[NSFileManager defaultManager] removeFileAtPath:appsPath handler:nil];
+    }
+    //Delete the app that is installed
+    if ([[NSFileManager defaultManager] copyPath:[[NSBundle mainBundle] bundlePath] toPath:appsPath
+                                          handler:nil]) {
+        NSRunAlertPanel([NSString stringWithFormat:NSLocalizedString(@"%@ installed successfully", @"App Name installed successfully"), appName],
+                        [NSString stringWithFormat:NSLocalizedString(@"%@ was installed in /Applications", @"App Name was installed in /Applications"), appName],
+                        NSLocalizedString(@"Quit", @"Quit"), nil, nil);
+    } else {
+        if ([[NSFileManager defaultManager] fileExistsAtPath:userAppsPath]) {
+            [[NSFileManager defaultManager] removeFileAtPath:userAppsPath handler:nil];
+        }
+        if ([[NSFileManager defaultManager] copyPath:[[NSBundle mainBundle] bundlePath] toPath:userAppsPath
+                                                handler:nil]) {
+        NSRunAlertPanel([NSString stringWithFormat:NSLocalizedString(@"%@ installed successfully", @"AppName installed successfully"), appName],
+                [NSString stringWithFormat:NSLocalizedString(@"%@ was installed in %@", @"App Name was installed in %@"), appName, [[NSString stringWithString:@"~/Applications"] stringByExpandingTildeInPath]],
+                        NSLocalizedString(@"Quit", @"Quit"), nil, nil);
+        } else {
+            NSRunAlertPanel([NSString stringWithFormat:NSLocalizedString(@"Could not install %@", @"Could not install App Name"), appName],
+                            NSLocalizedString(@"An error occurred when installing", @"An error occurred when installing"), NSLocalizedString(@"Quit", @"Quit"), nil, nil);
+        }
+    }
 }
 
 @end