- (void)application:(NSApplication *)sender openFiles:(NSArray *)filenames
{
- [self.mainController openFile:[NSURL fileURLWithPath:filenames.firstObject]];
+ [self.mainController openURL:[NSURL fileURLWithPath:filenames.firstObject]];
[NSApp replyToOpenOrPrint:NSApplicationDelegateReplySuccess];
}
{
// since we are not a currently encoding item, we can just be edit it
HBJob *item = [[self.jobs[row] representedObject] copy];
- [self.controller openJob:item];
-
- // Now that source is loaded and settings applied, delete the queue item from the queue
- [self.outlineView beginUpdates];
- [self removeQueueItemAtIndex:row];
- [self.outlineView removeItemsAtIndexes:[NSIndexSet indexSetWithIndex:row] inParent:nil withAnimation:NSTableViewAnimationEffectFade];
- [self.outlineView endUpdates];
+ if ([self.controller openJob:item])
+ {
+ // Now that source is loaded and settings applied, delete the queue item from the queue
+ [self.outlineView beginUpdates];
+ [self removeQueueItemAtIndex:row];
+ [self.outlineView removeItemsAtIndexes:[NSIndexSet indexSetWithIndex:row] inParent:nil withAnimation:NSTableViewAnimationEffectFade];
+ [self.outlineView endUpdates];
- [self getQueueStats];
+ [self getQueueStats];
+ }
}
}
[self cancelCurrentJobAndContinue];
}
- [self.jobs beginTransaction];
- [self.controller openJob:job];
- [self removeQueueItemAtIndex:index];
- [self.jobs commit];
+ if ([self.controller openJob:job])
+ {
+ [self.jobs beginTransaction];
+ [self.controller openJob:job];
+ [self removeQueueItemAtIndex:index];
+ [self.jobs commit];
+ [self getQueueStats];
+ }
}
}