OSDN Git Service

MacGui: Add encoding status readout to the queue window
authordynaflash <dynaflash@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Mon, 22 Sep 2008 14:44:13 +0000 (14:44 +0000)
committerdynaflash <dynaflash@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Mon, 22 Sep 2008 14:44:13 +0000 (14:44 +0000)
- is fed info from controller.mm instead of the old setup which had another NSTimer polling libhb just for the queue.

git-svn-id: svn://localhost/HandBrake/trunk@1742 b64f7644-9d1e-0410-96f1-a4d463321fa5

macosx/Controller.mm
macosx/English.lproj/Queue.xib
macosx/HBQueueController.h
macosx/HBQueueController.mm

index f9dabba..5fe2d6f 100644 (file)
@@ -599,6 +599,12 @@ static NSString *        ChooseSourceIdentifier             = @"Choose Source It
             [fStatusField setStringValue: [NSString stringWithFormat:
                                            NSLocalizedString( @"Queue Scanning title %d of %d...", @"" ),
                                            p.title_cur, p.title_count]];
+            
+            /* Set the status string in fQueueController as well */                               
+            [fQueueController setQueueStatusString: [NSString stringWithFormat:
+                                           NSLocalizedString( @"Queue Scanning title %d of %d...", @"" ),
+                                           p.title_cur, p.title_count]];
+            
             [fRipIndicator setHidden: NO];
             [fRipIndicator setDoubleValue: 100.0 * ( p.title_cur - 1 ) / p.title_count];
             break;
@@ -635,7 +641,8 @@ static NSString *        ChooseSourceIdentifier             = @"Choose Source It
             }
             
             [fStatusField setStringValue: string];
-            
+            /* Set the status string in fQueueController as well */
+            [fQueueController setQueueStatusString: string];
             /* Update slider */
                        progress_total = ( p.progress + p.job_cur - 1 ) / p.job_count;
             [fRipIndicator setIndeterminate: NO];
@@ -671,7 +678,8 @@ static NSString *        ChooseSourceIdentifier             = @"Choose Source It
         {
             /* Update text field */
             [fStatusField setStringValue: NSLocalizedString( @"Muxing...", @"" )];
-            
+            /* Set the status string in fQueueController as well */
+            [fQueueController setQueueStatusString: NSLocalizedString( @"Muxing...", @"" )];
             /* Update slider */
             [fRipIndicator setIndeterminate: YES];
             [fRipIndicator startAnimation: nil];
@@ -685,6 +693,7 @@ static NSString *        ChooseSourceIdentifier             = @"Choose Source It
             
         case HB_STATE_PAUSED:
                    [fStatusField setStringValue: NSLocalizedString( @"Paused", @"" )];
+            [fQueueController setQueueStatusString: NSLocalizedString( @"Paused", @"" )];
             
                        break;
             
@@ -695,7 +704,9 @@ static NSString *        ChooseSourceIdentifier             = @"Choose Source It
             // out the remaining passes/jobs in the queue. We'll do that here.
             
             // Delete all remaining jobs of this encode.
-            [fStatusField setStringValue: NSLocalizedString( @"Done.", @"" )];
+            [fStatusField setStringValue: NSLocalizedString( @"Encode Finished.", @"" )];
+            /* Set the status string in fQueueController as well */
+            [fQueueController setQueueStatusString: NSLocalizedString( @"Encode Finished.", @"" )];
             [fRipIndicator setIndeterminate: NO];
             [fRipIndicator setDoubleValue: 0.0];
             [[fWindow toolbar] validateVisibleItems];
index 3e0b272..c648719 100644 (file)
                                                <object class="NSTextField" id="463845363">
                                                        <reference key="NSNextResponder" ref="431299686"/>
                                                        <int key="NSvFlags">264</int>
-                                                       <string key="NSFrame">{{17, 373}, {176, 14}}</string>
+                                                       <string key="NSFrame">{{17, 398}, {148, 14}}</string>
                                                        <reference key="NSSuperview" ref="431299686"/>
                                                        <bool key="NSEnabled">YES</bool>
                                                        <object class="NSTextFieldCell" key="NSCell" id="617812287">
                                                                <reference key="NSTextColor" ref="434514744"/>
                                                        </object>
                                                </object>
+                                               <object class="NSTextField" id="138063786">
+                                                       <reference key="NSNextResponder" ref="431299686"/>
+                                                       <int key="NSvFlags">264</int>
+                                                       <string key="NSFrame">{{17, 376}, {540, 14}}</string>
+                                                       <reference key="NSSuperview" ref="431299686"/>
+                                                       <bool key="NSEnabled">YES</bool>
+                                                       <object class="NSTextFieldCell" key="NSCell" id="108133680">
+                                                               <int key="NSCellFlags">67239424</int>
+                                                               <int key="NSCellFlags2">272760832</int>
+                                                               <string key="NSContents">There are no jobs currently encoding</string>
+                                                               <reference key="NSSupport" ref="26"/>
+                                                               <reference key="NSControlView" ref="138063786"/>
+                                                               <reference key="NSBackgroundColor" ref="987568653"/>
+                                                               <reference key="NSTextColor" ref="434514744"/>
+                                                       </object>
+                                               </object>
                                        </object>
                                        <string key="NSFrameSize">{574, 423}</string>
                                        <reference key="NSSuperview"/>
                                        </object>
                                        <int key="connectionID">2645</int>
                                </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">fProgressTextField</string>
+                                               <reference key="source" ref="678333032"/>
+                                               <reference key="destination" ref="138063786"/>
+                                       </object>
+                                       <int key="connectionID">2648</int>
+                               </object>
                        </object>
                        <object class="IBMutableOrderedSet" key="objectRecords">
                                <object class="NSArray" key="orderedObjects">
                                                <object class="NSMutableArray" key="children">
                                                        <bool key="EncodedWithXMLCoder">YES</bool>
                                                        <reference ref="60629844"/>
+                                                       <reference ref="138063786"/>
                                                        <reference ref="463845363"/>
                                                </object>
                                                <reference key="parent" ref="238545558"/>
                                                <reference key="object" ref="617812287"/>
                                                <reference key="parent" ref="463845363"/>
                                        </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">2646</int>
+                                               <reference key="object" ref="138063786"/>
+                                               <object class="NSMutableArray" key="children">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <reference ref="108133680"/>
+                                               </object>
+                                               <reference key="parent" ref="431299686"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">2647</int>
+                                               <reference key="object" ref="108133680"/>
+                                               <reference key="parent" ref="138063786"/>
+                                       </object>
                                </object>
                        </object>
                        <object class="NSMutableDictionary" key="flattenedProperties">
                                        <string>2625.ImportedFromIB2</string>
                                        <string>2643.IBShouldRemoveOnLegacySave</string>
                                        <string>2644.IBShouldRemoveOnLegacySave</string>
+                                       <string>2646.IBPluginDependency</string>
+                                       <string>2646.ImportedFromIB2</string>
                                </object>
                                <object class="NSMutableArray" key="dict.values">
                                        <bool key="EncodedWithXMLCoder">YES</bool>
                                        <integer value="1" id="9"/>
                                        <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
                                        <reference ref="9"/>
-                                       <string>{{87, 422}, {574, 423}}</string>
+                                       <string>{{311, 67}, {574, 423}}</string>
                                        <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
-                                       <string>{{87, 422}, {574, 423}}</string>
+                                       <string>{{311, 67}, {574, 423}}</string>
                                        <reference ref="9"/>
                                        <reference ref="9"/>
                                        <reference ref="9"/>
                                        <reference ref="9"/>
                                        <reference ref="9"/>
                                        <reference ref="9"/>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <reference ref="9"/>
                                </object>
                        </object>
                        <object class="NSMutableDictionary" key="unlocalizedProperties">
                                </object>
                        </object>
                        <nil key="sourceID"/>
-                       <int key="maxID">2645</int>
+                       <int key="maxID">2648</int>
                </object>
                <object class="IBClassDescriber" key="IBDocument.Classes">
                        <object class="NSMutableArray" key="referencedPartialClassDescriptions">
index 9237979..06856f0 100644 (file)
@@ -130,7 +130,7 @@ BOOL                        fIsDragging;
 - (void) animateWorkingEncodeIconInQueue;
 - (void) startAnimatingCurrentWorkingEncodeInQueue;
 - (void) stopAnimatingCurrentJobGroupInQueue;
-
+- (void)setQueueStatusString: (NSString *)statusString;
 
 - (IBAction)showQueueWindow: (id)sender;
 
index 0e14761..b32e4de 100644 (file)
@@ -188,6 +188,15 @@ if (fWorkingCount > 0)
     [fQueueCountField setStringValue:string];
 
 }
+/* This method sets the status string in the queue window
+ * and is called from Controller.mm (fHBController)
+ * instead of running another timer here polling libhb
+ * for encoding status
+ */
+- (void)setQueueStatusString: (NSString *)statusString
+{
+[fProgressTextField setStringValue:statusString];
+}
 
 //------------------------------------------------------------------------------------
 // dealloc