mirror of
https://github.com/viq/NewsBlur.git
synced 2025-11-01 09:09:16 +00:00
Fixing issue in iphone app around tapping the All Sites button and then not being able to use the intelligence controls.
This commit is contained in:
parent
cf4b860c14
commit
30c04e8eee
3 changed files with 17 additions and 13 deletions
|
|
@ -43,6 +43,7 @@
|
|||
- (IBAction)selectIntelligence;
|
||||
- (void)updateFeedsWithIntelligence:(int)previousLevel newLevel:(int)newLevel;
|
||||
- (void)calculateFeedLocations:(BOOL)markVisible;
|
||||
- (void)redrawUnreadCounts;
|
||||
+ (int)computeMaxScoreForFeed:(NSDictionary *)feed;
|
||||
- (IBAction)doSwitchSitesUnread;
|
||||
- (void)loadFavicons;
|
||||
|
|
|
|||
|
|
@ -87,7 +87,9 @@ blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
|
|||
NSInteger previousLevel = [self.intelligenceControl selectedSegmentIndex] - 1;
|
||||
NSInteger newLevel = [appDelegate selectedIntelligence];
|
||||
if (newLevel != previousLevel) {
|
||||
[appDelegate setSelectedIntelligence:newLevel];
|
||||
[self updateFeedsWithIntelligence:previousLevel newLevel:newLevel];
|
||||
[self redrawUnreadCounts];
|
||||
}
|
||||
}
|
||||
[self.intelligenceControl setImage:[UIImage imageNamed:@"bullet_red.png"]
|
||||
|
|
@ -353,6 +355,7 @@ blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
|
|||
// all feeds are showing, and shouldn't be populated after this
|
||||
// hide/show runs.
|
||||
self.stillVisibleFeeds = [NSMutableDictionary dictionary];
|
||||
[self redrawUnreadCounts];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
|
@ -484,30 +487,26 @@ viewForHeaderInSection:(NSInteger)section {
|
|||
}
|
||||
|
||||
- (IBAction)selectIntelligence {
|
||||
NSInteger newLevel = [self.intelligenceControl selectedSegmentIndex] - 1;
|
||||
NSInteger previousLevel = [appDelegate selectedIntelligence];
|
||||
[appDelegate setSelectedIntelligence:newLevel];
|
||||
|
||||
if (!self.viewShowingAllFeeds) {
|
||||
NSInteger newLevel = [self.intelligenceControl selectedSegmentIndex] - 1;
|
||||
NSInteger previousLevel = [appDelegate selectedIntelligence];
|
||||
// NSLog(@"Select Intelligence from %d to %d.", previousLevel, newLevel);
|
||||
[self updateFeedsWithIntelligence:previousLevel newLevel:newLevel];
|
||||
}
|
||||
|
||||
for (UITableViewCell *cell in self.feedTitlesTable.visibleCells) {
|
||||
[cell setNeedsDisplay];
|
||||
}
|
||||
[self redrawUnreadCounts];
|
||||
}
|
||||
|
||||
- (void)updateFeedsWithIntelligence:(int)previousLevel newLevel:(int)newLevel {
|
||||
NSMutableArray *insertIndexPaths = [NSMutableArray array];
|
||||
NSMutableArray *deleteIndexPaths = [NSMutableArray array];
|
||||
|
||||
[appDelegate setSelectedIntelligence:newLevel];
|
||||
if (newLevel <= previousLevel) {
|
||||
[self calculateFeedLocations:NO];
|
||||
}
|
||||
|
||||
// BOOL deleted = NO;
|
||||
// BOOL inserted = NO;
|
||||
|
||||
for (int s=0; s < [self.dictFoldersArray count]; s++) {
|
||||
NSString *folderName = [self.dictFoldersArray objectAtIndex:s];
|
||||
NSArray *activeFolderFeeds = [self.activeFeedLocations objectForKey:folderName];
|
||||
|
|
@ -517,8 +516,6 @@ viewForHeaderInSection:(NSInteger)section {
|
|||
NSString *feedIdStr = [NSString stringWithFormat:@"%@",feedId];
|
||||
NSDictionary *feed = [self.dictFeeds objectForKey:feedIdStr];
|
||||
int maxScore = [NewsBlurViewController computeMaxScoreForFeed:feed];
|
||||
// deleted = NO;
|
||||
// inserted = NO;
|
||||
|
||||
if ([self.visibleFeeds objectForKey:feedIdStr]) {
|
||||
if (maxScore < newLevel) {
|
||||
|
|
@ -575,6 +572,12 @@ viewForHeaderInSection:(NSInteger)section {
|
|||
[self.feedTitlesTable endUpdates];
|
||||
}
|
||||
|
||||
- (void)redrawUnreadCounts {
|
||||
for (UITableViewCell *cell in self.feedTitlesTable.visibleCells) {
|
||||
[cell setNeedsDisplay];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)calculateFeedLocations:(BOOL)markVisible {
|
||||
self.activeFeedLocations = [NSMutableDictionary dictionary];
|
||||
if (markVisible) {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \
|
||||
blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
|
||||
|
||||
#define NEWSBLUR_URL [NSString stringWithFormat:@"nb.local.host:8000"]
|
||||
// #define NEWSBLUR_URL [NSString stringWithFormat:@"www.newsblur.com"]
|
||||
// #define NEWSBLUR_URL [NSString stringWithFormat:@"nb.local.host:8000"]
|
||||
#define NEWSBLUR_URL [NSString stringWithFormat:@"www.newsblur.com"]
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue