]> granicus.if.org Git - handbrake/commitdiff
MacGui: remove redundant "enabled" property in a few view controller. Cosmetics in...
authorritsuka <damiog@gmail.com>
Sat, 27 Dec 2014 12:29:00 +0000 (12:29 +0000)
committerritsuka <damiog@gmail.com>
Sat, 27 Dec 2014 12:29:00 +0000 (12:29 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6660 b64f7644-9d1e-0410-96f1-a4d463321fa5

macosx/Controller.h
macosx/Controller.m
macosx/English.lproj/Audio.xib
macosx/English.lproj/Subtitles.xib
macosx/English.lproj/Video.xib
macosx/HBAudioController.h
macosx/HBAudioController.m
macosx/HBSubtitlesController.h
macosx/HBSubtitlesController.m
macosx/HBVideoController.h
macosx/HBVideoController.m

index 8fdbdb155eb8e3e941ccbabaf1bdf37c3e47dd0b..c8292fcdaac9ac1e90ab73535341d4db9b5017b5 100644 (file)
@@ -25,7 +25,7 @@
 @class HBPresetsManager;
 @class HBDockTile;
 
-@interface HBController : NSObject <NSApplicationDelegate, GrowlApplicationBridgeDelegate, HBPictureControllerDelegate, NSDrawerDelegate>
+@interface HBController : NSObject <NSApplicationDelegate, NSDrawerDelegate, GrowlApplicationBridgeDelegate>
 {
     IBOutlet NSWindow            * fWindow;
 
 - (void) processNewQueueEncode;
 - (void) clearQueueEncodedItems;
 /* Queue Editing */
-- (IBAction)rescanQueueItemToMainWindow:(NSUInteger) selectedQueueItem;
-
+- (void)rescanQueueItemToMainWindow:(NSUInteger) selectedQueueItem;
 
 - (void) removeQueueFileItem:(NSUInteger) queueItemToRemove;
 - (void) clearQueueAllItems;
 - (IBAction) showAddPresetPanel: (id) sender;
 - (IBAction)selectDefaultPreset:(id)sender;
 - (IBAction)addFactoryPresets:(id)sender;
-
--(void)sendToMetaX:(NSString *) filePath;
-// Growl methods
-- (NSDictionary *) registrationDictionaryForGrowl;
--(void)showGrowlDoneNotification:(NSString *) filePath;
 - (IBAction)showDebugOutputPanel:(id)sender;
 
 - (void) remindUserOfSleepOrShutdown;
index 9aa0157814ac864c5092d1e4056f727ad705149a..a31a522a13bc966bfe4dd5712e44d137439f1ee5 100644 (file)
@@ -25,7 +25,7 @@
 // DockTile update freqency in total percent increment
 #define dockTileUpdateFrequency                  0.1f
 
-@interface HBController () <HBPresetsViewControllerDelegate, HBPreviewControllerDelegate>
+@interface HBController () <HBPresetsViewControllerDelegate, HBPreviewControllerDelegate, HBPictureControllerDelegate>
 
 @property (nonatomic, copy) NSString *browsedSourceDisplayName;
 
     }
 
     fPresetsView.enabled = b;
-    fVideoController.enabled = b;
-    fAudioController.enabled = b;
-    fSubtitlesViewController.enabled = b;
 }
 
 /**
         // to determine if we should check for encode done notifications.
         if (fEncodeState != 2)
         {
-            NSString *pathOfFinishedEncode;
             // Get the output file name for the finished encode
             HBJob *finishedJob = QueueFileArray[currentQueueEncodeIndex];
-            pathOfFinishedEncode = finishedJob.destURL.path;
 
             // Both the Growl Alert and Sending to tagger can be done as encodes roll off the queue
             if ([[[NSUserDefaults standardUserDefaults] stringForKey:@"AlertWhenDone"] isEqualToString: @"Growl Notification"] ||
                 {
                     NSBeep();
                 }
-                [self showGrowlDoneNotification:pathOfFinishedEncode];
+                [self showGrowlDoneNotification:finishedJob.destURL];
             }
 
             // Send to tagger
-            [self sendToMetaX:pathOfFinishedEncode];
+            [self sendToExternalApp:finishedJob.destURL];
 
             // since we have successfully completed an encode, we increment the queue counter
             [self incrementQueueItemDone:currentQueueEncodeIndex];
 
 #pragma mark -
 #pragma mark Encode Done Actions
-// register a test notification and make
-// it enabled by default
+
 #define SERVICE_NAME @"Encode Done"
+
+/**
+ *  Register a test notification and make
+ *  it enabled by default
+ */
 - (NSDictionary *)registrationDictionaryForGrowl 
 { 
-    NSDictionary *registrationDictionary = [NSDictionary dictionaryWithObjectsAndKeys: 
-    [NSArray arrayWithObjects:SERVICE_NAME,nil], GROWL_NOTIFICATIONS_ALL, 
-    [NSArray arrayWithObjects:SERVICE_NAME,nil], GROWL_NOTIFICATIONS_DEFAULT, 
-    nil]; 
-
-    return registrationDictionary; 
-} 
-
--(void)showGrowlDoneNotification:(NSString *) filePath
-{
-    /* This end of encode action is called as each encode rolls off of the queue */
-    /* Setup the Growl stuff */
-    NSString * finishedEncode = filePath;
-    /* strip off the path to just show the file name */
-    finishedEncode = [finishedEncode lastPathComponent];
-    NSString * growlMssg = [NSString stringWithFormat: @"your HandBrake encode %@ is done!",finishedEncode];
-    [GrowlApplicationBridge 
-     notifyWithTitle:@"Put down that cocktail…" 
-     description:growlMssg 
-     notificationName:SERVICE_NAME
-     iconData:nil 
-     priority:0 
-     isSticky:1 
-     clickContext:nil];
-}
--(void)sendToMetaX:(NSString *) filePath
-{
-    /* This end of encode action is called as each encode rolls off of the queue */
+    return @{GROWL_NOTIFICATIONS_ALL: @[SERVICE_NAME],
+             GROWL_NOTIFICATIONS_DEFAULT: @[SERVICE_NAME]};
+}
+
+- (void)showGrowlDoneNotification:(NSURL *)fileURL
+{
+    // This end of encode action is called as each encode rolls off of the queue
+    // Setup the Growl stuff
+    NSString *growlMssg = [NSString stringWithFormat:@"your HandBrake encode %@ is done!", fileURL.lastPathComponent];
+    [GrowlApplicationBridge notifyWithTitle:@"Put down that cocktail…"
+                                description:growlMssg
+                           notificationName:SERVICE_NAME
+                                   iconData:nil
+                                   priority:0
+                                   isSticky:1
+                               clickContext:nil];
+}
+
+- (void)sendToExternalApp:(NSURL *)fileURL
+{
+    // This end of encode action is called as each encode rolls off of the queue
     if([[NSUserDefaults standardUserDefaults] boolForKey: @"sendToMetaX"] == YES)
     {
-        NSString *sendToApp = [[NSUserDefaults standardUserDefaults] objectForKey: @"SendCompletedEncodeToApp"];
+        NSString *sendToApp = [[NSUserDefaults standardUserDefaults] objectForKey:@"SendCompletedEncodeToApp"];
         if (![sendToApp isEqualToString:@"None"])
         {
             [HBUtilities writeToActivityLog: "trying to send encode to: %s", [sendToApp UTF8String]];
-            NSAppleScript *myScript = [[NSAppleScript alloc] initWithSource: [NSString stringWithFormat: @"%@%@%@%@%@", @"tell application \"",sendToApp,@"\" to open (POSIX file \"", filePath, @"\")"]];
+            NSAppleScript *myScript = [[NSAppleScript alloc] initWithSource: [NSString stringWithFormat: @"%@%@%@%@%@", @"tell application \"",sendToApp,@"\" to open (POSIX file \"", fileURL.path, @"\")"]];
             [myScript executeAndReturnError: nil];
             [myScript release];
         }
-        
     }
 }
 
index 51e62d99e7d673b1bae14566a56bf1b6733a680e..6c3d5cb865e3365bb7b2683bf45fa96a7c264d34 100644 (file)
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="5056" systemVersion="14A329r" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6254" systemVersion="14C81f" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
     <dependencies>
-        <deployment version="1060" defaultVersion="1060" identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="5056"/>
+        <deployment version="1060" identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6254"/>
     </dependencies>
     <objects>
         <customObject id="-2" userLabel="File's Owner" customClass="HBAudioController">
@@ -15,7 +15,7 @@
             </connections>
         </customObject>
         <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
-        <customObject id="-3" userLabel="Application"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
         <arrayController id="iWY-gv-3ab" userLabel="Audio Inputs">
             <declaredKeys>
                 <string>keyAudioTrackName</string>
@@ -66,7 +66,7 @@
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
                             <tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="firstColumnOnly" columnReordering="NO" multipleSelection="NO" autosaveColumns="NO" typeSelect="NO" rowHeight="25" headerView="GLD-lI-qeh" id="LlC-ua-mth">
-                                <rect key="frame" x="0.0" y="0.0" width="884" height="248"/>
+                                <rect key="frame" x="0.0" y="0.0" width="884" height="27"/>
                                 <autoresizingMask key="autoresizingMask"/>
                                 <size key="intercellSpacing" width="3" height="2"/>
                                 <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                                     </tableColumn>
                                 </tableColumns>
                                 <connections>
+                                    <binding destination="-2" name="enabled" keyPath="self.job" id="FGZ-gP-H5Y">
+                                        <dictionary key="options">
+                                            <string key="NSValueTransformerName">NSIsNotNil</string>
+                                        </dictionary>
+                                    </binding>
                                     <outlet property="menu" destination="hyy-qd-qpe" id="e5W-aS-mPB"/>
                                 </connections>
                             </tableView>
                     </buttonCell>
                     <connections>
                         <action selector="showSettingsSheet:" target="-2" id="D9K-M3-zHd"/>
+                        <binding destination="-2" name="enabled" keyPath="self.job" id="VMC-Xv-X3R">
+                            <dictionary key="options">
+                                <string key="NSValueTransformerName">NSIsNotNil</string>
+                            </dictionary>
+                        </binding>
                     </connections>
                 </button>
                 <button verticalHuggingPriority="750" id="wcL-rL-aYS">
                     </buttonCell>
                     <connections>
                         <action selector="reloadDefaults:" target="-2" id="k9I-I9-T2U"/>
+                        <binding destination="-2" name="enabled" keyPath="self.job" id="rta-fa-Ezd">
+                            <dictionary key="options">
+                                <string key="NSValueTransformerName">NSIsNotNil</string>
+                            </dictionary>
+                        </binding>
                     </connections>
                 </button>
                 <popUpButton verticalHuggingPriority="750" id="jrP-M5-2Rq">
                             </items>
                         </menu>
                     </popUpButtonCell>
+                    <connections>
+                        <binding destination="-2" name="enabled" keyPath="self.job" id="FGP-3D-g2t">
+                            <dictionary key="options">
+                                <string key="NSValueTransformerName">NSIsNotNil</string>
+                            </dictionary>
+                        </binding>
+                    </connections>
                 </popUpButton>
             </subviews>
         </view>
index ee41c85244cca45142f33b31bb488d14221e8934..9d971f5ba42abff2394ca5d5b5dea129dfb2b26f 100644 (file)
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="5056" systemVersion="13F14" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6254" systemVersion="14C81f" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
     <dependencies>
-        <deployment version="1060" defaultVersion="1060" identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="5056"/>
+        <deployment version="1060" identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6254"/>
     </dependencies>
     <objects>
         <customObject id="-2" userLabel="File's Owner" customClass="HBSubtitlesController">
@@ -15,7 +15,7 @@
             </connections>
         </customObject>
         <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
-        <customObject id="-3" userLabel="Application"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
         <customView id="Hz6-mo-xeY">
             <rect key="frame" x="0.0" y="0.0" width="926" height="322"/>
             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
@@ -28,7 +28,7 @@
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
                             <tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="firstColumnOnly" columnReordering="NO" multipleSelection="NO" autosaveColumns="NO" typeSelect="NO" rowHeight="25" headerView="IiW-3a-Drv" id="0yM-wE-D2x">
-                                <rect key="frame" x="0.0" y="0.0" width="884" height="248"/>
+                                <rect key="frame" x="0.0" y="0.0" width="884" height="27"/>
                                 <autoresizingMask key="autoresizingMask"/>
                                 <size key="intercellSpacing" width="3" height="2"/>
                                 <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                                     </tableColumn>
                                 </tableColumns>
                                 <connections>
+                                    <binding destination="-2" name="enabled" keyPath="self.job" id="PJP-qc-FJe">
+                                        <dictionary key="options">
+                                            <string key="NSValueTransformerName">NSIsNotNil</string>
+                                        </dictionary>
+                                    </binding>
                                     <outlet property="dataSource" destination="-2" id="DH5-v0-2ba"/>
                                     <outlet property="delegate" destination="-2" id="Dfm-tw-89m"/>
                                     <outlet property="menu" destination="KgC-dn-Hq2" id="Iff-7t-kdg"/>
                         <autoresizingMask key="autoresizingMask"/>
                     </scroller>
                     <scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="GfM-TU-Tmr">
-                        <rect key="frame" x="-15" y="17" width="16" height="0.0"/>
                         <autoresizingMask key="autoresizingMask"/>
                     </scroller>
                     <tableHeaderView key="headerView" id="IiW-3a-Drv">
                             </items>
                         </menu>
                     </popUpButtonCell>
+                    <connections>
+                        <binding destination="-2" name="enabled" keyPath="self.job" id="FLd-lw-rWb">
+                            <dictionary key="options">
+                                <string key="NSValueTransformerName">NSIsNotNil</string>
+                            </dictionary>
+                        </binding>
+                    </connections>
                 </popUpButton>
                 <button verticalHuggingPriority="750" id="QsM-28-Pya">
                     <rect key="frame" x="110" y="288" width="140" height="28"/>
                     </buttonCell>
                     <connections>
                         <action selector="showSettingsSheet:" target="-2" id="OAA-S8-tfS"/>
+                        <binding destination="-2" name="enabled" keyPath="self.job" id="Nuv-KK-HdK">
+                            <dictionary key="options">
+                                <string key="NSValueTransformerName">NSIsNotNil</string>
+                            </dictionary>
+                        </binding>
                     </connections>
                 </button>
                 <button verticalHuggingPriority="750" id="Vxx-gk-9kY">
                     </buttonCell>
                     <connections>
                         <action selector="addTracksFromDefaults:" target="-2" id="GOz-FT-Atg"/>
+                        <binding destination="-2" name="enabled" keyPath="self.job" id="Mxg-ln-sW9">
+                            <dictionary key="options">
+                                <string key="NSValueTransformerName">NSIsNotNil</string>
+                            </dictionary>
+                        </binding>
                     </connections>
                 </button>
             </subviews>
index 3ef74c34f6d144b16fc00c5887fb36e4c4acd847..06c9a60b10b5692e1c2b09e4c406f01a7ae9fc42 100644 (file)
                         <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                     </textFieldCell>
                     <connections>
-                        <binding destination="-2" name="enabled2" keyPath="self.enabled" previousBinding="mjs-X8-KV8" id="Gpe-Tm-7wn">
+                        <binding destination="-2" name="enabled2" keyPath="self.video" previousBinding="mjs-X8-KV8" id="VTs-xH-tZg">
                             <dictionary key="options">
                                 <integer key="NSMultipleValuesPlaceholder" value="-1"/>
                                 <integer key="NSNoSelectionPlaceholder" value="-1"/>
                                 <integer key="NSNotApplicablePlaceholder" value="-1"/>
                                 <integer key="NSNullPlaceholder" value="-1"/>
+                                <string key="NSValueTransformerName">NSIsNotNil</string>
                             </dictionary>
                         </binding>
                         <binding destination="-2" name="value" keyPath="self.video.avgBitrate" id="7eN-5J-5WV"/>
                         </menu>
                     </popUpButtonCell>
                     <connections>
-                        <binding destination="-2" name="enabled" keyPath="self.enabled" id="mpI-26-Ajl"/>
+                        <binding destination="-2" name="enabled" keyPath="self.video" id="yN5-l3-JRJ">
+                            <dictionary key="options">
+                                <string key="NSValueTransformerName">NSIsNotNil</string>
+                            </dictionary>
+                        </binding>
                         <binding destination="-2" name="selectedValue" keyPath="self.video.frameRate" previousBinding="Heu-SS-Uwq" id="XC7-GV-Uae">
                             <dictionary key="options">
                                 <bool key="NSAllowsEditingMultipleValuesSelection" value="NO"/>
                         <font key="font" metaFont="smallSystem"/>
                     </buttonCell>
                     <connections>
-                        <binding destination="-2" name="enabled2" keyPath="self.enabled" previousBinding="7aV-7j-MzB" id="GSP-bg-aKw">
+                        <binding destination="-2" name="enabled2" keyPath="self.video" previousBinding="7aV-7j-MzB" id="c4g-dz-q05">
                             <dictionary key="options">
                                 <integer key="NSMultipleValuesPlaceholder" value="-1"/>
                                 <integer key="NSNoSelectionPlaceholder" value="-1"/>
                                 <integer key="NSNotApplicablePlaceholder" value="-1"/>
                                 <integer key="NSNullPlaceholder" value="-1"/>
+                                <string key="NSValueTransformerName">NSIsNotNil</string>
                             </dictionary>
                         </binding>
                         <binding destination="-2" name="enabled" keyPath="self.video.qualityType" id="7aV-7j-MzB">
                         <font key="font" metaFont="smallSystem"/>
                     </buttonCell>
                     <connections>
-                        <binding destination="-2" name="enabled2" keyPath="self.enabled" previousBinding="iZE-er-OQN" id="DQs-Z1-77T">
+                        <binding destination="-2" name="enabled2" keyPath="self.video" previousBinding="iZE-er-OQN" id="Fbv-qd-JTg">
                             <dictionary key="options">
                                 <integer key="NSMultipleValuesPlaceholder" value="-1"/>
                                 <integer key="NSNoSelectionPlaceholder" value="-1"/>
                                 <integer key="NSNotApplicablePlaceholder" value="-1"/>
                                 <integer key="NSNullPlaceholder" value="-1"/>
+                                <string key="NSValueTransformerName">NSIsNotNil</string>
                             </dictionary>
                         </binding>
-                        <binding destination="-2" name="enabled" keyPath="self.video.qualityType" id="iZE-er-OQN">
+                        <binding destination="-2" name="hidden" keyPath="self.video.twoPass" previousBinding="Fbv-qd-JTg" id="jpH-IH-e0p">
                             <dictionary key="options">
                                 <string key="NSValueTransformerName">NSNegateBoolean</string>
                             </dictionary>
                         </binding>
-                        <binding destination="-2" name="value" keyPath="self.video.turboTwoPass" id="4A4-hg-qhy"/>
-                        <binding destination="-2" name="hidden" keyPath="self.video.twoPass" previousBinding="DQs-Z1-77T" id="sfq-sw-XJu">
+                        <binding destination="-2" name="enabled" keyPath="self.video.qualityType" id="iZE-er-OQN">
                             <dictionary key="options">
                                 <string key="NSValueTransformerName">NSNegateBoolean</string>
                             </dictionary>
                         </binding>
+                        <binding destination="-2" name="value" keyPath="self.video.turboTwoPass" id="4A4-hg-qhy"/>
                     </connections>
                 </button>
                 <popUpButton verticalHuggingPriority="750" id="xwK-Yu-a1e">
                         </menu>
                     </popUpButtonCell>
                     <connections>
-                        <binding destination="-2" name="enabled" keyPath="self.enabled" id="kKW-qz-38E"/>
+                        <binding destination="-2" name="enabled" keyPath="self.video" id="Dhc-7W-mCB">
+                            <dictionary key="options">
+                                <string key="NSValueTransformerName">NSIsNotNil</string>
+                            </dictionary>
+                        </binding>
                         <binding destination="-2" name="selectedValue" keyPath="self.video.encoder" previousBinding="PbS-nr-Hjk" id="h1y-Vg-Gyg">
                             <dictionary key="options">
                                 <bool key="NSAllowsEditingMultipleValuesSelection" value="NO"/>
                         </column>
                     </cells>
                     <connections>
-                        <binding destination="-2" name="enabled" keyPath="self.enabled" id="RaB-VA-rgV"/>
+                        <binding destination="-2" name="enabled" keyPath="self.video" id="Bhn-TM-mbV">
+                            <dictionary key="options">
+                                <string key="NSValueTransformerName">NSIsNotNil</string>
+                            </dictionary>
+                        </binding>
                         <binding destination="-2" name="selectedTag" keyPath="self.video.qualityType" id="Bpj-MC-Zf7"/>
                     </connections>
                 </matrix>
                         </column>
                     </cells>
                     <connections>
-                        <binding destination="-2" name="enabled" keyPath="self.enabled" id="7Cn-NH-MAP"/>
+                        <binding destination="-2" name="enabled" keyPath="self.video" id="RUB-wC-Q0A">
+                            <dictionary key="options">
+                                <string key="NSValueTransformerName">NSIsNotNil</string>
+                            </dictionary>
+                        </binding>
                         <binding destination="-2" name="selectedIndex" keyPath="self.video.frameRateMode" id="tJr-26-Y2P"/>
                     </connections>
                 </matrix>
                         <font key="font" metaFont="miniSystem"/>
                     </sliderCell>
                     <connections>
-                        <binding destination="-2" name="enabled2" keyPath="self.enabled" previousBinding="wCA-ag-GHJ" id="EOE-Cw-D0K">
+                        <binding destination="-2" name="enabled2" keyPath="self.video" previousBinding="wCA-ag-GHJ" id="ywk-WQ-GNY">
                             <dictionary key="options">
                                 <integer key="NSMultipleValuesPlaceholder" value="-1"/>
                                 <integer key="NSNoSelectionPlaceholder" value="-1"/>
                                 <integer key="NSNotApplicablePlaceholder" value="-1"/>
                                 <integer key="NSNullPlaceholder" value="-1"/>
+                                <string key="NSValueTransformerName">NSIsNotNil</string>
                             </dictionary>
                         </binding>
                         <binding destination="-2" name="value" keyPath="self.video.quality" previousBinding="nAO-gB-Jbd" id="C3d-pR-fJ2">
                         <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
                     </textFieldCell>
                     <connections>
+                        <binding destination="-2" name="enabled" keyPath="self.video" id="Ph9-Gy-Sru">
+                            <dictionary key="options">
+                                <string key="NSValueTransformerName">NSIsNotNil</string>
+                            </dictionary>
+                        </binding>
                         <binding destination="-2" name="value" keyPath="pictureSettings" id="hem-VY-3fR"/>
-                        <binding destination="-2" name="enabled" keyPath="self.enabled" id="uv0-Gi-gXH"/>
                         <binding destination="-2" name="textColor" keyPath="self.labelColor" id="aVY-g8-jGq"/>
                     </connections>
                 </textField>
                         <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
                     </textFieldCell>
                     <connections>
+                        <binding destination="-2" name="enabled" keyPath="self.video" id="ckY-jh-UvA">
+                            <dictionary key="options">
+                                <string key="NSValueTransformerName">NSIsNotNil</string>
+                            </dictionary>
+                        </binding>
                         <binding destination="-2" name="value" keyPath="pictureFilters" id="Sr7-JI-M4y"/>
-                        <binding destination="-2" name="enabled" keyPath="self.enabled" id="Joa-BW-Ekr"/>
                         <binding destination="-2" name="textColor" keyPath="self.labelColor" id="FtS-pM-hKz"/>
                     </connections>
                 </textField>
@@ -552,7 +580,11 @@ Set this if your device is struggling to play the output (dropped frames).</stri
                         <font key="font" metaFont="smallSystem"/>
                     </buttonCell>
                     <connections>
-                        <binding destination="-2" name="enabled" keyPath="self.enabled" id="eDg-nl-sf5"/>
+                        <binding destination="-2" name="enabled" keyPath="self.video" id="GDV-uX-eAs">
+                            <dictionary key="options">
+                                <string key="NSValueTransformerName">NSIsNotNil</string>
+                            </dictionary>
+                        </binding>
                         <binding destination="-2" name="value" keyPath="self.video.advancedOptions" id="sQg-ab-NdN"/>
                     </connections>
                 </button>
index 2476bdfbb9f149a46eda1fb41ed3aea4dadc5ae7..775c6f32b5dfc0c4af90a214cb3d7e965e90b165 100644 (file)
@@ -6,7 +6,6 @@
 //
 
 #import <Cocoa/Cocoa.h>
-#import "HBViewValidation.h"
 
 extern NSString *keyAudioTrackIndex;
 extern NSString *keyAudioTrackName;
@@ -26,7 +25,7 @@ extern NSString *HBMixdownChangedNotification;
  *
  *  Responds to HBContainerChangedNotification.
  */
-@interface HBAudioController : NSViewController <HBViewValidation>
+@interface HBAudioController : NSViewController
 
 @property (nonatomic, readonly, retain) NSArray *masterTrackArray;
 @property (nonatomic, readonly) NSDictionary *noneTrack;
index 0c1c492930b87fbde2ffd9445423f670dbe6bd8b..d657e773fa93c68a10ef9cf8e5d82da3a14a340a 100644 (file)
@@ -58,7 +58,6 @@ NSString *HBMixdownChangedNotification = @"HBMixdownChangedNotification";
 @synthesize masterTrackArray;
 @synthesize noneTrack;
 @synthesize videoContainerTag;
-@synthesize enabled = _enabled;
 
 - (instancetype)init
 {
@@ -97,18 +96,9 @@ NSString *HBMixdownChangedNotification = @"HBMixdownChangedNotification";
     [self switchingTrackFromNone:nil];
 }
 
-- (void)setEnabled:(BOOL)enabled
-{
-    _enabled = enabled;
-    [fTableView setEnabled:enabled];
-    [self.trackPopup setEnabled:enabled];
-    [self.configureDefaults setEnabled:enabled];
-    [self.reloadDefaults setEnabled:enabled];
-}
-
 - (BOOL)validateUserInterfaceItem:(id < NSValidatedUserInterfaceItem >)anItem
 {
-    return self.enabled;
+    return (self.job != nil);
 }
 
 #pragma mark -
@@ -407,6 +397,7 @@ NSString *HBMixdownChangedNotification = @"HBMixdownChangedNotification";
     
     if (job)
     {
+        _job = job;
         [audioArray release];
         audioArray = [job.audioTracks retain];
         self.settings = job.audioDefaults;
@@ -431,6 +422,7 @@ NSString *HBMixdownChangedNotification = @"HBMixdownChangedNotification";
     }
     else
     {
+        _job = nil;
         [audioArray release];
         audioArray = nil;
         self.settings = nil;
index 56fc0dcb8c3b4cc389e1ee61ff5955a8505df93c..1d681349eda64848704d29f1b03a0c9ac580a3c5 100644 (file)
@@ -5,7 +5,6 @@
  It may be used under the terms of the GNU General Public License. */
 
 #import <Cocoa/Cocoa.h>
-#import "HBViewValidation.h"
 
 extern NSString *keySubTrackName;
 extern NSString *keySubTrackIndex;
@@ -27,7 +26,7 @@ extern NSString *keySubTrackSrtCharCode;
  *  HBSubtitlesController
  *  Responds to HBContainerChangedNotification.
  */
-@interface HBSubtitlesController : NSViewController <HBViewValidation>
+@interface HBSubtitlesController : NSViewController
 
 - (void)applySettingsFromPreset:(NSDictionary *)preset;
 
index 590093f5a23fb26ba5cd0be5b13dcdcbad78541a..5f836289c041950ffc6685710b7e6e9ed2638ac4 100644 (file)
@@ -68,8 +68,6 @@ NSString *keySubTrackLanguageIndex = @"keySubTrackLanguageIndex";
 
 @implementation HBSubtitlesController
 
-@synthesize enabled = _enabled;
-
 - (instancetype)init
 {
     self = [super initWithNibName:@"Subtitles" bundle:nil];
@@ -93,15 +91,6 @@ NSString *keySubTrackLanguageIndex = @"keySubTrackLanguageIndex";
     return self;
 }
 
-- (void)setEnabled:(BOOL)enabled
-{
-    [self.trackPopUp setEnabled:enabled];
-    [self.configureDefaults setEnabled:enabled];
-    [self.reloadDefaults setEnabled:enabled];
-    [self.fTableView setEnabled:enabled];
-    _enabled = enabled;
-}
-
 - (void)setJob:(HBJob *)job
 {
     /* reset the subtitles arrays */
@@ -111,6 +100,7 @@ NSString *keySubTrackLanguageIndex = @"keySubTrackLanguageIndex";
 
     if (job)
     {
+        _job = job;
         self.subtitleArray = job.subtitlesTracks;
         self.settings = job.subtitlesDefaults;
         self.subtitleSourceArray = [[job.title.subtitlesTracks mutableCopy] autorelease];
@@ -172,6 +162,10 @@ NSString *keySubTrackLanguageIndex = @"keySubTrackLanguageIndex";
         // to display a "None" row in the table view
         [self.subtitleArray addObject:[self createSubtitleTrack]];
     }
+    else
+    {
+        _job = nil;
+    }
 
     [self.fTableView reloadData];    
 }
@@ -195,7 +189,7 @@ NSString *keySubTrackLanguageIndex = @"keySubTrackLanguageIndex";
 
 - (BOOL)validateUserInterfaceItem:(id < NSValidatedUserInterfaceItem >)anItem
 {
-    return self.enabled;
+    return (self.job != nil);
 }
 
 /**
index 3289b58eec4c9046a850cf84e8bb9d41b0522e65..c0c572fa6306fc930113baa6e09161a0b6b82810 100644 (file)
@@ -5,7 +5,6 @@
  It may be used under the terms of the GNU General Public License. */
 
 #import <Cocoa/Cocoa.h>
-#import "HBViewValidation.h"
 
 @class HBController;
 @class HBAdvancedController;
@@ -15,7 +14,7 @@
 /**
  *  HBVideoController
  */
-@interface HBVideoController : NSViewController <HBViewValidation>
+@interface HBVideoController : NSViewController
 
 - (instancetype)initWithAdvancedController:(HBAdvancedController *)advancedController;
 
@@ -25,6 +24,6 @@
 @property (nonatomic, copy, readwrite) NSString *pictureSettings;
 @property (nonatomic, copy, readwrite) NSString *pictureFilters;
 
-@property (nonatomic, readwrite, retain) HBVideo *video;
+@property (nonatomic, readwrite, assign) HBVideo *video;
 
 @end
index fa0bb192e2770b4687b82f059b95dcbeffd84cc0..95a956bdaee481f669ca2ddaea2db5a3a83bf3b2 100644 (file)
@@ -45,8 +45,6 @@ static void *HBVideoControllerContext = &HBVideoControllerContext;
 
 @implementation HBVideoController
 
-@synthesize enabled = _enabled;
-
 - (instancetype)initWithAdvancedController:(HBAdvancedController *)advancedController
 {
     self = [self init];
@@ -62,6 +60,8 @@ static void *HBVideoControllerContext = &HBVideoControllerContext;
     self = [super initWithNibName:@"Video" bundle:nil];
     if (self)
     {
+        _labelColor = [[NSColor disabledControlTextColor] retain];
+
         // Observe the advanced tab pref shown/hided state.
         [[NSUserDefaultsController sharedUserDefaultsController] addObserver:self
                                                                   forKeyPath:@"values.HBShowAdvancedTab"
@@ -84,11 +84,11 @@ static void *HBVideoControllerContext = &HBVideoControllerContext;
     return self;
 }
 
-- (void)setEnabled:(BOOL)flag
+- (void)setVideo:(HBVideo *)video
 {
-    _enabled = flag;
+    _video = video;
 
-    if (_enabled)
+    if (_video)
     {
         self.labelColor = [NSColor controlTextColor];
     }
@@ -97,7 +97,7 @@ static void *HBVideoControllerContext = &HBVideoControllerContext;
         self.labelColor = [NSColor disabledControlTextColor];
     }
 
-    [self enableEncoderOptionsWidgets:flag];
+    [self enableEncoderOptionsWidgets:(video != nil)];
 }
 
 #pragma mark - KVO
@@ -151,7 +151,7 @@ static void *HBVideoControllerContext = &HBVideoControllerContext;
                 }
             }
             // enable/disable, populate and update the various widgets
-            [self enableEncoderOptionsWidgets:self.enabled];
+            [self enableEncoderOptionsWidgets:(self.video != nil)];
 
         } else if ([keyPath isEqualToString:@"values.HBShowAdvancedTab"])
         {