Archived
1

-Changed Main Split view to fix a graphical bug in the results split area

-Changed the maximum width of the search field
-Fixed a bug: "Network error" when having special characters in query
-Fixed a bug: Returned false results when having a "&" in the query
This commit is contained in:
Kim Wittenburg
2012-06-18 16:19:01 +02:00
parent dd82658055
commit a5d716af91
13 changed files with 791 additions and 623 deletions

View File

@@ -44,6 +44,7 @@
#pragma mark -
#pragma mark Outline view Data Source and Delegate
-(NSInteger)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(id)item {
return item == nil ? [loadedResults count] : 0;
}
@@ -115,8 +116,9 @@
- (IBAction)loadNextResults:(id)sender {
NSArray *nextResults = [currentHoster nextResults];
[loadMoreResultsButton setEnabled:[currentHoster hasMoreResults]];
if (nextResults == nil) {
NSRunCriticalAlertPanel(NSLocalizedString(@"Hoster.messages.networkError.title", @""), NSLocalizedString(@"Hoster.messages.networkError.detail", @""), NSLocalizedString(@"OK", @""), nil, nil);
NSRunCriticalAlertPanel(NSLocalizedString(@"Hoster.messages.networkOrQueryError.title", @""), NSLocalizedString(@"Hoster.messages.networkOrQueryError.detail", @""), NSLocalizedString(@"OK", @""), nil, nil);
return;
}
if ([nextResults count] == 0) {
@@ -125,7 +127,6 @@
}
[loadedResults addObjectsFromArray:nextResults];
[resultsOutline reloadData];
[loadMoreResultsButton setEnabled:[currentHoster hasMoreResults]];
}
-(IBAction)resetLoadedResults:(id)sender {
@@ -251,6 +252,21 @@
[window makeKeyAndOrderFront:sender];
}
#pragma mark Split View Delegate
/*-(CGFloat)splitView:(NSSplitView *)splitView constrainMaxCoordinate:(CGFloat)proposedMaximumPosition ofSubviewAt:(NSInteger)dividerIndex {
NSView *rightView = [[splitView subviews] objectAtIndex:1];
int width = [splitView frame].size.width;
int maxWidth = width-[rightView frame].size.width;
return maxWidth;
}*/
-(CGFloat)splitView:(NSSplitView *)splitView constrainMinCoordinate:(CGFloat)proposedMinimumPosition ofSubviewAt:(NSInteger)dividerIndex {
int outlineMinWith = [[resultsOutline tableColumnWithIdentifier:@"song"] minWidth] + [[resultsOutline tableColumnWithIdentifier:@"artist"] minWidth];
int minWidth = outlineMinWith;
return minWidth;
}
#pragma mark window delegate
-(BOOL)validateMenuItem:(NSMenuItem *)menuItem {