border-bottom: 1px solid #e0e0e0;
}
-fieldset > a,
+fieldset > a:not([type="ad"]),
fieldset > div,
fieldset > textarea {
- min-height: 42px;
/* XXX: small differences due to font bugs */
padding: 13px 14px 11px 14px;
}
-panel > fieldset > a.thumb:first-child > div:first-of-type {
+fieldset > a[type="ad"] {
+ /* XXX: small differences due to font bugs */
+ padding: 4px 4px 2px 5px;
+}
+
+panel > fieldset > a[type="ad"]:first-child > div:first-of-type,
+panel > fieldset > a[type="thumb"]:first-child > div:first-of-type {
-webkit-border-top-left-radius: 9px;
}
-panel > fieldset > a.thumb:last-child > div:first-of-type {
+panel > fieldset > a[type="ad"]:last-child > div:first-of-type,
+panel > fieldset > a[type="thumb"]:last-child > div:first-of-type {
-webkit-border-bottom-left-radius: 9px;
}
-list > fieldset > a.thumb > div:first-of-type {
+fieldset > a[type="ad"] > div:first-of-type {
+ border: 1px solid #999999;
+}
+
+list > fieldset > a[type="thumb"] > div:first-of-type {
border: 1px solid #e0e0e0;
}
-panel > fieldset > a.thumb > div:first-of-type {
+panel > fieldset > a[type="thumb"] > div:first-of-type {
border: 1px solid #999999;
}
-fieldset > a.thumb > div:first-of-type {
+div[tile] {
+ float: right;
+ height: 30px;
+ width: 30px;
+}
+
+div[tile="app"] { background-image: url(http://cache.saurik.com/cydia/tile/app.png); }
+div[tile="call"] { background-image: url(http://cache.saurik.com/cydia/tile/call.png); }
+div[tile="map"] { background-image: url(http://cache.saurik.com/cydia/tile/map.png); }
+div[tile="media"] { background-image: url(http://cache.saurik.com/cydia/tile/media.png); }
+div[tile="music"] { background-image: url(http://cache.saurik.com/cydia/tile/video.png); }
+div[tile="site"] { background-image: url(http://cache.saurik.com/cydia/tile/site.png); }
+
+fieldset > a[type="ad"] > div:first-of-type {
+ background-repeat: no-repeat;
+ background-position: center center;
+ border-right: none;
+ display: inline-block;
+ height: 40px;
+ line-height: 38px;
+ /* XXX: small differences due to font bugs */
+ /* XXX: 1px difference due to border stupidity */
+ margin: -5px 5px -3px -6px;
+ width: 40px;
+}
+
+fieldset > a[type="thumb"] > div:first-of-type {
background-repeat: no-repeat;
background-position: center center;
display: inline-block;
/* Chevrons {{{ */
-fieldset > a[href],
+fieldset > a[href]:not([type="ad"]),
fieldset > div > select {
background-repeat: no-repeat;
background-image: url(chevron.png);
width: 273px;
}
-fieldset > a:not(.thumb) > div {
+fieldset > a[type="ad"] > div:nth-of-type(2) {
+ width: 218px;
+}
+
+fieldset > a:not([type]) > div {
width: 250px;
}
width: 221px;
}
-fieldset > a.thumb > div:nth-of-type(2) > label:only-of-type {
+fieldset > a[type="thumb"] > div:nth-of-type(2) > label:only-of-type {
position: relative;
top: 10px;
}
-fieldset > a.thumb > div:nth-of-type(2) > label:nth-of-type(2) {
+fieldset > a[type="thumb"] > div:nth-of-type(2) > label:nth-of-type(2) {
display: block;
margin-top: 2px;
}
-fieldset > a.thumb > div:nth-of-type(2) {
+fieldset > a[type="thumb"] > div:nth-of-type(2) {
vertical-align: top;
width: 193px;
}
font-weight: bold;
}
-list > fieldset > a:not(.thumb) > div > label:nth-of-type(2),
+list > fieldset > a:not([type]) > div > label:nth-of-type(2),
list > fieldset > div > div > label:nth-of-type(2) {
margin-left: 94px;
}
-panel > fieldset > a:not(.thumb) > div > label:nth-of-type(2),
+panel > fieldset > a:not([type]) > div > label:nth-of-type(2),
panel > fieldset > div > div > label:nth-of-type(2) {
float: right;
text-align: right;
width: 300px;
}
-fieldset > a.thumb:first-child > back {
+fieldset > a[type="ad"] {
+}
+
+fieldset > a[type="ad"] > div:nth-of-type(2) {
+ position: relative;
+ vertical-align: top;
+}
+
+fieldset > a[type="ad"] > div > label:nth-of-type(1) {
+ color: #2d2d50;
+ font-size: 13px;
+ font-weight: bold;
+ line-height: 15px;
+}
+
+fieldset > a[type="ad"] > div > label:nth-of-type(2) {
+ position: absolute;
+ top: 17px;
+ left: 156px;
+ font-size: 9.5px;
+ font-weight: normal;
+}
+
+fieldset.half > a {
+ background: none;
+ background-position-x: 120px;
+}
+
+fieldset.half > a > img.icon + div {
+ width: 65px;
+}
+
+fieldset.right {
+ float: right;
+ margin-left: 10px;
+}
+
+block + fieldset.right,
+fieldset + fieldset.right {
+ margin-top: 0;
+}
+
+fieldset.half {
+ width: 146px;
+}
+
+fieldset > a[type="thumb"]:first-child > back {
-webkit-border-top-right-radius: 9px;
}
-fieldset > a.thumb:last-child > back {
+fieldset > a[type="thumb"]:last-child > back {
-webkit-border-bottom-right-radius: 9px;
}
-fieldset > a.thumb > back {
+fieldset > a[type="thumb"] > back {
background-repeat: no-repeat;
border: 1px solid #999999;
display: block;
NSLog(@"%s(%g,%g)+(%g,%g)", fix, rect.origin.x, rect.origin.y, rect.size.width, rect.size.height);
}
+@interface NSObject (Cydia)
+- (void) yieldToSelector:(SEL)selector withObject:(id)object;
+@end
+
+@implementation NSObject (Cydia)
+
+- (void) doNothing {
+}
+
+- (void) _yieldToContext:(NSArray *)context { _pooled
+ SEL selector(reinterpret_cast<SEL>([[context objectAtIndex:0] pointerValue]));
+ id object([[context objectAtIndex:1] nonretainedObjectValue]);
+ volatile bool &stopped(*reinterpret_cast<bool *>([[context objectAtIndex:2] pointerValue]));
+
+ [self performSelector:selector withObject:object];
+
+ stopped = true;
+
+ [self
+ performSelectorOnMainThread:@selector(doNothing)
+ withObject:nil
+ waitUntilDone:NO
+ ];
+}
+
+- (void) yieldToSelector:(SEL)selector withObject:(id)object {
+ volatile bool stopped(false);
+
+ NSArray *context([NSArray arrayWithObjects:
+ [NSValue valueWithPointer:selector],
+ [NSValue valueWithNonretainedObject:object],
+ [NSValue valueWithPointer:const_cast<bool *>(&stopped)],
+ nil]);
+
+ NSThread *thread([[[NSThread alloc]
+ initWithTarget:self
+ selector:@selector(_yieldToContext:)
+ object:context
+ ] autorelease]);
+
+ [thread start];
+
+ NSRunLoop *loop([NSRunLoop currentRunLoop]);
+ NSDate *future([NSDate distantFuture]);
+
+ while (!stopped && [loop runMode:NSDefaultRunLoopMode beforeDate:future]);
+}
+
+@end
+
/* NSForcedOrderingSearch doesn't work on the iPhone */
static const NSStringCompareOptions BaseCompareOptions_ = NSNumericSearch | NSDiacriticInsensitiveSearch | NSWidthInsensitiveSearch;
static const NSStringCompareOptions ForcedCompareOptions_ = BaseCompareOptions_;
- (void) syncData;
- (void) askForSettings;
- (UIProgressHUD *) addProgressHUD;
+- (void) removeProgressHUD:(UIProgressHUD *)hud;
- (RVPage *) pageForURL:(NSURL *)url hasTag:(int *)tag;
- (RVPage *) pageForPackage:(NSString *)name;
- (void) openMailToURL:(NSURL *)url;
bool value;
if (current.end())
- value = essential && [self essential];
+ value = essential && [self essential] && [self visible];
else
value = !version_.end() && version_ != current;// && (!essential || ![database_ cache][iterator_].Keep());
return value;
return issues;
}
-- (void) reloadData {
+- (void) reloadData { _pooled
_error->Discard();
delete list_;
_trace();
[packages_ sortUsingSelector:@selector(compareByName:)];
_trace();
+
+ _config->Set("Acquire::http::Timeout", 15);
+ _config->Set("Acquire::http::MaxParallel", 4);
}
- (void) configure {
SHA1SumValue springlist_;
SHA1SumValue notifyconf_;
SHA1SumValue sandplate_;
- size_t received_;
- NSTimeInterval last_;
}
- (void) transitionViewDidComplete:(UITransitionView*)view fromView:(UIView*)from toView:(UIView*)to;
[output_ setText:@""];
[progress_ setProgress:0];
- received_ = 0;
- last_ = 0;//[NSDate timeIntervalSinceReferenceDate];
-
[close_ removeFromSuperview];
[overlay_ addSubview:progress_];
[overlay_ addSubview:status_];
}
- (void) startProgress {
- last_ = [NSDate timeIntervalSinceReferenceDate];
}
- (void) addProgressOutput:(NSString *)output {
}
- (bool) isCancelling:(size_t)received {
- if (last_ != 0) {
- NSTimeInterval now = [NSDate timeIntervalSinceReferenceDate];
- if (received_ != received) {
- received_ = received;
- last_ = now;
- } else if (now - last_ > 30)
- return true;
- }
-
return false;
}
trivial_gz_ == nil
) {
[delegate_ setStatusBarShowsProgress:NO];
+ [delegate_ removeProgressHUD:hud_];
- [hud_ show:NO];
- [hud_ removeFromSuperview];
[hud_ autorelease];
hud_ = nil;
trivial_ = false;
- hud_ = [delegate_ addProgressHUD];
+ hud_ = [[delegate_ addProgressHUD] retain];
[hud_ setText:@"Verifying URL"];
} break;
UIProgressBar *progress_;
UINavigationButton *cancel_;
bool updating_;
- size_t received_;
- NSTimeInterval last_;
}
- (id) initWithFrame:(CGRect)frame database:(Database *)database;
[prompt_ setText:@"Updating Database"];
[progress_ setProgress:0];
- received_ = 0;
- last_ = [NSDate timeIntervalSinceReferenceDate];
updating_ = true;
[overlay_ addSubview:cancel_];
}
- (bool) isCancelling:(size_t)received {
- NSTimeInterval now = [NSDate timeIntervalSinceReferenceDate];
- if (received_ != received) {
- received_ = received;
- last_ = now;
- } else if (now - last_ > 15)
- return true;
return !updating_;
}
}
- (void) _reloadData {
- /*UIProgressHUD *hud = [[UIProgressHUD alloc] initWithWindow:window_];
+ UIView *block();
+
+ UIProgressHUD *hud([self addProgressHUD]);
[hud setText:@"Reloading Data"];
- [overlay_ addSubview:hud];
- [hud show:YES];*/
- [database_ reloadData];
+ [database_ yieldToSelector:@selector(reloadData) withObject:nil];
+ _trace();
+
+ [self removeProgressHUD:hud];
size_t changes(0);
[book_ update];
}
-
- /*[hud show:NO];
- [hud removeFromSuperview];*/
}
- (void) _saveConfig {
- (void) finish {
if (hud_ != nil) {
[self setStatusBarShowsProgress:NO];
+ [self removeProgressHUD:hud_];
- [hud_ show:NO];
- [hud_ removeFromSuperview];
[hud_ autorelease];
hud_ = nil;
}
- (UIProgressHUD *) addProgressHUD {
- UIProgressHUD *hud = [[UIProgressHUD alloc] initWithWindow:window_];
+ UIProgressHUD *hud([[[UIProgressHUD alloc] initWithWindow:window_] autorelease]);
+ [window_ setUserInteractionEnabled:NO];
[hud show:YES];
- [underlay_ addSubview:hud];
+ [progress_ addSubview:hud];
return hud;
}
+- (void) removeProgressHUD:(UIProgressHUD *)hud {
+ [hud show:NO];
+ [hud removeFromSuperview];
+ [window_ setUserInteractionEnabled:YES];
+}
+
- (void) openMailToURL:(NSURL *)url {
// XXX: this makes me sad
#if 0
) {
[self setIdleTimerDisabled:YES];
- hud_ = [self addProgressHUD];
+ hud_ = [[self addProgressHUD] retain];
[hud_ setText:@"Reorganizing\n\nWill Automatically\nClose When Done"];
[self setStatusBarShowsProgress:YES];