Skip to content

Commit

Permalink
Set SDK to MacOSX10.5. Fixed compiler warnings initializing "self". A…
Browse files Browse the repository at this point in the history
…ctivate app when showing windows.
  • Loading branch information
aburgh committed Mar 20, 2011
1 parent a460328 commit cf0283b
Show file tree
Hide file tree
Showing 8 changed files with 154 additions and 1,338 deletions.
16 changes: 13 additions & 3 deletions DiskArbitrator.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,11 @@
isa = PBXProject;
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "DiskArbitrator" */;
compatibilityVersion = "Xcode 3.1";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
en,
);
mainGroup = 29B97314FDCFA39411CA2CEA /* DiskArbitrator */;
projectDirPath = "";
projectRoot = "";
Expand Down Expand Up @@ -507,21 +511,27 @@
MACOSX_DEPLOYMENT_TARGET = 10.5;
ONLY_ACTIVE_ARCH = YES;
PREBINDING = NO;
SDKROOT = macosx10.6;
SDKROOT = macosx10.5;
VALID_ARCHS = "ppc i386 x86_64";
};
name = Debug;
};
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
ARCHS = (
ppc,
i386,
x86_64,
);
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.5;
PREBINDING = NO;
SDKROOT = macosx10.6;
SDKROOT = macosx10.5;
VALID_ARCHS = "ppc i386 x86_64";
};
name = Release;
};
Expand Down
575 changes: 55 additions & 520 deletions English.lproj/DiskInfo.xib

Large diffs are not rendered by default.

871 changes: 62 additions & 809 deletions English.lproj/MainMenu.xib

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion Source/Arbitrator.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ + (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key

- (id)init
{
if (self = [super init])
self = [super init];
if (self)
{
disks = [NSMutableSet new];
[self registerSession];
Expand Down
2 changes: 1 addition & 1 deletion Source/AttachDiskImageController.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#import <Cocoa/Cocoa.h>
#import "SheetController.h"

@interface AttachDiskImageController : SheetController <NSOpenSavePanelDelegate>
@interface AttachDiskImageController : SheetController // <NSOpenSavePanelDelegate>
{
NSView *view;
NSTask *task;
Expand Down
5 changes: 3 additions & 2 deletions Source/Disk.m
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ - (id)initWithDiskRef:(DADiskRef)diskRef
}
}

if (self = [super init])
self = [super init];
if (self)
{
BSDName = [[NSString alloc] initWithUTF8String:DADiskGetBSDName(diskRef)];
CFRetain(diskRef);
Expand Down Expand Up @@ -161,7 +162,7 @@ - (void)unmountWithOptions:(NSUInteger)options

- (void)eject
{
NSAssert(self.isEjectable, @"Disk is not ejectable: %@", self);
NSAssert1(self.isEjectable, @"Disk is not ejectable: %@", self);

DADiskEject((DADiskRef) disk, kDADiskEjectOptionDefault, DiskEjectCallback, self);
}
Expand Down
3 changes: 2 additions & 1 deletion Source/DiskArbitratorAppController.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@class Arbitrator;
@class Disk;

@interface AppController : NSObject <NSApplicationDelegate>
@interface AppController : NSObject // <NSApplicationDelegate>
{
NSPanel *window;
NSStatusItem *statusItem;
Expand All @@ -33,6 +33,7 @@
@property (retain) NSStatusItem *statusItem;
@property (retain) Arbitrator *arbitrator;

- (IBAction)showAboutPanel:(id)sender;
- (IBAction)showMainWindow:(id)sender;
- (IBAction)showPreferences:(id)sender;
- (IBAction)performActivation:(id)sender;
Expand Down
17 changes: 16 additions & 1 deletion Source/DiskArbitratorAppController.m
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,16 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N
[self refreshStatusItemIcon];
}

- (IBAction)showAboutPanel:(id)sender
{
[NSApp orderFrontStandardAboutPanel:sender];
[NSApp activateIgnoringOtherApps:YES];
}

- (IBAction)showMainWindow:(id)sender
{
[window orderFront:sender];
[window makeKeyAndOrderFront:sender];
[NSApp activateIgnoringOtherApps:YES];
}

- (IBAction)showPreferences:(id)sender
Expand All @@ -121,6 +128,7 @@ - (IBAction)showPreferences:(id)sender
controller = [[NSWindowController alloc] initWithWindowNibName:@"Preferences"];

[[controller window] makeKeyAndOrderFront:self];
[NSApp activateIgnoringOtherApps:YES];
}

- (IBAction)performActivation:(id)sender
Expand Down Expand Up @@ -443,6 +451,13 @@ - (BOOL)tableView:(NSTableView *)aTableView acceptDrop:(id <NSDraggingInfo>)info
return YES;
}

#pragma mark Window Delegates

- (void)windowWillClose:(NSNotification *)notification
{
[NSApp deactivate];
}

#pragma mark Disk Notifications

- (void)didPresentErrorWithRecovery:(BOOL)didRecover contextInfo:(void *)contextInfo
Expand Down

0 comments on commit cf0283b

Please sign in to comment.