X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=OSX%2FXScreenSaverConfigSheet.m;h=46b73dee9a1a6e56ccfcab3321d43018e0a71476;hp=e179dd0b0f8b4160ba63397e0c1faa5c6f39dbaf;hb=019de959b265701cd0c3fccbb61f2b69f06bf9ee;hpb=c70f94f648d51bb4828193124f325fa52b0e57f3 diff --git a/OSX/XScreenSaverConfigSheet.m b/OSX/XScreenSaverConfigSheet.m index e179dd0b..46b73dee 100644 --- a/OSX/XScreenSaverConfigSheet.m +++ b/OSX/XScreenSaverConfigSheet.m @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 2006-2012 Jamie Zawinski +/* xscreensaver, Copyright (c) 2006-2013 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -24,6 +24,7 @@ */ #import "XScreenSaverConfigSheet.h" +#import "Updater.h" #import "jwxyz.h" #import "InvertedSlider.h" @@ -48,6 +49,7 @@ #endif // USE_IPHONE #undef LABEL_ABOVE_SLIDER +#define USE_HTML_LABELS #pragma mark XML Parser @@ -191,6 +193,222 @@ typedef enum { SimpleXMLCommentKind, # endif // !USE_PICKER_VIEW +# pragma mark Implementing labels with clickable links + +#if defined(USE_IPHONE) && defined(USE_HTML_LABELS) + +@interface HTMLLabel : UIView +{ + NSString *html; + UIFont *font; + UIWebView *webView; +} + +@property(nonatomic, retain) NSString *html; +@property(nonatomic, retain) UIWebView *webView; + +- (id) initWithHTML:(NSString *)h font:(UIFont *)f; +- (id) initWithText:(NSString *)t font:(UIFont *)f; +- (void) setHTML:(NSString *)h; +- (void) setText:(NSString *)t; +- (void) sizeToFit; + +@end + +@implementation HTMLLabel + +@synthesize html; +@synthesize webView; + +- (id) initWithHTML:(NSString *)h font:(UIFont *)f +{ + self = [super init]; + if (! self) return 0; + font = [f retain]; + webView = [[UIWebView alloc] init]; + webView.delegate = self; + webView.dataDetectorTypes = UIDataDetectorTypeNone; + self. autoresizingMask = (UIViewAutoresizingFlexibleWidth | + UIViewAutoresizingFlexibleHeight); + webView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | + UIViewAutoresizingFlexibleHeight); + [self addSubview: webView]; + [self setHTML: h]; + return self; +} + +- (id) initWithText:(NSString *)t font:(UIFont *)f +{ + self = [self initWithHTML:@"" font:f]; + if (! self) return 0; + [self setText: t]; + return self; +} + + +- (void) setHTML: (NSString *)h +{ + if (! h) return; + [h retain]; + if (html) [html release]; + html = h; + NSString *h2 = + [NSString stringWithFormat: + @"" + "" + "" +// "" + "" + "" + "" + "%@" + "" + "", + [font fontName], + [font pointSize], + [font lineHeight], + h]; + [webView loadHTMLString:h2 baseURL:[NSURL URLWithString:@""]]; +} + + +static char *anchorize (const char *url); + +- (void) setText: (NSString *)t +{ + t = [t stringByReplacingOccurrencesOfString:@"&" withString:@"&"]; + t = [t stringByReplacingOccurrencesOfString:@"<" withString:@"<"]; + t = [t stringByReplacingOccurrencesOfString:@">" withString:@">"]; + t = [t stringByReplacingOccurrencesOfString:@"\n\n" withString:@"

"]; + t = [t stringByReplacingOccurrencesOfString:@"

" + withString:@"

        "]; + t = [t stringByReplacingOccurrencesOfString:@"\n " + withString:@"
        "]; + + NSString *h = @""; + for (NSString *s in + [t componentsSeparatedByCharactersInSet: + [NSCharacterSet whitespaceAndNewlineCharacterSet]]) { + if ([s hasPrefix:@"http://"] || + [s hasPrefix:@"https://"]) { + char *anchor = anchorize ([s cStringUsingEncoding:NSUTF8StringEncoding]); + NSString *a2 = [NSString stringWithCString: anchor + encoding: NSUTF8StringEncoding]; + s = [NSString stringWithFormat: @"%@
", s, a2]; + free (anchor); + } + h = [NSString stringWithFormat: @"%@ %@", h, s]; + } + [self setHTML: h]; +} + + +-(BOOL) webView:(UIWebView *)wv + shouldStartLoadWithRequest:(NSURLRequest *)req + navigationType:(UIWebViewNavigationType)type +{ + // Force clicked links to open in Safari, not in this window. + if (type == UIWebViewNavigationTypeLinkClicked) { + [[UIApplication sharedApplication] openURL:[req URL]]; + return NO; + } + return YES; +} + + +- (void) setFrame: (CGRect)r +{ + [super setFrame: r]; + r.origin.x = 0; + r.origin.y = 0; + [webView setFrame: r]; + [self setHTML: html]; + [webView reload]; +} + + +- (NSString *) stripTags:(NSString *)str +{ + NSString *result = @""; + + str = [str stringByReplacingOccurrencesOfString:@"

" + withString:@"

" + options:NSCaseInsensitiveSearch + range:NSMakeRange(0, [str length])]; + str = [str stringByReplacingOccurrencesOfString:@"
" + withString:@"\n" + options:NSCaseInsensitiveSearch + range:NSMakeRange(0, [str length])]; + + for (NSString *s in [str componentsSeparatedByString: @"<"]) { + NSRange r = [s rangeOfString:@">"]; + if (r.length > 0) + s = [s substringFromIndex: r.location + r.length]; + result = [result stringByAppendingString: s]; + } + return result; +} + + +- (void) sizeToFit +{ + CGRect r = [self frame]; + + /* It would be sensible to just ask the UIWebView how tall the page is, + instead of hoping that NSString and UIWebView measure fonts and do + wrapping in exactly the same way, but I can't make that work. + Maybe because it loads async? + */ +# if 0 + r.size.height = [[webView + stringByEvaluatingJavaScriptFromString: + @"document.body.offsetHeight"] + doubleValue]; +# else + NSString *text = [self stripTags: html]; + CGSize s = r.size; + s.height = 999999; + s = [text sizeWithFont: font + constrainedToSize: s + lineBreakMode:NSLineBreakByWordWrapping]; + + // GAAAH. Add one more line, or the UIWebView is still scrollable! + // The text is sized right, but it lets you scroll it up anyway. + s.height += [font pointSize]; + + r.size.height = s.height; +# endif + + [self setFrame: r]; +} + + +- (void) dealloc +{ + [html release]; + [font release]; + [webView release]; + [super dealloc]; +} + +@end + +#endif // USE_IPHONE && USE_HTML_LABELS + @interface XScreenSaverConfigSheet (Private) @@ -230,7 +448,7 @@ static void layout_group (NSView *group, BOOL horiz_p); instead, so transform keys to "SAVERNAME.KEY". NOTE: This is duplicated in PrefsReader.m, cause I suck. -*/ + */ - (NSString *) makeKey:(NSString *)key { # ifdef USE_IPHONE @@ -307,6 +525,22 @@ static void layout_group (NSView *group, BOOL horiz_p); } +- (NSUserDefaultsController *)controllerForKey:(NSString *)key +{ + static NSDictionary *a = 0; + if (! a) { + a = UPDATER_DEFAULTS; + [a retain]; + } + if ([a objectForKey:key]) + // These preferences are global to all xscreensavers. + return globalDefaultsController; + else + // All other preferences are per-saver. + return userDefaultsController; +} + + #ifdef USE_IPHONE // Called when a slider is bonked. @@ -316,11 +550,17 @@ static void layout_group (NSView *group, BOOL horiz_p); if ([active_text_field canResignFirstResponder]) [active_text_field resignFirstResponder]; NSString *pref_key = [pref_keys objectAtIndex: [sender tag]]; - double v = [sender value]; - if (v == (int) v) - [userDefaultsController setInteger:v forKey:pref_key]; - else - [userDefaultsController setDouble:v forKey:pref_key]; + + // Hacky API. See comment in InvertedSlider.m. + double v = ([sender isKindOfClass: [InvertedSlider class]] + ? [(InvertedSlider *) sender transformedValue] + : [sender value]); + + [[self controllerForKey:pref_key] + setObject:((v == (int) v) + ? [NSNumber numberWithInt:(int) v] + : [NSNumber numberWithDouble: v]) + forKey:pref_key]; } // Called when a checkbox/switch is bonked. @@ -331,7 +571,7 @@ static void layout_group (NSView *group, BOOL horiz_p); [active_text_field resignFirstResponder]; NSString *pref_key = [pref_keys objectAtIndex: [sender tag]]; NSString *v = ([sender isOn] ? @"true" : @"false"); - [userDefaultsController setObject:v forKey:pref_key]; + [[self controllerForKey:pref_key] setObject:v forKey:pref_key]; } # ifdef USE_PICKER_VIEW @@ -353,7 +593,7 @@ static void layout_group (NSView *group, BOOL horiz_p); //NSString *label = [a objectAtIndex:0]; NSString *pref_key = [a objectAtIndex:1]; NSObject *pref_val = [a objectAtIndex:2]; - [userDefaultsController setObject:pref_val forKey:pref_key]; + [[self controllerForKey:pref_key] setObject:pref_val forKey:pref_key]; } # else // !USE_PICKER_VIEW @@ -367,7 +607,7 @@ static void layout_group (NSView *group, BOOL horiz_p); NSArray *item = [[sender items] objectAtIndex: [sender index]]; NSString *pref_key = [item objectAtIndex:1]; NSObject *pref_val = [item objectAtIndex:2]; - [userDefaultsController setObject:pref_val forKey:pref_key]; + [[self controllerForKey:pref_key] setObject:pref_val forKey:pref_key]; } - (BOOL)textFieldShouldBeginEditing:(UITextField *)tf @@ -380,7 +620,7 @@ static void layout_group (NSView *group, BOOL horiz_p); { NSString *pref_key = [pref_keys objectAtIndex: [tf tag]]; NSString *txt = [tf text]; - [userDefaultsController setObject:txt forKey:pref_key]; + [[self controllerForKey:pref_key] setObject:txt forKey:pref_key]; } - (BOOL)textFieldShouldReturn:(UITextField *)tf @@ -399,15 +639,18 @@ static void layout_group (NSView *group, BOOL horiz_p); - (void) okAction:(NSObject *)arg { - [userDefaultsController commitEditing]; - [userDefaultsController save:self]; + [userDefaultsController commitEditing]; + [globalDefaultsController commitEditing]; + [userDefaultsController save:self]; + [globalDefaultsController save:self]; [NSApp endSheet:self returnCode:NSOKButton]; [self close]; } - (void) cancelAction:(NSObject *)arg { - [userDefaultsController revert:self]; + [userDefaultsController revert:self]; + [globalDefaultsController revert:self]; [NSApp endSheet:self returnCode:NSCancelButton]; [self close]; } @@ -417,12 +660,13 @@ static void layout_group (NSView *group, BOOL horiz_p); - (void) resetAction:(NSObject *)arg { # ifndef USE_IPHONE - [userDefaultsController revertToInitialValues:self]; + [userDefaultsController revertToInitialValues:self]; + [globalDefaultsController revertToInitialValues:self]; # else // USE_IPHONE for (NSString *key in defaultOptions) { NSObject *val = [defaultOptions objectForKey:key]; - [userDefaultsController setObject:val forKey:key]; + [[self controllerForKey:key] setObject:val forKey:key]; } for (UIControl *ctl in pref_ctls) { @@ -440,6 +684,7 @@ static void layout_group (NSView *group, BOOL horiz_p); - (void) bindResource:(NSObject *)control key:(NSString *)pref_key reload:(BOOL)reload_p { + NSUserDefaultsController *prefs = [self controllerForKey:pref_key]; # ifndef USE_IPHONE NSString *bindto = ([control isKindOfClass:[NSPopUpButton class]] ? @"selectedObject" @@ -447,12 +692,12 @@ static void layout_group (NSView *group, BOOL horiz_p); ? @"selectedIndex" : @"value")); [control bind:bindto - toObject:userDefaultsController + toObject:prefs withKeyPath:[@"values." stringByAppendingString: pref_key] options:nil]; # else // USE_IPHONE SEL sel; - NSObject *val = [userDefaultsController objectForKey:pref_key]; + NSObject *val = [prefs objectForKey:pref_key]; NSString *sval = 0; double dval = 0; @@ -472,7 +717,11 @@ static void layout_group (NSView *group, BOOL horiz_p); if ([control isKindOfClass:[UISlider class]]) { sel = @selector(sliderAction:); - [(UISlider *) control setValue: dval]; + // Hacky API. See comment in InvertedSlider.m. + if ([control isKindOfClass:[InvertedSlider class]]) + [(InvertedSlider *) control setTransformedValue: dval]; + else + [(UISlider *) control setValue: dval]; } else if ([control isKindOfClass:[UISwitch class]]) { sel = @selector(switchAction:); [(UISwitch *) control setOn: ((int) dval != 0)]; @@ -513,7 +762,7 @@ static void layout_group (NSView *group, BOOL horiz_p); # endif // USE_IPHONE # if 0 - NSObject *def = [[userDefaultsController defaults] objectForKey:pref_key]; + NSObject *def = [[prefs defaults] objectForKey:pref_key]; NSString *s = [NSString stringWithFormat:@"bind: \"%@\"", pref_key]; s = [s stringByPaddingToLength:18 withString:@" " startingAtIndex:0]; s = [NSString stringWithFormat:@"%@ = \"%@\"", s, def]; @@ -682,6 +931,8 @@ anchorize (const char *url) } +#if !defined(USE_IPHONE) || !defined(USE_HTML_LABELS) + /* Converts any http: URLs in the given text field to clickable links. */ static void @@ -766,6 +1017,9 @@ hreffify (NSText *nstext) # endif } +#endif /* !USE_IPHONE || !USE_HTML_LABELS */ + + #pragma mark Creating controls from XML @@ -813,6 +1067,26 @@ hreffify (NSText *nstext) if ([val length] == 0) [dict removeObjectForKey:key]; } + +# ifdef USE_IPHONE + // Kludge for starwars.xml: + // If there is a "_low-label" and no "_label", but "_low-label" contains + // spaces, divide them. + NSString *lab = [dict objectForKey:@"_label"]; + NSString *low = [dict objectForKey:@"_low-label"]; + if (low && !lab) { + NSArray *split = + [[[low stringByTrimmingCharactersInSet: + [NSCharacterSet whitespaceAndNewlineCharacterSet]] + componentsSeparatedByString: @" "] + filteredArrayUsingPredicate: + [NSPredicate predicateWithFormat:@"length > 0"]]; + if (split && [split count] == 2) { + [dict setValue:[split objectAtIndex:0] forKey:@"_label"]; + [dict setValue:[split objectAtIndex:1] forKey:@"_low-label"]; + } + } +# endif // USE_IPHONE } @@ -820,12 +1094,10 @@ hreffify (NSText *nstext) */ - (NSString *) parseXScreenSaverTag:(NSXMLNode *)node { - NSMutableDictionary *dict = - [NSMutableDictionary dictionaryWithObjectsAndKeys: - @"", @"name", - @"", @"_label", - @"", @"gl", - nil]; + NSMutableDictionary *dict = [@{ @"name": @"", + @"_label": @"", + @"gl": @"" } + mutableCopy]; [self parseAttrs:dict node:node]; NSString *name = [dict objectForKey:@"name"]; NSString *label = [dict objectForKey:@"_label"]; @@ -858,7 +1130,7 @@ hreffify (NSText *nstext) [lab setBackgroundColor:[UIColor clearColor]]; [lab setNumberOfLines:0]; // unlimited // [lab setLineBreakMode:UILineBreakModeWordWrap]; - [lab setLineBreakMode:UILineBreakModeHeadTruncation]; + [lab setLineBreakMode:NSLineBreakByTruncatingHead]; [lab setAutoresizingMask: (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)]; # endif // USE_IPHONE @@ -870,13 +1142,11 @@ hreffify (NSText *nstext) */ - (void) makeCheckbox:(NSXMLNode *)node on:(NSView *)parent { - NSMutableDictionary *dict = - [NSMutableDictionary dictionaryWithObjectsAndKeys: - @"", @"id", - @"", @"_label", - @"", @"arg-set", - @"", @"arg-unset", - nil]; + NSMutableDictionary *dict = [@{ @"id": @"", + @"_label": @"", + @"arg-set": @"", + @"arg-unset": @"" } + mutableCopy]; [self parseAttrs:dict node:node]; NSString *label = [dict objectForKey:@"_label"]; NSString *arg_set = [dict objectForKey:@"arg-set"]; @@ -936,22 +1206,20 @@ hreffify (NSText *nstext) /* Creates the number selection control described by the given XML node. If "type=slider", it's an NSSlider. If "type=spinbutton", it's a text field with up/down arrows next to it. -*/ + */ - (void) makeNumberSelector:(NSXMLNode *)node on:(NSView *)parent { - NSMutableDictionary *dict = - [NSMutableDictionary dictionaryWithObjectsAndKeys: - @"", @"id", - @"", @"_label", - @"", @"_low-label", - @"", @"_high-label", - @"", @"type", - @"", @"arg", - @"", @"low", - @"", @"high", - @"", @"default", - @"", @"convert", - nil]; + NSMutableDictionary *dict = [@{ @"id": @"", + @"_label": @"", + @"_low-label": @"", + @"_high-label": @"", + @"type": @"", + @"arg": @"", + @"low": @"", + @"high": @"", + @"default": @"", + @"convert": @"" } + mutableCopy]; [self parseAttrs:dict node:node]; NSString *label = [dict objectForKey:@"_label"]; NSString *low_label = [dict objectForKey:@"_low-label"]; @@ -1061,7 +1329,7 @@ hreffify (NSText *nstext) [lab setFrame:rect]; [self placeChild:lab on:parent]; # else // USE_IPHONE - [lab setTextAlignment: UITextAlignmentRight]; + [lab setTextAlignment: NSTextAlignmentRight]; [self placeChild:lab on:parent right:(label ? YES : NO)]; # endif // USE_IPHONE @@ -1223,7 +1491,7 @@ set_menu_item_object (NSMenuItem *item, NSObject *obj) /* Creates the popup menu described by the given XML node (and its children). -*/ + */ - (void) makeOptionMenu:(NSXMLNode *)node on:(NSView *)parent { NSArray *children = [node children]; @@ -1236,10 +1504,7 @@ set_menu_item_object (NSMenuItem *item, NSObject *obj) // get the "id" attribute off the node2 = [[NSXMLElement alloc] initWithName:@"select"]; - [node2 setAttributesAsDictionary: - [NSDictionary dictionaryWithObjectsAndKeys: - @"textMode", @"id", - nil]]; + [node2 setAttributesAsDictionary:@{ @"id": @"textMode" }]; NSXMLNode *node3 = [[NSXMLElement alloc] initWithName:@"option"]; [node3 setAttributesAsDictionary: - [NSDictionary dictionaryWithObjectsAndKeys: - @"date", @"id", - @"-text-mode date", @"arg-set", - @"Display the date and time", @"_label", - nil]]; + @{ @"id": @"date", + @"arg-set": @"-text-mode date", + @"_label": @"Display the date and time" }]; [node3 setParent: node2]; //[node3 release]; node3 = [[NSXMLElement alloc] initWithName:@"option"]; [node3 setAttributesAsDictionary: - [NSDictionary dictionaryWithObjectsAndKeys: - @"text", @"id", - @"-text-mode literal", @"arg-set", - @"Display static text", @"_label", - nil]]; + @{ @"id": @"text", + @"arg-set": @"-text-mode literal", + @"_label": @"Display static text" }]; [node3 setParent: node2]; //[node3 release]; node3 = [[NSXMLElement alloc] initWithName:@"option"]; [node3 setAttributesAsDictionary: - [NSDictionary dictionaryWithObjectsAndKeys: - @"url", @"id", - @"Display the contents of a URL", @"_label", - nil]]; + @{ @"id": @"url", + @"_label": @"Display the contents of a URL" }]; [node3 setParent: node2]; //[node3 release]; @@ -1892,13 +2142,12 @@ find_text_field_of_button (NSButton *button) // node2 = [[NSXMLElement alloc] initWithName:@"string"]; [node2 setAttributesAsDictionary: - [NSDictionary dictionaryWithObjectsAndKeys: - @"textLiteral", @"id", - @"-text-literal %", @"arg", + @{ @"id": @"textLiteral", + @"arg": @"-text-literal %", # ifdef USE_IPHONE - @"Text to display", @"_label", + @"_label": @"Text to display" # endif - nil]]; + }]; [self makeTextField:node2 on:rgroup # ifndef USE_IPHONE withLabel:NO @@ -1915,17 +2164,15 @@ find_text_field_of_button (NSButton *button) toObject:[matrix cellAtRow:1 column:0] withKeyPath:@"value" options:nil]; -*/ + */ # ifndef USE_IPHONE // node2 = [[NSXMLElement alloc] initWithName:@"string"]; [node2 setAttributesAsDictionary: - [NSDictionary dictionaryWithObjectsAndKeys: - @"textFile", @"id", - @"-text-file %", @"arg", - nil]]; + @{ @"id": @"textFile", + @"arg": @"-text-file %" }]; [self makeFileSelector:node2 on:rgroup dirsOnly:NO withLabel:NO editable:NO]; # endif // !USE_IPHONE @@ -1935,13 +2182,12 @@ find_text_field_of_button (NSButton *button) // node2 = [[NSXMLElement alloc] initWithName:@"string"]; [node2 setAttributesAsDictionary: - [NSDictionary dictionaryWithObjectsAndKeys: - @"textURL", @"id", - @"-text-url %", @"arg", + @{ @"id": @"textURL", + @"arg": @"-text-url %", # ifdef USE_IPHONE - @"URL to display", @"_label", + @"_label": @"URL to display", # endif - nil]]; + }]; [self makeTextField:node2 on:rgroup # ifndef USE_IPHONE withLabel:NO @@ -1957,10 +2203,9 @@ find_text_field_of_button (NSButton *button) // node2 = [[NSXMLElement alloc] initWithName:@"string"]; [node2 setAttributesAsDictionary: - [NSDictionary dictionaryWithObjectsAndKeys: - @"textProgram", @"id", - @"-text-program %", @"arg", - nil]]; + @{ @"id": @"textProgram", + @"arg": @"-text-program %", + }]; [self makeTextField:node2 on:rgroup withLabel:NO horizontal:NO]; } @@ -2024,7 +2269,6 @@ find_text_field_of_button (NSButton *button) - (void) makeImageLoaderControlBox:(NSXMLNode *)node on:(NSView *)parent { -# ifndef USE_IPHONE /* [x] Grab desktop images [ ] Choose random image: @@ -2039,34 +2283,43 @@ find_text_field_of_button (NSButton *button) NSXMLElement *node2; +# ifndef USE_IPHONE +# define SCREENS "Grab desktop images" +# define PHOTOS "Choose random images" +# else +# define SCREENS "Grab screenshots" +# define PHOTOS "Use photo library" +# endif + node2 = [[NSXMLElement alloc] initWithName:@"boolean"]; [node2 setAttributesAsDictionary: - [NSDictionary dictionaryWithObjectsAndKeys: - @"grabDesktopImages", @"id", - @"Grab desktop images", @"_label", - @"-no-grab-desktop", @"arg-unset", - nil]]; + @{ @"id": @"grabDesktopImages", + @"_label": @ SCREENS, + @"arg-unset": @"-no-grab-desktop", + }]; [self makeCheckbox:node2 on:parent]; node2 = [[NSXMLElement alloc] initWithName:@"boolean"]; [node2 setAttributesAsDictionary: - [NSDictionary dictionaryWithObjectsAndKeys: - @"chooseRandomImages", @"id", - @"Choose random images", @"_label", - @"-choose-random-images", @"arg-set", - nil]]; + @{ @"id": @"chooseRandomImages", + @"_label": @ PHOTOS, + @"arg-set": @"-choose-random-images", + }]; [self makeCheckbox:node2 on:parent]; node2 = [[NSXMLElement alloc] initWithName:@"string"]; [node2 setAttributesAsDictionary: - [NSDictionary dictionaryWithObjectsAndKeys: - @"imageDirectory", @"id", - @"Images from:", @"_label", - @"-image-directory %", @"arg", - nil]]; + @{ @"id": @"imageDirectory", + @"_label": @"Images from:", + @"arg": @"-image-directory %", + }]; [self makeFileSelector:node2 on:parent dirsOnly:YES withLabel:YES editable:YES]; +# undef SCREENS +# undef PHOTOS + +# ifndef USE_IPHONE // Add a second, explanatory label below the file/URL selector. LABEL *lab2 = 0; @@ -2079,6 +2332,106 @@ find_text_field_of_button (NSButton *button) r2.origin.y += 14; [lab2 setFrameOrigin:r2.origin]; [lab2 release]; +# endif // USE_IPHONE +} + + +- (void) makeUpdaterControlBox:(NSXMLNode *)node on:(NSView *)parent +{ +# ifndef USE_IPHONE + /* + [x] Check for Updates [ Monthly ] + +

+ + +
+ */ + + //
+ + NSRect rect; + rect.size.width = rect.size.height = 1; + rect.origin.x = rect.origin.y = 0; + NSView *group = [[NSView alloc] initWithFrame:rect]; + + NSXMLElement *node2; + + // + + node2 = [[NSXMLElement alloc] initWithName:@"boolean"]; + [node2 setAttributesAsDictionary: + @{ @"id": @SUSUEnableAutomaticChecksKey, + @"_label": @"Automatically check for updates", + @"arg-unset": @"-no-" SUSUEnableAutomaticChecksKey, + }]; + [self makeCheckbox:node2 on:group]; + + //