aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMemphiz <memphis@machzwo.de>2013-02-26 23:59:42 +0100
committerMemphiz <memphis@machzwo.de>2013-02-26 23:59:42 +0100
commit76470c98128b76746a22ed579c04234d92ab219f (patch)
tree33bc3c1ac9a6ec19f34b877fdcd555dafe704948
parent94873053135c9b7cd21d10486d4783c0e74cca09 (diff)
[atv2] - if users diddle XBMC into the toprow with plist manipulation - prevent crash - but show our nice topshelf logo instead
-rw-r--r--xbmc/osx/atv2/XBMCAppliance.mm25
1 files changed, 25 insertions, 0 deletions
diff --git a/xbmc/osx/atv2/XBMCAppliance.mm b/xbmc/osx/atv2/XBMCAppliance.mm
index 58c3d8e4cf..11eb530b9b 100644
--- a/xbmc/osx/atv2/XBMCAppliance.mm
+++ b/xbmc/osx/atv2/XBMCAppliance.mm
@@ -72,6 +72,7 @@ static Class BRApplianceCategoryCls;
@class XBMCAppliance;
@class BRTopShelfView;
@class XBMCApplianceInfo;
+@class BRMainMenuImageControl;
// SECTIONCOMMENT
// orig method handlers we wanna call in hooked methods
@@ -147,6 +148,7 @@ static id (*XBMCAppliance$applianceInfo$Orig)(XBMCAppliance*, SEL);
}
- (void) selectCategoryWithIdentifier:(id)identifier;
- (id) topShelfView;
+- (id) mainMenuShelfView;
// added in 4.1+
- (void) refresh;
@end
@@ -176,6 +178,29 @@ static id (*XBMCAppliance$applianceInfo$Orig)(XBMCAppliance*, SEL);
return topShelf;
}
+// this method is called with the new ios ui (ios 5.1 and higher)
+// its similar to the topshelf view on the opd ios gui
+// but its more mighty (thats we we need to dig one level deeper here)
+// to get our loogo visible
+- (id) mainMenuShelfView;
+{
+ Class BRTopShelfViewCls = objc_getClass("BRTopShelfView");
+ Class BRImageCls = objc_getClass("BRImage");
+
+ id topShelf = [[BRTopShelfViewCls alloc] init];
+
+ // first hook into the mainMenuImageControl
+ // which is a wrapper for an image control
+ BRMainMenuImageControl *mainMenuImageControl = (BRMainMenuImageControl *)MSHookIvar<id>(topShelf, "_productImage");
+ // now get the image instance
+ BRImageControl *imageControl = (BRImageControl *)MSHookIvar<id>(mainMenuImageControl, "_content");// hook the image so we can diddle with it
+
+ // load our logo into it
+ BRImage *gpImage = [BRImageCls imageWithPath:[[NSBundle bundleForClass:[XBMCATV2Detector class]] pathForResource:@"XBMC" ofType:@"png"]];
+ [imageControl setImage:gpImage];
+ return topShelf;
+}
+
- (void) refresh
{
}