aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTableRelations.m
diff options
context:
space:
mode:
authordmoagx <post@wickenrode.com>2011-04-29 20:05:41 +0000
committerdmoagx <post@wickenrode.com>2011-04-29 20:05:41 +0000
commit7e0ffd0bc334be6e681f35710a8a70da34efbcea (patch)
tree8b29608a6ea53754586e0ff55387ae0fd791272b /Source/SPTableRelations.m
parentc0f8ea3f976f4df58b185d2636b5899c8d48d180 (diff)
downloadsequelpro-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/SPTableRelations.m')
-rw-r--r--Source/SPTableRelations.m7
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/SPTableRelations.m b/Source/SPTableRelations.m
index 5160448f..980b8d30 100644
--- a/Source/SPTableRelations.m
+++ b/Source/SPTableRelations.m
@@ -49,6 +49,7 @@
{
if ((self = [super init])) {
relationData = [[NSMutableArray alloc] init];
+ prefs = [NSUserDefaults standardUserDefaults];
}
return self;
@@ -175,7 +176,8 @@
[addRelationTableBox setTitle:[NSString stringWithFormat:NSLocalizedString(@"Table: %@", @"Add Relation sheet title, showing table name"), [tablesListInstance tableName]]];
[columnPopUpButton removeAllItems];
- [columnPopUpButton addItemsWithTitles:[tableDataInstance columnNames]];
+ NSArray *columnTitles = ([prefs boolForKey:SPAlphabeticalTableSorting])? [[tableDataInstance columnNames] sortedArrayUsingSelector:@selector(compare:)] : [tableDataInstance columnNames];
+ [columnPopUpButton addItemsWithTitles:columnTitles];
[refTablePopUpButton removeAllItems];
@@ -559,7 +561,8 @@
// Add the valid columns
if ([validColumns count] > 0) {
- [refColumnPopUpButton addItemsWithTitles:validColumns];
+ NSArray *columnTitles = ([prefs boolForKey:SPAlphabeticalTableSorting])? [validColumns sortedArrayUsingSelector:@selector(compare:)] : validColumns;
+ [refColumnPopUpButton addItemsWithTitles:columnTitles];
[refColumnPopUpButton setEnabled:YES];
[confirmAddRelationButton setEnabled:YES];