summaryrefslogtreecommitdiffstats
path: root/macosx/HBQueueController.m
diff options
context:
space:
mode:
authorritsuka <[email protected]>2015-02-20 07:59:38 +0000
committerritsuka <[email protected]>2015-02-20 07:59:38 +0000
commit214fed29cdc153d4c0581bc0516b258a108cef22 (patch)
tree105b8454670e28f33a721a4d0b328dc2565a2446 /macosx/HBQueueController.m
parentfea0f7fa7473a10e56d6da95f47e03ba44ad2c35 (diff)
MacGui: refactor the stderr/stdout redirect code to be more modular.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6927 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/HBQueueController.m')
-rw-r--r--macosx/HBQueueController.m20
1 files changed, 10 insertions, 10 deletions
diff --git a/macosx/HBQueueController.m b/macosx/HBQueueController.m
index fb7ff6385..aab0b0530 100644
--- a/macosx/HBQueueController.m
+++ b/macosx/HBQueueController.m
@@ -10,7 +10,6 @@
#import "HBCore.h"
#import "HBController.h"
#import "HBAppDelegate.h"
-#import "HBOutputPanelController.h"
#import "HBQueueOutlineView.h"
#import "HBUtilities.h"
@@ -22,6 +21,9 @@
#import "HBDockTile.h"
+#import "HBOutputRedirect.h"
+#import "HBJobOutputFileWriter.h"
+
// Pasteboard type for or drag operations
#define DragDropSimplePboardType @"HBQueueCustomOutlineViewPboardType"
@@ -43,6 +45,7 @@
@property (nonatomic, readonly) HBDistributedArray *jobs;
@property (nonatomic, retain) HBJob *currentJob;
+@property (nonatomic, retain) HBJobOutputFileWriter *currentLog;
@property (nonatomic, readwrite) BOOL stop;
@@ -59,13 +62,6 @@
{
if (self = [super initWithWindowNibName:@"Queue"])
{
- // NSWindowController likes to lazily load its window nib. Since this
- // controller tries to touch the outlets before accessing the window, we
- // need to force it to load immadiately by invoking its accessor.
- //
- // If/when we switch to using bindings, this can probably go away.
- [self window];
-
_descriptions = [[NSMutableDictionary alloc] init];
// Workaround to avoid a bug in Snow Leopard
@@ -462,7 +458,9 @@
self.currentJob.state = HBJobStateWorking;
// Tell HB to output a new activity log file for this encode
- [self.outputPanel startEncodeLog:self.currentJob.destURL];
+ self.currentLog = [[[HBJobOutputFileWriter alloc] initWithJob:self.currentJob] autorelease];
+ [[HBOutputRedirect stderrRedirect] addListener:self.currentLog];
+ [[HBOutputRedirect stdoutRedirect] addListener:self.currentLog];
// now we can go ahead and scan the new pending queue item
[self performScan:self.currentJob.fileURL titleIdx:self.currentJob.titleIdx];
@@ -483,7 +481,9 @@
{
// Since we are done with this encode, tell output to stop writing to the
// individual encode log.
- [self.outputPanel endEncodeLog];
+ [[HBOutputRedirect stderrRedirect] removeListener:self.currentLog];
+ [[HBOutputRedirect stdoutRedirect] removeListener:self.currentLog];
+ self.currentLog = nil;
// Check to see if the encode state has not been cancelled
// to determine if we should check for encode done notifications.