}
+ (NSDictionary *) currentConfiguration;
++ (NSString *) currentPath;
@end
return [cydget objectForKey:@"CYConfiguration"] ?: [cydget objectForKey:@"Configuration"];
}
++ (NSDictionary *) currentPath {
+ NSDictionary *cydget([cydgets_ objectAtIndex:active_]);
+ return [cydget objectForKey:@"CYPath"];
+}
+
@end
@interface SBUserAgent : NSObject
cydgets_ = [NSMutableArray arrayWithCapacity:4];
for (NSDictionary *cydget in cydgets)
- if ([[cydget objectForKey:@"Active"] boolValue])
- if (NSDictionary *info = [NSDictionary dictionaryWithContentsOfFile:[NSString stringWithFormat:@"%@/%@.cydget/Info.plist", Cydgets_, [cydget objectForKey:@"Name"]]])
+ if ([[cydget objectForKey:@"Active"] boolValue]) {
+ NSString *path([NSString stringWithFormat:@"%@/%@.cydget/Info.plist", Cydgets_, [cydget objectForKey:@"Name"]]);
+ if (NSMutableDictionary *info = [NSMutableDictionary dictionaryWithContentsOfFile:path]) {
+ [info setObject:path forKey:@"CYPath"];
[cydgets_ addObject:info];
+ }
+ }
if ([cydgets_ count] == 0)
cydgets_ = nil;
@protocol CydgetController
- (NSDictionary *) currentConfiguration;
+- (NSString *) currentPath;
@end
static Class $CydgetController(objc_getClass("CydgetController"));
}
- (void) loadView {
+ NSURL *base([NSURL fileURLWithPath:[$CydgetController currentPath]]);
+
if (NSString *background = [configuration_ objectForKey:@"Background"])
- background_ = [[WebCydgetLockScreenView alloc] initWithURL:[NSURL URLWithString:background]];
+ background_ = [[WebCydgetLockScreenView alloc] initWithURL:[NSURL URLWithString:background relativeToURL:base]];
if (NSString *homepage = [configuration_ objectForKey:@"Homepage"])
- [self setView:[[[WebCydgetLockScreenView alloc] initWithURL:[NSURL URLWithString:homepage]] autorelease]];
+ [self setView:[[[WebCydgetLockScreenView alloc] initWithURL:[NSURL URLWithString:homepage relativeToURL:base]] autorelease]];
else if (kCFCoreFoundationVersionNumber < 800 && background_ != nil) {
[self setView:[background_ autorelease]];
background_ = nil;
CYPlugin = "WebCycriptLockScreen";
CYConfiguration = {
- Homepage = "file:///System/Library/LockCydgets/PhotoExample.cydget/index.html";
+ Background = "index.html";
CycriptURLs = "^file:///System/Library/LockCydgets/PhotoExample\\.cydget/index\\.html$";
Scrollable = "NO";
};
CYPlugin = "WebCycriptLockScreen";
CYConfiguration = {
- Homepage = "file:///System/Library/LockCydgets/Welcome.cydget/Welcome.html";
+ Homepage = "Welcome.html";
CycriptURLs = "^file:///System/Library/LockCydgets/Welcome\\.cydget/Welcome\\.html$";
Scrollable = "NO";
};