]> git.saurik.com Git - cydia.git/blobdiff - Cydia.mm
Added the section to the package table.
[cydia.git] / Cydia.mm
index e047b6f50f7b0e96659ff97f7f363da94eea0502..e5f198c4cf7e21880a888883e503efac26bd5a9e 100644 (file)
--- a/Cydia.mm
+++ b/Cydia.mm
@@ -507,6 +507,17 @@ UITextView *GetTextView(NSString *value, float left, bool html) {
 
     return text;
 }
+
+NSString *Simplify(NSString *title) {
+    const char *data = [title UTF8String];
+    size_t size = [title length];
+
+    Pcre title_r("^(.*?)( \\(.*\\))?$");
+    if (title_r(data, size))
+        return title_r[1];
+    else
+        return title;
+}
 /* }}} */
 
 @class Package;
@@ -1630,14 +1641,7 @@ NSString *Scour(const char *field, const char *begin, const char *end) {
     if ([pages_ count] != 0)
         [[pages_ lastObject] setPageActive:NO];
 
-    NSString *title = [page title]; {
-        const char *data = [title UTF8String];
-        size_t size = [title length];
-
-        Pcre title_r("^(.*?)( \\(.*\\))?$");
-        if (title_r(data, size))
-            title = title_r[1];
-    }
+    NSString *title = Simplify([page title]);
 
     NSString *backButtonTitle = [page backButtonTitle];
     if (backButtonTitle == nil)
@@ -2438,7 +2442,7 @@ void AddTextView(NSMutableDictionary *fields, NSMutableArray *packages, NSString
         trusted = false;
     }
 
-    [source_ setText:[NSString stringWithFormat:@"from %@", label]];
+    [source_ setText:[NSString stringWithFormat:@"from %@ (%@)", label, Simplify([package section])]];
 
     if (trusted)
         [self addSubview:trusted_];
@@ -3729,9 +3733,9 @@ void AddTextView(NSMutableDictionary *fields, NSMutableArray *packages, NSString
     if ((self = [super initWithBook:book]) != nil) {
         CGRect pageBounds = [book_ pageBounds];
 
-        UIImageView *pinstripe = [[[UIImageView alloc] initWithFrame:pageBounds] autorelease];
+        /*UIImageView *pinstripe = [[[UIImageView alloc] initWithFrame:pageBounds] autorelease];
         [pinstripe setImage:[UIImage applicationImageNamed:@"pinstripe.png"]];
-        [self addSubview:pinstripe];
+        [self addSubview:pinstripe];*/
 
         dimmed_ = [[UIView alloc] initWithFrame:pageBounds];
         CGColor dimmed(space_, 0, 0, 0, 0.5);
@@ -3797,8 +3801,8 @@ void AddTextView(NSMutableDictionary *fields, NSMutableArray *packages, NSString
     [animation setTransitionFlags:3];
     [animation setDuration:10];
     [animation setSpeed:0.35];
-    [animation setSubtype:@"fromLeft"];
-    [[self _layer] addAnimation:animation forKey:0];
+    [animation setSubtype:(flipped_ ? @"fromLeft" : @"fromRight")];
+    [[transition_ _layer] addAnimation:animation forKey:0];
     [transition_ transition:0 toView:(flipped_ ? (UIView *) table_ : (UIView *) advanced_)];
     flipped_ = !flipped_;
 }