+/* Filtered Package Controller {{{ */
+@interface FilteredPackageController : CYViewController {
+ _transient Database *database_;
+ FilteredPackageTable *packages_;
+ NSString *title_;
+}
+
+- (id) initWithDatabase:(Database *)database title:(NSString *)title filter:(SEL)filter with:(id)object;
+
+@end
+
+@implementation FilteredPackageController
+
+- (void) dealloc {
+ [packages_ release];
+ [title_ release];
+
+ [super dealloc];
+}
+
+- (void) viewDidAppear:(BOOL)animated {
+ [super viewDidAppear:animated];
+ [packages_ deselectWithAnimation:animated];
+}
+
+- (void) didSelectPackage:(Package *)package {
+ PackageController *view([delegate_ packageController]);
+ [view setPackage:package];
+ [view setDelegate:delegate_];
+ [[self navigationController] pushViewController:view animated:YES];
+}
+
+- (NSString *) title { return title_; }
+
+- (id) initWithDatabase:(Database *)database title:(NSString *)title filter:(SEL)filter with:(id)object {
+ if ((self = [super init]) != nil) {
+ database_ = database;
+ title_ = [title copy];
+ [[self navigationItem] setTitle:title_];
+
+ packages_ = [[FilteredPackageTable alloc]
+ initWithFrame:[[self view] bounds]
+ database:database
+ target:self
+ action:@selector(didSelectPackage:)
+ filter:filter
+ with:object
+ ];
+
+ [packages_ setAutoresizingMask:UIViewAutoresizingFlexibleBoth];
+ [[self view] addSubview:packages_];
+ } return self;
+}
+
+- (void) reloadData {
+ [packages_ reloadData];
+}
+
+- (void) setDelegate:(id)delegate {
+ [super setDelegate:delegate];
+ [packages_ setDelegate:delegate];
+}
+
+@end
+
+/* }}} */
+
+/* Add Source Controller {{{ */
+@interface AddSourceController : CYViewController {