14#define TIMER_INTERVAL 0.2
32 NSWindow *
w = [progressBar window];
34 [w setTitle:[NSString stringWithUTF8String:sLabels.title]];
35 [progressTextField setStringValue:[NSString stringWithUTF8String:sLabels.info]];
37 NSRect origTextFrame = [progressTextField frame];
38 [progressTextField sizeToFit];
42 if (widthAdjust > 0) {
44 f.size.width =
w.frame.size.width + widthAdjust;
45 f.size.height =
w.frame.size.height;
46 [w setFrame:f display:YES];
51 [progressBar setIndeterminate:NO];
52 [progressBar setDoubleValue:0.0];
54 [[NSTimer scheduledTimerWithTimeInterval:TIMER_INTERVAL target:self
55 selector:@selector(updateProgressUI:)
56 userInfo:nil repeats:YES] retain];
59 [NSApp activateIgnoringOtherApps:YES];
63-(void)updateProgressUI:(NSTimer *)aTimer
73 [NSApp activateIgnoringOtherApps:YES];
80 [progressBar setDoubleValue:(double)progress];
85- (
BOOL)applicationShouldTerminate:(NSApplication *)sender
112 snprintf(path,
sizeof(path),
"%s/updater.ini",
sUpdatePath);
122 [NSApplication sharedApplication];
123 [NSBundle loadNibNamed:@"MainMenu" owner:NSApp];
IBOutlet NSProgressIndicator * progressBar
IBOutlet NSTextField * progressTextField
static const char * sUpdatePath
void UpdateProgressUI(float progress)
static StringTable sLabels
static float sProgressVal
int InitProgressUI(int *pargc, char ***pargv)
int ReadStrings(const NS_tchar *path, const char *keyList, unsigned int numStrings, char results[][MAX_TEXT_LEN], const char *section)
A very basic parser for updater.ini taken mostly from nsINIParser.cpp that can be used by standalone ...
const wchar_t *typedef BOOL