Skip to content
This repository has been archived by the owner on Jan 3, 2019. It is now read-only.

Commit

Permalink
disable/hide features related to tom-tech.com
Browse files Browse the repository at this point in the history
  • Loading branch information
dinkypumpkin committed Apr 25, 2017
1 parent 247b9eb commit 657de68
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 34 deletions.
28 changes: 22 additions & 6 deletions AppController.m
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ - (id)init {

NSString *defaultDownloadDirectory = @"~/Movies/TV Shows";
defaultValues[@"DownloadPath"] = [defaultDownloadDirectory stringByExpandingTildeInPath];
defaultValues[@"Proxy"] = @"Provided";
defaultValues[@"Proxy"] = @"None";
defaultValues[@"CustomProxy"] = @"";
defaultValues[@"AutoRetryFailed"] = @YES;
defaultValues[@"AutoRetryTime"] = @"30";
Expand All @@ -77,7 +77,7 @@ - (id)init {
defaultValues[@"XBMC_naming"] = @NO;
defaultValues[@"KeepSeriesFor"] = @"30";
defaultValues[@"RemoveOldSeries"] = @NO;
defaultValues[@"QuickCache"] = @YES;
defaultValues[@"QuickCache"] = @NO;
defaultValues[@"TagShows"] = @YES;
defaultValues[@"BBCOne"] = @YES;
defaultValues[@"BBCTwo"] = @YES;
Expand Down Expand Up @@ -112,6 +112,7 @@ - (id)init {
defaultValues[@"AltCacheITV_TV"] = @NO;
defaultValues[@"AudioDescribedNew"] = @NO;
defaultValues[@"SignedNew"] = @NO;
defaultValues[@"TomTech"] = @NO;

[[NSUserDefaults standardUserDefaults] registerDefaults:defaultValues];
defaultValues = nil;
Expand All @@ -128,7 +129,17 @@ - (id)init {
[[NSUserDefaults standardUserDefaults] removeObjectForKey:@"AlternateFormat"];
[[NSUserDefaults standardUserDefaults] removeObjectForKey:@"Cache4oD_TV"];
[[NSUserDefaults standardUserDefaults] removeObjectForKey:@"CacheBBC_Podcasts"];


// disable/hide features dependent on tom-tech.com
if ([[[NSUserDefaults standardUserDefaults] valueForKey:@"TomTech"] isEqualTo:@NO]) {
if ([[[NSUserDefaults standardUserDefaults] valueForKey:@"QuickCache"] isEqualTo:@YES]) {
[[NSUserDefaults standardUserDefaults] setValue:@NO forKey:@"QuickCache"];
}
if ([[[NSUserDefaults standardUserDefaults] valueForKey:@"Proxy"] isEqualToString:@"Provided"]) {
[[NSUserDefaults standardUserDefaults] setValue:@"None" forKey:@"Proxy"];
}
}

//Make sure Application Support folder exists
NSString *folder = @"~/Library/Application Support/Get iPlayer Automator/";
folder = [folder stringByExpandingTildeInPath];
Expand Down Expand Up @@ -876,8 +887,10 @@ - (void)getiPlayerUpdateFinished
}

//Check for Updates - Don't want to prompt the user when updates are running.
SUUpdater *updater = [SUUpdater sharedUpdater];
[updater checkForUpdatesInBackground];
if ([[[NSUserDefaults standardUserDefaults] valueForKey:@"TomTech"] isEqualTo:@YES]) {
SUUpdater *updater = [SUUpdater sharedUpdater];
[updater checkForUpdatesInBackground];
}

if (runDownloads)
{
Expand Down Expand Up @@ -1401,7 +1414,9 @@ - (void)nextDownload:(NSNotification *)note
NSLog(@"ERROR: Growl notification failed (nextDownload - complete): %@: %@", [e name], [e description]);
[logger addToLog:[NSString stringWithFormat:@"ERROR: Growl notification failed (nextDownload - complete): %@: %@", [e name], [e description]]];
}
[[SUUpdater sharedUpdater] checkForUpdatesInBackground];
if ([[[NSUserDefaults standardUserDefaults] valueForKey:@"TomTech"] isEqualTo:@YES]) {
[[SUUpdater sharedUpdater] checkForUpdatesInBackground];
}

if (downloadsFailed>0)
[solutionsWindow makeKeyAndOrderFront:self];
Expand Down Expand Up @@ -2002,6 +2017,7 @@ - (IBAction)restoreDefaults:(id)sender
[sharedDefaults removeObjectForKey:@"AltCacheITV_TV"];
[sharedDefaults removeObjectForKey:@"AudiodescribedNew"];
[sharedDefaults removeObjectForKey:@"SignedNew"];
[sharedDefaults removeObjectForKey:@"TomTech"];
}
- (void)applescriptStartDownloads
{
Expand Down
85 changes: 57 additions & 28 deletions English.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
Expand Up @@ -466,12 +466,24 @@
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="showFeedback:" target="621" id="1011"/>
<binding destination="668" name="enabled" keyPath="values.TomTech" id="hnb-vu-uK5"/>
<binding destination="668" name="hidden" keyPath="values.TomTech" previousBinding="hnb-vu-uK5" id="Fcb-yL-3a2">
<dictionary key="options">
<string key="NSValueTransformerName">NSNegateBoolean</string>
</dictionary>
</binding>
</connections>
</menuItem>
<menuItem title="Check for Updates..." id="1003">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="checkForUpdates:" target="987" id="1005"/>
<binding destination="668" name="enabled" keyPath="values.TomTech" id="rVq-zm-Juj"/>
<binding destination="668" name="hidden" keyPath="values.TomTech" previousBinding="rVq-zm-Juj" id="8ov-cD-Jxv">
<dictionary key="options">
<string key="NSValueTransformerName">NSNegateBoolean</string>
</dictionary>
</binding>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="1002"/>
Expand Down Expand Up @@ -1557,6 +1569,9 @@
<buttonCell type="radio" title="Provided" imagePosition="left" alignment="left" imageScaling="proportionallyDown" inset="2" id="559">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
<connections>
<binding destination="668" name="enabled" keyPath="values.TomTech" id="uvA-h0-jER"/>
</connections>
</buttonCell>
<buttonCell type="radio" title="None" imagePosition="left" alignment="left" state="on" imageScaling="proportionallyDown" inset="2" id="561" userLabel="None">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
Expand Down Expand Up @@ -1841,37 +1856,17 @@
<binding destination="668" name="value" keyPath="values.SignedNew" id="klz-kq-uMx"/>
</connections>
</button>
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" id="1479">
<rect key="frame" x="14" y="76" width="100" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Quick Caching:" id="1480">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button id="1481">
<rect key="frame" x="117" y="75" width="22" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="1482">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<binding destination="668" name="value" keyPath="values.QuickCache" id="1483"/>
</connections>
</button>
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" id="1484">
<rect key="frame" x="14" y="51" width="291" height="17"/>
<textField verticalHuggingPriority="750" misplaced="YES" allowsCharacterPickerTouchBarItem="YES" id="1484">
<rect key="frame" x="14" y="76" width="291" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Tag Downloaded Programmes with Metadata:" id="1485">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button id="1486">
<rect key="frame" x="308" y="49" width="22" height="18"/>
<button misplaced="YES" id="1486">
<rect key="frame" x="308" y="74" width="22" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="1487">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
Expand Down Expand Up @@ -1904,6 +1899,40 @@
<binding destination="668" name="value" keyPath="values.CacheITV_TV" id="jRb-OC-Zbd"/>
</connections>
</button>
<textField verticalHuggingPriority="750" misplaced="YES" allowsCharacterPickerTouchBarItem="YES" id="1479">
<rect key="frame" x="15" y="51" width="100" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Quick Caching:" id="1480">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<connections>
<binding destination="668" name="enabled" keyPath="values.TomTech" id="Kx5-LS-ThD"/>
<binding destination="668" name="hidden" keyPath="values.TomTech" previousBinding="Kx5-LS-ThD" id="DFY-Lh-TMG">
<dictionary key="options">
<string key="NSValueTransformerName">NSNegateBoolean</string>
</dictionary>
</binding>
</connections>
</textField>
<button misplaced="YES" id="1481">
<rect key="frame" x="118" y="50" width="22" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="1482">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<binding destination="668" name="enabled" keyPath="values.TomTech" id="dd5-n4-8RI"/>
<binding destination="668" name="hidden" keyPath="values.TomTech" previousBinding="dd5-n4-8RI" id="UYO-nS-98h">
<dictionary key="options">
<string key="NSValueTransformerName">NSNegateBoolean</string>
</dictionary>
</binding>
<binding destination="668" name="value" keyPath="values.QuickCache" id="1483"/>
</connections>
</button>
</subviews>
</view>
</tabViewItem>
Expand All @@ -1917,7 +1946,7 @@
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<clipView key="contentView" id="iNe-PX-Coi">
<rect key="frame" x="1" y="0.0" width="403" height="119"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnSelection="YES" multipleSelection="NO" autosaveColumns="NO" headerView="1079" id="1078">
<rect key="frame" x="0.0" y="0.0" width="403" height="102"/>
Expand Down Expand Up @@ -1983,7 +2012,7 @@
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<clipView key="contentView" id="Yo1-zO-Vaa">
<rect key="frame" x="1" y="0.0" width="403" height="119"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnSelection="YES" multipleSelection="NO" autosaveColumns="NO" headerView="1086" id="1087">
<rect key="frame" x="0.0" y="0.0" width="403" height="102"/>
Expand Down Expand Up @@ -2103,7 +2132,7 @@
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<clipView key="contentView" id="Xcv-fl-nad">
<rect key="frame" x="1" y="0.0" width="403" height="119"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnSelection="YES" multipleSelection="NO" autosaveColumns="NO" headerView="IKG-gn-2PC" id="gbz-Rl-ARO">
<rect key="frame" x="0.0" y="0.0" width="403" height="96"/>
Expand Down Expand Up @@ -2599,7 +2628,7 @@
</tabView>
</subviews>
</view>
<point key="canvasLocation" x="-613" y="-253"/>
<point key="canvasLocation" x="-105" y="-332"/>
</window>
<window title="Download History" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="DownloadHistoryWindow" animationBehavior="default" id="1212" userLabel="Download History">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
Expand Down

0 comments on commit 657de68

Please sign in to comment.