Skip to content

Commit

Permalink
Updated demo project to ARC
Browse files Browse the repository at this point in the history
  • Loading branch information
sbooth committed Jun 22, 2014
1 parent 88df611 commit dc9c668
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 53 deletions.
10 changes: 5 additions & 5 deletions DemoAppDelegate.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2009 Stephen F. Booth <me@sbooth.org>
* Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Stephen F. Booth <me@sbooth.org>
* All Rights Reserved
*/

Expand All @@ -8,9 +8,9 @@
@class InspectorPanelController, MetadataEditorPanelController;

@interface DemoAppDelegate : NSObject
{
IBOutlet InspectorPanelController *_inspectorPanel;
IBOutlet MetadataEditorPanelController *_metadataPanel;
}
{}

@property (nonatomic, weak) IBOutlet InspectorPanelController * inspectorPanel;
@property (nonatomic, weak) IBOutlet MetadataEditorPanelController * metadataPanel;

@end
15 changes: 4 additions & 11 deletions DemoAppDelegate.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2009 Stephen F. Booth <me@sbooth.org>
* Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Stephen F. Booth <me@sbooth.org>
* All Rights Reserved
*/

Expand All @@ -9,18 +9,11 @@

@implementation DemoAppDelegate

- (id) init
{
if(!(self = [super init]))
return nil;

return self;
}

- (void) applicationDidFinishLaunching:(NSNotification *)aNotification
{
[_inspectorPanel showWindow:self];
[_metadataPanel showWindow:self];
#pragma unused(aNotification)
[self.inspectorPanel showWindow:self];
[self.metadataPanel showWindow:self];
}

@end
15 changes: 8 additions & 7 deletions InspectorPanelController.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2009 Stephen F. Booth <me@sbooth.org>
* Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Stephen F. Booth <me@sbooth.org>
* All Rights Reserved
*/

Expand All @@ -8,12 +8,13 @@
@class SFBInspectorView;

@interface InspectorPanelController : NSWindowController
{
IBOutlet SFBInspectorView * _inspectorView;
IBOutlet NSView *_trackView;
IBOutlet NSView *_discView;
IBOutlet NSView *_driveView;
}
{}

@property (nonatomic, weak) IBOutlet SFBInspectorView * inspectorView;

@property (nonatomic, weak) IBOutlet NSView * trackView;
@property (nonatomic, weak) IBOutlet NSView * discView;
@property (nonatomic, weak) IBOutlet NSView * driveView;

// ========================================
// Action Methods
Expand Down
8 changes: 4 additions & 4 deletions InspectorPanelController.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2009 Stephen F. Booth <me@sbooth.org>
* Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Stephen F. Booth <me@sbooth.org>
* All Rights Reserved
*/

Expand All @@ -17,9 +17,9 @@ - (void) windowDidLoad
{
[[self window] setMovableByWindowBackground:YES];

[_inspectorView addInspectorPane:_trackView title:NSLocalizedString(@"Track Information", @"The name of the track inspector panel")];
[_inspectorView addInspectorPane:_discView title:NSLocalizedString(@"Disc Information", @"The name of the disc inspector panel")];
[_inspectorView addInspectorPane:_driveView title:NSLocalizedString(@"Drive Information", @"The name of the drive inspector panel")];
[self.inspectorView addInspectorPane:self.trackView title:NSLocalizedString(@"Track Information", @"The name of the track inspector panel")];
[self.inspectorView addInspectorPane:self.discView title:NSLocalizedString(@"Disc Information", @"The name of the disc inspector panel")];
[self.inspectorView addInspectorPane:self.driveView title:NSLocalizedString(@"Drive Information", @"The name of the drive inspector panel")];

[super windowDidLoad];
}
Expand Down
21 changes: 11 additions & 10 deletions MetadataEditorPanelController.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2009 Stephen F. Booth <me@sbooth.org>
* Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Stephen F. Booth <me@sbooth.org>
* All Rights Reserved
*/

Expand All @@ -8,15 +8,16 @@
@class SFBViewSelector;

@interface MetadataEditorPanelController : NSWindowController
{
IBOutlet SFBViewSelector * _viewSelector;
IBOutlet NSView * _albumMetadata;
IBOutlet NSView * _trackMetadata;
IBOutlet NSView * _albumArt;
IBOutlet NSView * _lyrics;
IBOutlet NSView * _additionalAlbumMetadata;
IBOutlet NSView * _additionalTrackMetadata;
}
{}

@property (nonatomic, weak) IBOutlet SFBViewSelector * viewSelector;

@property (nonatomic, weak) IBOutlet NSView * albumMetadata;
@property (nonatomic, weak) IBOutlet NSView * trackMetadata;
@property (nonatomic, weak) IBOutlet NSView * albumArt;
@property (nonatomic, weak) IBOutlet NSView * lyrics;
@property (nonatomic, weak) IBOutlet NSView * additionalAlbumMetadata;
@property (nonatomic, weak) IBOutlet NSView * additionalTrackMetadata;

// ========================================
// Action Methods
Expand Down
18 changes: 9 additions & 9 deletions MetadataEditorPanelController.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2009 Stephen F. Booth <me@sbooth.org>
* Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Stephen F. Booth <me@sbooth.org>
* All Rights Reserved
*/

Expand Down Expand Up @@ -31,47 +31,47 @@ - (void) windowDidLoad
image:[NSImage imageNamed:@"AlbumMetadataEditorPaneIcon"]
view:_albumMetadata];

[[_viewSelector selectorBar] addItem:item];
[[self.viewSelector selectorBar] addItem:item];

item = [SFBViewSelectorBarItem itemWithIdentifier:@"org.sbooth.Inspectors.MetadataEditor.TrackMetadata"
label:NSLocalizedString(@"Track Metadata", @"")
tooltip:NSLocalizedString(@"Track Metadata", @"")
image:[NSImage imageNamed:@"TrackMetadataEditorPaneIcon"]
view:_trackMetadata];

[[_viewSelector selectorBar] addItem:item];
[[self.viewSelector selectorBar] addItem:item];

item = [SFBViewSelectorBarItem itemWithIdentifier:@"org.sbooth.Inspectors.MetadataEditor.AlbumArt"
label:NSLocalizedString(@"Album Art", @"")
tooltip:NSLocalizedString(@"Album Art", @"")
image:[NSImage imageNamed:@"AlbumArtEditorPaneIcon"]
view:_albumArt];

[[_viewSelector selectorBar] addItem:item];
[[self.viewSelector selectorBar] addItem:item];

item = [SFBViewSelectorBarItem itemWithIdentifier:@"org.sbooth.Inspectors.MetadataEditor.Lyrics"
label:NSLocalizedString(@"Lyrics", @"")
tooltip:NSLocalizedString(@"Lyrics", @"")
image:[NSImage imageNamed:@"LyricsMetadataEditorPaneIcon"]
view:_lyrics];

[[_viewSelector selectorBar] addItem:item];
[[self.viewSelector selectorBar] addItem:item];

item = [SFBViewSelectorBarItem itemWithIdentifier:@"org.sbooth.Inspectors.MetadataEditor.AdditionalAlbumMetadata"
label:NSLocalizedString(@"Additional Album Metadata", @"")
tooltip:NSLocalizedString(@"Additional Album Metadata", @"")
image:[NSImage imageNamed:@"AdditionalAlbumMetadataEditorPaneIcon"]
view:_additionalAlbumMetadata];

[[_viewSelector selectorBar] addItem:item];
[[self.viewSelector selectorBar] addItem:item];

item = [SFBViewSelectorBarItem itemWithIdentifier:@"org.sbooth.Inspectors.MetadataEditor.AdditionalTrackMetadata"
label:NSLocalizedString(@"Additional Track Metadata", @"")
tooltip:NSLocalizedString(@"Additional Track Metadata", @"")
image:[NSImage imageNamed:@"AdditionalTrackMetadataEditorPaneIcon"]
view:_additionalTrackMetadata];

[[_viewSelector selectorBar] addItem:item];
[[self.viewSelector selectorBar] addItem:item];

// Restore the selected pane
NSString *autosaveName = [[self window] frameAutosaveName];
Expand All @@ -80,7 +80,7 @@ - (void) windowDidLoad
NSString *selectedIdentifier = [[NSUserDefaults standardUserDefaults] stringForKey:selectedPaneDefaultsName];

if(selectedIdentifier)
[[_viewSelector selectorBar] selectItemWithIdentifer:selectedIdentifier];
[[self.viewSelector selectorBar] selectItemWithIdentifer:selectedIdentifier];
}

[super windowDidLoad];
Expand Down Expand Up @@ -131,7 +131,7 @@ - (void) applicationWillTerminate:(NSNotification *)notification
// Save the selected pane
NSString *autosaveName = [[self window] frameAutosaveName];
if(autosaveName) {
NSString *selectedIdentifier = [[[_viewSelector selectorBar] selectedItem] identifier];
NSString *selectedIdentifier = [[[self.viewSelector selectorBar] selectedItem] identifier];
NSString *selectedPaneDefaultsName = [autosaveName stringByAppendingFormat:@" Selected Pane"];

[[NSUserDefaults standardUserDefaults] setValue:selectedIdentifier forKey:selectedPaneDefaultsName];
Expand Down
9 changes: 2 additions & 7 deletions SFBInspectors.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -510,12 +510,11 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ENABLE_OBJC_ARC = YES;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_ENABLE_OBJC_GC = required;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h";
Expand All @@ -527,7 +526,6 @@
"-framework",
AppKit,
);
PREBINDING = NO;
PRODUCT_NAME = Demo;
};
name = Debug;
Expand All @@ -536,12 +534,11 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ENABLE_OBJC_ARC = YES;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_ENABLE_OBJC_GC = required;
GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h";
INFOPLIST_FILE = "Demo-Info.plist";
Expand All @@ -552,9 +549,7 @@
"-framework",
AppKit,
);
PREBINDING = NO;
PRODUCT_NAME = Demo;
ZERO_LINK = NO;
};
name = Release;
};
Expand Down

0 comments on commit dc9c668

Please sign in to comment.