-#if !AlwaysReload
-- (void) applyRightButton {
- if ([issues_ count] == 0 && ![self isLoading])
- [[self navigationItem] setRightBarButtonItem:[[[UIBarButtonItem alloc]
- initWithTitle:UCLocalize("CONFIRM")
- style:UIBarButtonItemStyleDone
- target:self
- action:@selector(confirmButtonClicked)
- ] autorelease]];
- else
- [[self navigationItem] setRightBarButtonItem:nil];
+#if !AlwaysReload
+- (void) applyRightButton {
+ if ([issues_ count] == 0 && ![self isLoading])
+ [[self navigationItem] setRightBarButtonItem:[[[UIBarButtonItem alloc]
+ initWithTitle:UCLocalize("CONFIRM")
+ style:UIBarButtonItemStyleDone
+ target:self
+ action:@selector(confirmButtonClicked)
+ ] autorelease]];
+ else
+ [[self navigationItem] setRightBarButtonItem:nil];
+}
+#endif
+
+- (void) cancelButtonClicked {
+ [self dismissModalViewControllerAnimated:YES];
+ [delegate_ cancelAndClear:YES];
+}
+
+#if !AlwaysReload
+- (void) confirmButtonClicked {
+ if (essential_ != nil)
+ [essential_ show];
+ else
+ [self complete];
+}
+#endif
+
+@end
+/* }}} */
+
+/* Progress Data {{{ */
+@interface CydiaProgressData : NSObject {
+ _transient id delegate_;
+
+ bool running_;
+ float percent_;
+
+ float current_;
+ float total_;
+ float speed_;
+
+ _H<NSMutableArray> events_;
+ _H<NSString> title_;
+
+ _H<NSString> status_;
+ _H<NSString> finish_;
+}
+
+@end
+
+@implementation CydiaProgressData
+
++ (NSArray *) _attributeKeys {
+ return [NSArray arrayWithObjects:
+ @"current",
+ @"events",
+ @"finish",
+ @"percent",
+ @"running",
+ @"speed",
+ @"title",
+ @"total",
+ nil];
+}
+
+- (NSArray *) attributeKeys {
+ return [[self class] _attributeKeys];
+}
+
++ (BOOL) isKeyExcludedFromWebScript:(const char *)name {
+ return ![[self _attributeKeys] containsObject:[NSString stringWithUTF8String:name]] && [super isKeyExcludedFromWebScript:name];
+}
+
+- (id) init {
+ if ((self = [super init]) != nil) {
+ events_ = [NSMutableArray arrayWithCapacity:32];
+ } return self;
+}
+
+- (void) setDelegate:(id)delegate {
+ delegate_ = delegate;
+}
+
+- (void) setPercent:(float)value {
+ percent_ = value;
+}
+
+- (NSNumber *) percent {
+ return [NSNumber numberWithFloat:percent_];
+}
+
+- (void) setCurrent:(float)value {
+ current_ = value;
+}
+
+- (NSNumber *) current {
+ return [NSNumber numberWithFloat:current_];
+}
+
+- (void) setTotal:(float)value {
+ total_ = value;
+}
+
+- (NSNumber *) total {
+ return [NSNumber numberWithFloat:total_];
+}
+
+- (void) setSpeed:(float)value {
+ speed_ = value;
+}
+
+- (NSNumber *) speed {
+ return [NSNumber numberWithFloat:speed_];
+}
+
+- (NSArray *) events {
+ return events_;
+}
+
+- (void) removeAllEvents {
+ [events_ removeAllObjects];
+}
+
+- (void) addEvent:(CydiaProgressEvent *)event {
+ [events_ addObject:event];
+}
+
+- (void) setTitle:(NSString *)text {
+ title_ = text;
+}
+
+- (NSString *) title {
+ return title_;