if ([base isEqualToString:@"url"]) {
// This kind of URL can contain slashes in the argument, so we can't parse them below.
NSString *destination = [[url absoluteString] substringFromIndex:([scheme length] + [@"://" length] + [base length] + [@"/" length])];
- controller = [[[CYBrowserController alloc] init] autorelease];
- [(CYBrowserController *)controller loadURL:[NSURL URLWithString:destination]];
+ controller = [[[CYBrowserController alloc] initWithURL:[NSURL URLWithString:destination]] autorelease];
} else if ([components count] == 1) {
if ([base isEqualToString:@"manage"]) {
controller = [[[ManageController alloc] init] autorelease];
+ (void) _initialize;
+- (void) setURL:(NSURL *)url;
+
- (void) loadURL:(NSURL *)url cachePolicy:(NSURLRequestCachePolicy)policy;
- (void) loadURL:(NSURL *)url;
- (bool) isLoading;
- (id) init;
+- (id) initWithURL:(NSURL *)url;
- (id) initWithWidth:(float)width;
- (id) initWithWidth:(float)width ofClass:(Class)_class;
#include "substrate.h"
#define ForSaurik 0
+#define DefaultTimeout_ 120.0
template <typename Type_>
static inline void CYRelease(Type_ &value) {
[super dealloc];
}
+- (void) setURL:(NSURL *)url {
+ _assert(request_ == nil);
+
+ request_ = [[NSURLRequest
+ requestWithURL:url
+ cachePolicy:NSURLRequestUseProtocolCachePolicy
+ timeoutInterval:DefaultTimeout_
+ ] retain];
+}
+
- (void) loadURL:(NSURL *)url cachePolicy:(NSURLRequestCachePolicy)policy {
[self loadRequest:[NSURLRequest
requestWithURL:url
cachePolicy:policy
- timeoutInterval:120.0
+ timeoutInterval:DefaultTimeout_
]];
}
}
}
+- (void) reloadData {
+ [super reloadData];
+ [self reloadURL];
+}
+
- (void) setButtonImage:(NSString *)button withStyle:(NSString *)style toFunction:(id)function {
if (custom_ != nil)
[custom_ autorelease];
return [self initWithWidth:0];
}
+- (id) initWithURL:(NSURL *)url {
+ if ((self = [self init]) != nil) {
+ [self setURL:url];
+ } return self;
+}
+
- (void) didDismissModalViewController {
if (closer_ != nil)
[self callFunction:closer_];