Skip to content

Commit

Permalink
Merge branch 'release/1.0a8'
Browse files Browse the repository at this point in the history
  • Loading branch information
griff committed Aug 8, 2011
2 parents 104c8bf + 3ec39c1 commit ec4f402
Show file tree
Hide file tree
Showing 39 changed files with 1,794 additions and 119 deletions.
827 changes: 803 additions & 24 deletions App/English.lproj/MainMenu.xib

Large diffs are not rendered by default.

35 changes: 16 additions & 19 deletions App/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
<key>CFBundleGetInfoString</key>
<string>Copyright 2009 Brian Olsen &amp; Nigel Graham</string>
<key>CFBundleIconFile</key>
<string></string>
<string>MetaZ.icns</string>
<key>CFBundleIdentifier</key>
<string>org.maven-group.${PRODUCT_NAME:identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
Expand Down Expand Up @@ -172,43 +172,40 @@
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>com.apple.plugin</string>
<string>public.movie</string>
</array>
<key>UTTypeDescription</key>
<string>MetaZ Plugin</string>
<key>UTTypeIconFile</key>
<string>/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/KEXT.icns</string>
<key>UTTypeIdentifier</key>
<string>org.maven-group.${PRODUCT_NAME:identifier}.plugin</string>
<string>org.maven-group.mpeg4-video</string>
<key>UTTypeDescription</key>
<string>The Other MPEG-4 Video</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>com.apple.ostype</key>
<array>
<string>M4V</string>
</array>
<key>public.filename-extension</key>
<array>
<string>mzplugin</string>
<string>m4v</string>
</array>
</dict>
</dict>
</array>
<key>UTImportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.movie</string>
<string>com.apple.plugin</string>
</array>
<key>UTTypeDescription</key>
<string>protected MPEG-4 movie</string>
<string>MetaZ Plugin</string>
<key>UTTypeIconFile</key>
<string>/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/KEXT.icns</string>
<key>UTTypeIdentifier</key>
<string>com.apple.protected-mpeg-4-video</string>
<string>org.maven-group.${PRODUCT_NAME:identifier}.plugin</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>com.apple.ostype</key>
<array>
<string>M4V</string>
</array>
<key>public.filename-extension</key>
<array>
<string>m4v</string>
<string>mzplugin</string>
</array>
</dict>
</dict>
Expand Down
Binary file added App/resources/MetaZ.icns
Binary file not shown.
Binary file added App/resources/metaz.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions App/src/AppController.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@
#import "SearchProfile.h"
#import "ChapterEditor.h"
#import "MZFileNameTextStorage.h"
#import "MZYearDateFormatter.h"

@interface AppController : NSObject <NSUserInterfaceValidations,MZPluginControllerDelegate> {
NSWindow* window;
NSTabView *tabView;
NSNumberFormatter* episodeFormatter;
NSNumberFormatter* seasonFormatter;
NSDateFormatter* dateFormatter;
MZYearDateFormatter* dateFormatter;
NSDateFormatter* purchaseDateFormatter;
NSSegmentedControl* filesSegmentControl;
NSArrayController* filesController;
Expand Down Expand Up @@ -52,7 +53,7 @@
@property (nonatomic, retain) IBOutlet NSTabView *tabView;
@property (nonatomic, retain) IBOutlet NSNumberFormatter* episodeFormatter;
@property (nonatomic, retain) IBOutlet NSNumberFormatter* seasonFormatter;
@property (nonatomic, retain) IBOutlet NSDateFormatter* dateFormatter;
@property (nonatomic, retain) IBOutlet MZYearDateFormatter* dateFormatter;
@property (nonatomic, retain) IBOutlet NSDateFormatter* purchaseDateFormatter;
@property (nonatomic, retain) IBOutlet NSSegmentedControl* filesSegmentControl;
@property (nonatomic, retain) IBOutlet NSArrayController* filesController;
Expand Down
22 changes: 16 additions & 6 deletions App/src/AppController.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ - (void)registerUndoName:(NSUndoManager *)manager;
NSDictionary* tags = [dict objectForKey:(NSString*)kUTTypeTagSpecificationKey];
NSArray* extensions = [tags objectForKey:(NSString*)kUTTagClassFilenameExtension];
[ret addObjectsFromArray:extensions];
[dict release];
}
return ret;
}
Expand Down Expand Up @@ -281,9 +282,11 @@ - (void)updateSearchMenu
}
[searchField setStringValue:mainValue];

[[MZMetaSearcher sharedSearcher] clearResults];
if([[NSUserDefaults standardUserDefaults] boolForKey:@"autoSearch"])
{
//[[MZMetaSearcher sharedSearcher] clearResults];
[self startSearch:searchField];
}
}

- (void)registerUndoName:(NSUndoManager *)manager
Expand Down Expand Up @@ -351,22 +354,27 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N
#pragma mark - actions

- (IBAction)showAdvancedTab:(id)sender {
[window makeKeyAndOrderFront:sender];
[tabView selectTabViewItemWithIdentifier:@"advanced"];
}

- (IBAction)showChapterTab:(id)sender {
[window makeKeyAndOrderFront:sender];
[tabView selectTabViewItemWithIdentifier:@"chapters"];
}

- (IBAction)showInfoTab:(id)sender {
[window makeKeyAndOrderFront:sender];
[tabView selectTabViewItemWithIdentifier:@"info"];
}

- (IBAction)showSortTab:(id)sender {
[window makeKeyAndOrderFront:sender];
[tabView selectTabViewItemWithIdentifier:@"sorting"];
}

- (IBAction)showVideoTab:(id)sender {
[window makeKeyAndOrderFront:sender];
[tabView selectTabViewItemWithIdentifier:@"video"];
}

Expand Down Expand Up @@ -540,10 +548,10 @@ - (IBAction)showPreferences:(id)sender
- (IBAction)openDocument:(id)sender {
NSArray *fileTypes = [[MZMetaLoader sharedLoader] types];

NSArray* utis = MZUTIFilenameExtension(fileTypes);
for(NSString* uti in utis)
NSArray* extensions = MZUTIFilenameExtension(fileTypes);
for(NSString* ext in extensions)
{
MZLoggerDebug(@"Found UTI %@", uti);
MZLoggerDebug(@"Found extention %@", ext);
}

NSOpenPanel *oPanel = [NSOpenPanel openPanel];
Expand All @@ -552,7 +560,7 @@ - (IBAction)openDocument:(id)sender {
[oPanel setCanChooseDirectories:NO];
[oPanel beginSheetForDirectory: nil
file: nil
types: fileTypes
types: extensions
modalForWindow: window
modalDelegate: self
didEndSelector: @selector(openPanelDidEnd:returnCode:contextInfo:)
Expand Down Expand Up @@ -893,13 +901,15 @@ - (void)textDidChange:(NSNotification *)aNotification

#pragma mark - as application delegate

- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
- (BOOL)application:(NSApplication *)sender openFile:(NSString *)filename
{
[window makeKeyAndOrderFront:sender];
return [[MZMetaLoader sharedLoader] loadFromFile:filename];
}

- (void)application:(NSApplication *)sender openFiles:(NSArray *)filenames
{
[window makeKeyAndOrderFront:sender];
if([[MZMetaLoader sharedLoader] loadFromFiles: filenames])
[sender replyToOpenOrPrint:NSApplicationDelegateReplySuccess];
else
Expand Down
2 changes: 1 addition & 1 deletion App/src/ChapterEditor.m
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ - (void)makeEditorChapters
NSUInteger editsLen = [editorChapters count];
NSMutableArray* nextEdits = [NSMutableArray array];
NSInteger newSlide = -slide;
NSInteger newSlideMin = slideMin;
NSInteger newSlideMin; // = slideMin;
if(self.chaptersChanged)
{
newSlideMin = 0;
Expand Down
4 changes: 2 additions & 2 deletions App/src/MGCollectionView.m
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ - (MGCollectionViewItem *)newItemForRepresentedObject:(id)object
MGCollectionViewItem* ret = [itemPrototype copy];
[ret _setItemOwnerView:self];
ret.representedObject = object;
return [ret autorelease];
return ret;
}

- (void)animationDidEnd:(NSAnimation *)animation
Expand Down Expand Up @@ -228,7 +228,7 @@ - (void)_computeTargetItemsByRegenerating:(BOOL)regenerate
item = [_targetItems objectAtIndex:[[dict objectForKey:[NSNumber numberWithUnsignedInt:i]] unsignedIntValue]];
} else // Not Found = New Item
{
item = [self newItemForRepresentedObject:object];
item = [[self newItemForRepresentedObject:object] autorelease];
}

NSRect oldFrame = item.view.frame;
Expand Down
15 changes: 15 additions & 0 deletions App/src/MZDateFormatter.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// MZDateFormatter.h
// MetaZ
//
// Created by Brian Olsen on 08/08/11.
// Copyright 2011 Maven-Group. All rights reserved.
//

#import <Cocoa/Cocoa.h>


@interface MZDateFormatter : NSDateFormatter {
}

@end
43 changes: 43 additions & 0 deletions App/src/MZDateFormatter.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//
// MZDateFormatter.m
// MetaZ
//
// Created by Brian Olsen on 08/08/11.
// Copyright 2011 Maven-Group. All rights reserved.
//

#import "MZDateFormatter.h"


@implementation MZDateFormatter

- (NSDate *)dateFromString:(NSString *)string;
{
return [super dateFromString:string];
}

- (NSString *)stringFromDate:(NSDate *)date;
{
return [super stringFromDate:date];
}


- (BOOL)isPartialStringValid:(NSString **)partialStringPtr proposedSelectedRange:(NSRangePointer)proposedSelRangePtr originalString:(NSString *)origString originalSelectedRange:(NSRange)origSelRange errorDescription:(NSString **)error;
{
BOOL ret = [super isPartialStringValid:partialStringPtr proposedSelectedRange:proposedSelRangePtr originalString:origString originalSelectedRange:origSelRange errorDescription:error];
return ret;
}

- (BOOL)getObjectValue:(id *)obj forString:(NSString *)string errorDescription:(NSString **)error;
{
if(!string || [string length]==0)
{
if(obj)
*obj = nil;
return YES;
}
BOOL ret = [super getObjectValue:obj forString:string errorDescription:error];
return ret;
}

@end
125 changes: 125 additions & 0 deletions App/src/MZYearDateFormatter.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
//
// MZYearDateFormatter.h
// MetaZ
//
// Created by Brian Olsen on 08/08/11.
// Copyright 2011 Maven-Group. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import "MZDateFormatter.h"

@interface MZYearDateFormatter : NSFormatter {
NSDateFormatter* dateFormatter;
}
-(id)init;

#pragma mark NSCoder

-(id)initWithCoder:(NSCoder *)aDecoder;
- (void)encodeWithCoder:(NSCoder *)aCoder;

#pragma mark NSDateFormatter

- (NSString *)dateFormat;

#if MAC_OS_X_VERSION_10_4 <= MAC_OS_X_VERSION_MAX_ALLOWED

- (NSDateFormatterStyle)dateStyle;
- (void)setDateStyle:(NSDateFormatterStyle)style;

- (NSDateFormatterStyle)timeStyle;
- (void)setTimeStyle:(NSDateFormatterStyle)style;

- (NSLocale *)locale;
- (void)setLocale:(NSLocale *)locale;

- (BOOL)generatesCalendarDates;
- (void)setGeneratesCalendarDates:(BOOL)b;

- (NSDateFormatterBehavior)formatterBehavior;
- (void)setFormatterBehavior:(NSDateFormatterBehavior)behavior;

- (void)setDateFormat:(NSString *)string;

- (NSTimeZone *)timeZone;
- (void)setTimeZone:(NSTimeZone *)tz;

- (NSCalendar *)calendar;
- (void)setCalendar:(NSCalendar *)calendar;

- (BOOL)isLenient;
- (void)setLenient:(BOOL)b;

- (NSDate *)twoDigitStartDate;
- (void)setTwoDigitStartDate:(NSDate *)date;

- (NSDate *)defaultDate;
- (void)setDefaultDate:(NSDate *)date;

- (NSArray *)eraSymbols;
- (void)setEraSymbols:(NSArray *)array;

- (NSArray *)monthSymbols;
- (void)setMonthSymbols:(NSArray *)array;

- (NSArray *)shortMonthSymbols;
- (void)setShortMonthSymbols:(NSArray *)array;

- (NSArray *)weekdaySymbols;
- (void)setWeekdaySymbols:(NSArray *)array;

- (NSArray *)shortWeekdaySymbols;
- (void)setShortWeekdaySymbols:(NSArray *)array;

- (NSString *)AMSymbol;
- (void)setAMSymbol:(NSString *)string;

- (NSString *)PMSymbol;
- (void)setPMSymbol:(NSString *)string;

#endif

- (NSArray *)longEraSymbols AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
- (void)setLongEraSymbols:(NSArray *)array AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;

- (NSArray *)veryShortMonthSymbols AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
- (void)setVeryShortMonthSymbols:(NSArray *)array AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;

- (NSArray *)standaloneMonthSymbols AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
- (void)setStandaloneMonthSymbols:(NSArray *)array AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;

- (NSArray *)shortStandaloneMonthSymbols AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
- (void)setShortStandaloneMonthSymbols:(NSArray *)array AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;

- (NSArray *)veryShortStandaloneMonthSymbols AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
- (void)setVeryShortStandaloneMonthSymbols:(NSArray *)array AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;

- (NSArray *)veryShortWeekdaySymbols AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
- (void)setVeryShortWeekdaySymbols:(NSArray *)array AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;

- (NSArray *)standaloneWeekdaySymbols AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
- (void)setStandaloneWeekdaySymbols:(NSArray *)array AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;

- (NSArray *)shortStandaloneWeekdaySymbols AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
- (void)setShortStandaloneWeekdaySymbols:(NSArray *)array AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;

- (NSArray *)veryShortStandaloneWeekdaySymbols AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
- (void)setVeryShortStandaloneWeekdaySymbols:(NSArray *)array AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;

- (NSArray *)quarterSymbols AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
- (void)setQuarterSymbols:(NSArray *)array AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;

- (NSArray *)shortQuarterSymbols AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
- (void)setShortQuarterSymbols:(NSArray *)array AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;

- (NSArray *)standaloneQuarterSymbols AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
- (void)setStandaloneQuarterSymbols:(NSArray *)array AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;

- (NSArray *)shortStandaloneQuarterSymbols AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
- (void)setShortStandaloneQuarterSymbols:(NSArray *)array AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;

- (NSDate *)gregorianStartDate AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
- (void)setGregorianStartDate:(NSDate *)date AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;

@end
Loading

0 comments on commit ec4f402

Please sign in to comment.