Skip to content

Commit

Permalink
Merge branch 'release/1.0a9'
Browse files Browse the repository at this point in the history
  • Loading branch information
griff committed Jan 20, 2012
2 parents 7645a3a + dfa1737 commit 3d42de9
Show file tree
Hide file tree
Showing 114 changed files with 7,018 additions and 2,196 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "Externals/asi-http-request"]
path = Externals/asi-http-request
url = https://github.com/pokeb/asi-http-request.git
962 changes: 754 additions & 208 deletions App/English.lproj/MainMenu.xib

Large diffs are not rendered by default.

239 changes: 225 additions & 14 deletions App/English.lproj/Queue.xib

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions App/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<string>video/x-m4v</string>
</array>
<key>CFBundleTypeName</key>
<string>protected MPEG-4 movie</string>
<string>The Other MPEG-4 Video</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>M4V</string>
Expand All @@ -43,7 +43,7 @@
<string>Editor</string>
<key>LSItemContentTypes</key>
<array>
<string>com.apple.protected-mpeg-4-video</string>
<string>org.maven-group.mpeg4-video</string>
</array>
<key>LSTypeIsPackage</key>
<false/>
Expand Down Expand Up @@ -156,7 +156,9 @@
<key>SUEnableAutomaticChecks</key>
<string>YES</string>
<key>SUFeedURL</key>
<string>http://griff.github.com/metaz/releases.xml</string>
<string>http://maven-group.org/metaz/appcast.xml</string>
<key>SUEnableSystemProfiling</key>
<string>YES</string>
<key>SUPublicDSAKeyFile</key>
<string>sparkle_public.pem</string>
<key>SmartCrashReports_CompanyName</key>
Expand All @@ -180,6 +182,10 @@
<string>The Other MPEG-4 Video</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.mime-type</key>
<array>
<string>video/x-m4v</string>
</array>
<key>com.apple.ostype</key>
<array>
<string>M4V</string>
Expand Down
Binary file added App/resources/modified.tiff
Binary file not shown.
Binary file added App/resources/modified_header.tiff
Binary file not shown.
Binary file added App/resources/modified_selected.tiff
Binary file not shown.
5 changes: 5 additions & 0 deletions App/src/AppController.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

#import <Cocoa/Cocoa.h>
#import <Sparkle/Sparkle.h>
#import "MZMetaLoader.h"
#import "FilesUndoController.h"
#import "ResizeController.h"
Expand Down Expand Up @@ -45,6 +46,8 @@
ChapterEditor* chapterEditor;
NSProgressIndicator* loadingIndicator;
NSInteger loadings;
NSArrayController* picturesController;
SUUpdater* updater;

MZFileNameTextStorage* fileNameStorage;
NSTextView* fileNameEditor;
Expand All @@ -67,6 +70,8 @@
@property (nonatomic, retain) IBOutlet NSSearchField* searchField;
@property (nonatomic, retain) IBOutlet ChapterEditor* chapterEditor;
@property (nonatomic, retain) IBOutlet NSProgressIndicator* loadingIndicator;
@property (nonatomic, retain) IBOutlet NSArrayController* picturesController;
@property (nonatomic, retain) IBOutlet SUUpdater* updater;
@property (readonly) NSInteger remainingInShortDescription;

+ (void)initialize;
Expand Down
30 changes: 27 additions & 3 deletions App/src/AppController.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// Copyright 2009 Maven-Group. All rights reserved.
//

#import <Growl/Growl.h>
#import "AppController.h"
#import "UndoTableView.h"
#import "PosterView.h"
Expand All @@ -15,6 +14,7 @@
#import "FakeSearchResult.h"
#import "SearchMeta.h"
#import "FilesTableView.h"
#import "Resources.h"

#define MaxShortDescription 256

Expand Down Expand Up @@ -81,6 +81,8 @@ @implementation AppController
@synthesize searchField;
@synthesize chapterEditor;
@synthesize remainingInShortDescription;
@synthesize picturesController;
@synthesize updater;
@synthesize loadingIndicator;

#pragma mark - initialization
Expand Down Expand Up @@ -110,6 +112,8 @@ - (id)init

-(void)awakeFromNib
{
[NSTimeZone setDefaultTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"UTC"]];

[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(finishedSearch:)
Expand Down Expand Up @@ -161,6 +165,7 @@ -(void)awakeFromNib
forKeyPath:@"selection.shortDescription"
options:0
context:nil];
[updater setSendsSystemProfile:YES];
}

-(void)dealloc {
Expand Down Expand Up @@ -192,6 +197,8 @@ -(void)dealloc {
[chapterEditor release];
[fileNameEditor release];
[fileNameStorage release];
[picturesController release];
[updater release];
[super dealloc];
}
#pragma mark - private
Expand Down Expand Up @@ -604,6 +611,15 @@ - (IBAction)applySearchEntry:(id)sender
}
}

id picture = [picturesController valueForKeyPath:@"selection.self"];
MZLoggerDebug(@"Picture is %@", picture);
if([picture isKindOfClass:[MZRemoteData class]])
{
if(![picture isLoaded])
return;
}


NSArray* edits = [filesController selectedObjects];
for(MetaEdits* edit in edits)
{
Expand All @@ -626,6 +642,13 @@ - (IBAction)applySearchEntry:(id)sender
[chapterEditor setChanged:[NSNumber numberWithBool:YES]];
}
}
else if([[tag identifier] isEqual:MZPictureTagIdent])
{
if([picture isKindOfClass:[MZRemoteData class]])
picture = [picture data];
if(picture)
[edit setterValue:picture forKey:[tag identifier]];
}
else
{
if([value isKindOfClass:[MZRemoteData class]])
Expand Down Expand Up @@ -654,13 +677,13 @@ - (IBAction)showHomepage:(id)sender

- (IBAction)showIssues:(id)sender
{
NSURL* url = [NSURL URLWithString:@"http://metaz.lighthouseapp.com/projects/43700-metaz/tickets/bins/95786"];
NSURL* url = [NSURL URLWithString:@"https://github.com/griff/metaz/issues"];
[[NSWorkspace sharedWorkspace] openURL:url];
}

- (IBAction)reportIssue:(id)sender
{
NSURL* url = [NSURL URLWithString:@"http://metaz.lighthouseapp.com/projects/43700-metaz/tickets/new"];
NSURL* url = [NSURL URLWithString:@"https://github.com/griff/metaz/issues/new"];
[[NSWorkspace sharedWorkspace] openURL:url];
}

Expand Down Expand Up @@ -845,6 +868,7 @@ - (void)queueStatusChanged:(GTMKeyValueChangeNotification *)notification
#pragma mark - as window delegate

- (NSSize)windowWillResize:(NSWindow *)aWindow toSize:(NSSize)proposedFrameSize {
[[NSNotificationCenter defaultCenter] postNotificationName:MZNSWindowWillResizeNotification object:aWindow];
return [resizeController windowWillResize:aWindow toSize:proposedFrameSize];
}

Expand Down
19 changes: 19 additions & 0 deletions App/src/EnsureArrayTransformer.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// EnsureArrayTransformer.h
// MetaZ
//
// Created by Brian Olsen on 18/12/11.
// Copyright 2011 Maven-Group. All rights reserved.
//

#import <Cocoa/Cocoa.h>


@interface EnsureArrayTransformer : NSValueTransformer {

}

+ (Class)transformedValueClass;
+ (BOOL)allowsReverseTransformation;

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

#import "EnsureArrayTransformer.h"


@implementation EnsureArrayTransformer

+ (Class)transformedValueClass
{
return [NSArray class];
}

+ (BOOL)allowsReverseTransformation; { return NO; }

- (id)transformedValue:(id)value
{
if(value == nil) return [NSArray array];
if([value isKindOfClass:[NSArray class]])
{
NSLog(@"Transforming %d", [value count]);
return value;
}
return [NSArray arrayWithObject:value];
}

@end
41 changes: 41 additions & 0 deletions App/src/FilesTableView.m
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,12 @@ - (BOOL)pasteboardHasTypes {
return bestType != nil;
}

- (IBAction)revertChanges:(id)sender {
NSNumber* num = [filesController valueForKeyPath:@"selection.fileNameChanged"];
num = [NSNumber numberWithBool:![num boolValue]];
[filesController setValue:num forKeyPath:@"selection.fileNameChanged"];
}

#pragma mark - user interface validation
- (BOOL)validateUserInterfaceItem:(id < NSValidatedUserInterfaceItem >)anItem {
SEL action = [anItem action];
Expand All @@ -199,6 +205,21 @@ - (BOOL)validateUserInterfaceItem:(id < NSValidatedUserInterfaceItem >)anItem {
return [self numberOfSelectedRows] == 1;
if(action == @selector(paste:))
return [self pasteboardHasTypes];
if(action == @selector(revertChanges:))
{
if([[filesController selectedObjects] count] >= 1)
{
BOOL changed = [[filesController valueForKeyPath:@"selection.fileNameChanged"] boolValue];
NSMenuItem* item = (NSMenuItem*)anItem;
if(changed)
[item setTitle:NSLocalizedString(@"Revert Changes", @"Revert changes menu item")];
else
[item setTitle:NSLocalizedString(@"Apply Changes", @"Apply changes menu item")];
return YES;
}
else
return NO;
}
return [super validateUserInterfaceItem:anItem];
}

Expand Down Expand Up @@ -438,11 +459,31 @@ - (void)registerUndoName:(NSUndoManager *)manager
object:manager];
}

- (NSCell *)preparedCellAtColumn:(NSInteger)columnIndex row:(NSInteger)rowIndex
{
NSCell* aCell = [super preparedCellAtColumn:columnIndex row:rowIndex];
NSTableColumn* column = [[self tableColumns] objectAtIndex:columnIndex];
if([[column identifier] isEqualToString:@"status"])
{
NSButtonCell* cell = (NSButtonCell*)aCell;
if([self isRowSelected:rowIndex])
{
[cell setAlternateImage:[NSImage imageNamed:@"modified_selected"]];
} else {
[cell setAlternateImage:[NSImage imageNamed:@"modified"]];
}
}
return aCell;
}

#pragma mark - general

- (void)awakeFromNib
{
NSTableColumn* status = [self tableColumnWithIdentifier:@"status"];
NSImage *image = [NSImage imageNamed:@"modified_header"];
[[status headerCell] setImage:image];

[self setDataSource:self];
}

Expand Down
3 changes: 2 additions & 1 deletion App/src/MGCollectionView.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

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

@class MGCollectionViewItem;
@class MGCollectionView;
Expand Down Expand Up @@ -41,7 +42,7 @@ typedef NSInteger MGCollectionViewDropOperation;
MGCollectionViewItem* itemPrototype;
NSArray* content;
NSMutableArray* _targetItems;
NSViewAnimation* _animation;
MGViewAnimation* _animation;
NSRect _targetViewFrameRect;
BOOL needsLayout;
NSArray* backgroundColors;
Expand Down
2 changes: 1 addition & 1 deletion App/src/MGCollectionView.m
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ - (void)_applyTargetConfiguration:(BOOL)animate
if(animations.count > 0)
{
[_animation release];
_animation = [[NSViewAnimation alloc] initWithViewAnimations:animations];
_animation = [[MGViewAnimation alloc] initWithViewAnimations:animations];
[_animation setDuration:0.5]; // half a second.
[_animation setAnimationCurve:NSAnimationEaseIn];

Expand Down
2 changes: 1 addition & 1 deletion App/src/MZFileNameTextStorage.m
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ - (void)addAttribute:(NSString *)name value:(id)value range:(NSRange)aRange
- (NSRange)doubleClickAtIndex:(NSUInteger)index
{
NSRange result = [super doubleClickAtIndex:index];
NSRange range = NSMakeRange(0,index-1);
NSRange range = NSMakeRange(0,index == 0 ? 0 : index-1);
NSRange found = [[text string]
rangeOfCharacterFromSet:[NSCharacterSet punctuationCharacterSet]
options:NSBackwardsSearch
Expand Down
1 change: 1 addition & 0 deletions App/src/MZMetaLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ MZKIT_EXTERN NSString* const MZMetaLoaderFinishedNotification;

- (NSArray *)types;
- (void)removeAllObjects;
- (void)removeFilesAtIndexes:(NSIndexSet *)indexes;
- (BOOL)loadFromFile:(NSString *)fileName;
- (BOOL)loadFromFiles:(NSArray *)fileNames;
- (BOOL)loadFromFile:(NSString *)fileName toIndex:(NSUInteger)index;
Expand Down
6 changes: 6 additions & 0 deletions App/src/MZMetaLoader.m
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ -(void)removeAllObjects
[self didChangeValueForKey:@"files"];
}

- (void)removeFilesAtIndexes:(NSIndexSet *)indexes
{
[self willChangeValueForKey:@"files"];
[files removeObjectsAtIndexes:indexes];
[self didChangeValueForKey:@"files"];
}

-(BOOL)loadFromFile:(NSString *)fileName
{
Expand Down
42 changes: 42 additions & 0 deletions App/src/MZMultiGrowlWrapper.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
//
// MZMultiGrowlWrapper.h
// MetaZ
//
// Created by Brian Olsen on 17/01/12.
// Copyright 2012 Maven-Group. All rights reserved.
//

#import <Cocoa/Cocoa.h>


@interface MZMultiGrowlWrapper : NSObject {
Class GrowlApplicationBridge;
}

+ (MZMultiGrowlWrapper *)shared;
+ (void) notifyWithTitle:(NSString *)title
description:(NSString *)description
notificationName:(NSString *)notifName
iconData:(NSData *)iconData
priority:(signed int)priority
isSticky:(BOOL)isSticky
clickContext:(id)clickContext;
+ (BOOL)isGrowlSupported;
+ (void)setGrowlDelegate:(id)delegate;
+ (BOOL)isGrowlRunning;
+ (BOOL)isMistEnabled;

- (id)init;
- (BOOL)isGrowlSupported;
- (BOOL)isGrowlRunning;
- (BOOL)isMistEnabled;
- (void)setGrowlDelegate:(id)delegate;
- (void) notifyWithTitle:(NSString *)title
description:(NSString *)description
notificationName:(NSString *)notifName
iconData:(NSData *)iconData
priority:(signed int)priority
isSticky:(BOOL)isSticky
clickContext:(id)clickContext;

@end
Loading

0 comments on commit 3d42de9

Please sign in to comment.