diff --git a/OpenRA.Launcher.Mac/Controller.m b/OpenRA.Launcher.Mac/Controller.m index 48417cd47e..d3c33b2bce 100644 --- a/OpenRA.Launcher.Mac/Controller.m +++ b/OpenRA.Launcher.Mac/Controller.m @@ -185,4 +185,29 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn { NSLog(@"%@",dictionary); } + + +#pragma mark Application delegates +- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender +{ + return YES; +} + +- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender +{ + // Todo: show a sheet if downloads are in progress + return NSTerminateNow; +} + +- (void)applicationWillTerminate:(NSNotification *)aNotification +{ + // Cancel all in-progress downloads + for (NSString *key in downloads) + { + Download *d = [downloads objectForKey:key]; + if ([[d status] isEqualToString:@"DOWNLOADING"]) + [d cancel]; + } +} + @end diff --git a/OpenRA.Launcher.Mac/English.lproj/MainMenu.xib b/OpenRA.Launcher.Mac/English.lproj/MainMenu.xib index cedf268855..50f3be2952 100644 --- a/OpenRA.Launcher.Mac/English.lproj/MainMenu.xib +++ b/OpenRA.Launcher.Mac/English.lproj/MainMenu.xib @@ -21,8 +21,8 @@ YES - + YES @@ -526,9 +526,6 @@ {{0, 0}, {1920, 1178}} {3.40282e+38, 3.40282e+38} - - OpenRAAppDelegate - Controller @@ -608,22 +605,6 @@ 493 - - - delegate - - - - 495 - - - - window - - - - 532 - dataSource @@ -664,6 +645,14 @@ 591 + + + delegate + + + + 592 + @@ -879,11 +868,6 @@ - - 494 - - - 555 @@ -1147,7 +1131,7 @@ - 591 + 592 @@ -1192,25 +1176,6 @@ Controller.h - - OpenRAAppDelegate - NSObject - - window - NSWindow - - - window - - window - NSWindow - - - - IBProjectSource - OpenRAAppDelegate.h - - YES diff --git a/OpenRA.Launcher.Mac/OpenRA.xcodeproj/project.pbxproj b/OpenRA.Launcher.Mac/OpenRA.xcodeproj/project.pbxproj index 23705fd051..0691b0418f 100644 --- a/OpenRA.Launcher.Mac/OpenRA.xcodeproj/project.pbxproj +++ b/OpenRA.Launcher.Mac/OpenRA.xcodeproj/project.pbxproj @@ -8,7 +8,6 @@ /* Begin PBXBuildFile section */ 1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58140DA1D0A300B32029 /* MainMenu.xib */; }; - 256AC3DA0F4B6AC300CF3369 /* OpenRAAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 256AC3D90F4B6AC300CF3369 /* OpenRAAppDelegate.m */; }; 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; @@ -28,8 +27,6 @@ 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 1DDD58150DA1D0A300B32029 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = ""; }; - 256AC3D80F4B6AC300CF3369 /* OpenRAAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OpenRAAppDelegate.h; sourceTree = ""; }; - 256AC3D90F4B6AC300CF3369 /* OpenRAAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OpenRAAppDelegate.m; sourceTree = ""; }; 256AC3F00F4B6AF500CF3369 /* OpenRA_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OpenRA_Prefix.pch; sourceTree = ""; }; 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; @@ -73,8 +70,6 @@ children = ( DA81FB9112910A8B00C48F2F /* ImageAndTextCell.h */, DA81FB9212910A8B00C48F2F /* ImageAndTextCell.m */, - 256AC3D80F4B6AC300CF3369 /* OpenRAAppDelegate.h */, - 256AC3D90F4B6AC300CF3369 /* OpenRAAppDelegate.m */, DA81FA801290F5C800C48F2F /* Controller.h */, DA81FA811290F5C800C48F2F /* Controller.m */, DA81FAA81290FA0000C48F2F /* Mod.h */, @@ -224,7 +219,6 @@ buildActionMask = 2147483647; files = ( 8D11072D0486CEB800E47090 /* main.m in Sources */, - 256AC3DA0F4B6AC300CF3369 /* OpenRAAppDelegate.m in Sources */, DA81FA821290F5C800C48F2F /* Controller.m in Sources */, DA81FAAA1290FA0000C48F2F /* Mod.m in Sources */, DA81FB9312910A8B00C48F2F /* ImageAndTextCell.m in Sources */, diff --git a/OpenRA.Launcher.Mac/OpenRAAppDelegate.h b/OpenRA.Launcher.Mac/OpenRAAppDelegate.h deleted file mode 100644 index 167f09836f..0000000000 --- a/OpenRA.Launcher.Mac/OpenRAAppDelegate.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2007-2010 The OpenRA Developers (see AUTHORS) - * This file is part of OpenRA, which is free software. It is made - * available to you under the terms of the GNU General Public License - * as published by the Free Software Foundation. For more information, - * see LICENSE. - */ - -#import - -@interface OpenRAAppDelegate : NSObject { - NSWindow *window; -} - -@property (assign) IBOutlet NSWindow *window; - -@end diff --git a/OpenRA.Launcher.Mac/OpenRAAppDelegate.m b/OpenRA.Launcher.Mac/OpenRAAppDelegate.m deleted file mode 100644 index 4269dd985c..0000000000 --- a/OpenRA.Launcher.Mac/OpenRAAppDelegate.m +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2007-2010 The OpenRA Developers (see AUTHORS) - * This file is part of OpenRA, which is free software. It is made - * available to you under the terms of the GNU General Public License - * as published by the Free Software Foundation. For more information, - * see LICENSE. - */ - -#import "OpenRAAppDelegate.h" - -@implementation OpenRAAppDelegate - -@synthesize window; - -- (void)applicationDidFinishLaunching:(NSNotification *)aNotification { - // Insert code here to initialize your application -} - -@end