diff options
author | dmoagx <post@wickenrode.com> | 2011-04-29 20:05:41 +0000 |
---|---|---|
committer | dmoagx <post@wickenrode.com> | 2011-04-29 20:05:41 +0000 |
commit | 7e0ffd0bc334be6e681f35710a8a70da34efbcea (patch) | |
tree | 8b29608a6ea53754586e0ff55387ae0fd791272b /Source/SPTableContent.m | |
parent | c0f8ea3f976f4df58b185d2636b5899c8d48d180 (diff) | |
download | sequelpro-7e0ffd0bc334be6e681f35710a8a70da34efbcea.tar.gz sequelpro-7e0ffd0bc334be6e681f35710a8a70da34efbcea.tar.bz2 sequelpro-7e0ffd0bc334be6e681f35710a8a70da34efbcea.zip |
* Allow table names to be sorted in lists via "AlphabeticalTableSorting" hidden pref key
* Change some [[NSPopupButton selectedItem] title] to [NSPopupButton titleOfSelectedItem]
Diffstat (limited to 'Source/SPTableContent.m')
-rw-r--r-- | Source/SPTableContent.m | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m index ddc58670..e4fe9dc2 100644 --- a/Source/SPTableContent.m +++ b/Source/SPTableContent.m @@ -609,10 +609,8 @@ // Enable and initialize filter fields (with tags for position of menu item and field position) [fieldField setEnabled:YES]; [fieldField removeAllItems]; - [fieldField addItemsWithTitles:columnNames]; - for ( i = 0 ; i < [fieldField numberOfItems] ; i++ ) { - [[fieldField itemAtIndex:i] setTag:i]; - } + NSArray *columnTitles = ([prefs boolForKey:SPAlphabeticalTableSorting])? [columnNames sortedArrayUsingSelector:@selector(compare:)] : columnNames; + [fieldField addItemsWithTitles:columnTitles]; [compareField setEnabled:YES]; [self setCompareTypes:self]; [argumentField setEnabled:YES]; @@ -2346,8 +2344,8 @@ [compareField removeAllItems]; NSString *fieldTypeGrouping; - if([[tableDataInstance columnWithName:[[fieldField selectedItem] title]] objectForKey:@"typegrouping"]) - fieldTypeGrouping = [NSString stringWithString:[[tableDataInstance columnWithName:[[fieldField selectedItem] title]] objectForKey:@"typegrouping"]]; + if([[tableDataInstance columnWithName:[fieldField titleOfSelectedItem]] objectForKey:@"typegrouping"]) + fieldTypeGrouping = [NSString stringWithString:[[tableDataInstance columnWithName:[fieldField titleOfSelectedItem]] objectForKey:@"typegrouping"]]; else return; @@ -2393,7 +2391,7 @@ } else { compareType = @""; NSBeep(); - NSLog(@"ERROR: unknown type for comparision: %@, in %@", [[tableDataInstance columnWithName:[[fieldField selectedItem] title]] objectForKey:@"type"], fieldTypeGrouping); + NSLog(@"ERROR: unknown type for comparision: %@, in %@", [[tableDataInstance columnWithName:[fieldField titleOfSelectedItem]] objectForKey:@"type"], fieldTypeGrouping); } // Add IS NULL and IS NOT NULL as they should always be available @@ -3330,7 +3328,7 @@ theDictionary = [NSDictionary dictionaryWithObjectsAndKeys: [self tableFilterString], @"menuLabel", - [[fieldField selectedItem] title], @"filterField", + [fieldField titleOfSelectedItem], @"filterField", [[compareField selectedItem] title], @"filterComparison", [NSNumber numberWithInteger:[[compareField selectedItem] tag]], @"filterComparisonTag", [argumentField stringValue], @"filterValue", |