- int barstyle([overlay_ _barStyle:NO]);
- bool ugly(barstyle == 0);
-
- UIProgressIndicatorStyle style = ugly ?
- UIProgressIndicatorStyleMediumBrown :
- UIProgressIndicatorStyleMediumWhite;
-
- CGSize indsize([UIProgressIndicator defaultSizeForStyle:style]);
- unsigned indoffset = (ovrrect.size.height - indsize.height) / 2;
- CGRect indrect = {{indoffset, indoffset}, indsize};
-
- indicator_ = [[UIProgressIndicator alloc] initWithFrame:indrect];
- [indicator_ setStyle:style];
- [overlay_ addSubview:indicator_];
-
- CGSize prmsize = {215, indsize.height + 4};
-
- CGRect prmrect = {{
- indoffset * 2 + indsize.width,
- unsigned(ovrrect.size.height - prmsize.height) / 2 - 1
- }, prmsize};
-
- UIFont *font([UIFont systemFontOfSize:15]);
-
- prompt_ = [[UITextLabel alloc] initWithFrame:prmrect];
-
- [prompt_ setColor:[UIColor colorWithCGColor:(ugly ? Blueish_ : Off_)]];
- [prompt_ setBackgroundColor:[UIColor clearColor]];
- [prompt_ setFont:font];
-
- [overlay_ addSubview:prompt_];
-
- CGSize prgsize = {75, 100};
-
- CGRect prgrect = {{
- ovrrect.size.width - prgsize.width - 10,
- (ovrrect.size.height - prgsize.height) / 2
- } , prgsize};
-
- progress_ = [[UIProgressBar alloc] initWithFrame:prgrect];
- [progress_ setAutoresizingMask:UIViewAutoresizingFlexibleWidth];
- [overlay_ addSubview:progress_];
-
- [progress_ setStyle:0];
-
- cancel_ = [[UINavigationButton alloc] initWithTitle:UCLocalize("CANCEL") style:UINavigationButtonStyleHighlighted];
- [progress_ setAutoresizingMask:UIViewAutoresizingFlexibleLeftMargin];
- [cancel_ addTarget:self action:@selector(_onCancel) forControlEvents:UIControlEventTouchUpInside];
-
- CGRect frame = [cancel_ frame];
- frame.origin.x = ovrrect.size.width - frame.size.width - 5;
- frame.origin.y = (ovrrect.size.height - frame.size.height) / 2;
- [cancel_ setFrame:frame];
-
- [cancel_ setBarStyle:barstyle];
- } return self;
-}
-
-- (void) _onCancel {
- updating_ = false;
- [cancel_ removeFromSuperview];
-}
-
-- (void) _update { _pooled
- Status status;
- status.setDelegate(self);
- [database_ updateWithStatus:status];
-
- [self
- performSelectorOnMainThread:@selector(_update_)
- withObject:nil
- waitUntilDone:NO
- ];
-}
-
-- (void) setProgressError:(NSString *)error withTitle:(NSString *)title {
- [prompt_ setText:[NSString stringWithFormat:UCLocalize("COLON_DELIMITED"), UCLocalize("ERROR"), error]];