aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/SPFieldMapperController.m14
-rw-r--r--Source/SPTableData.m2
-rw-r--r--Source/SPTableInfo.m6
-rw-r--r--Source/SPTablesList.m20
4 files changed, 18 insertions, 24 deletions
diff --git a/Source/SPFieldMapperController.m b/Source/SPFieldMapperController.m
index ae76f8e2..6a558321 100644
--- a/Source/SPFieldMapperController.m
+++ b/Source/SPFieldMapperController.m
@@ -144,10 +144,9 @@ static NSString *SPTableViewSqlColumnID = @"sql";
[tableTargetPopup addItemsWithTitles:allTableNames];
// Select either the currently selected table, or the first item in the list, or if no table in db switch to "New Table" mode
- if ([[theDelegate valueForKeyPath:@"tableDocumentInstance"] table] != nil
- && ![[tablesListInstance tableName] isEqualToString:@""]
- && [allTableNames containsObject:[tablesListInstance tableName]]) {
- [tableTargetPopup selectItemWithTitle:[tablesListInstance tableName]];
+ if ([[tablesListInstance selectedTableNames] count]
+ && [allTableNames containsObject:[[tablesListInstance selectedTableNames] objectAtIndex:0]]) {
+ [tableTargetPopup selectItemWithTitle:[[tablesListInstance selectedTableNames] objectAtIndex:0]];
} else {
if([allTableNames count])
[tableTargetPopup selectItemAtIndex:3];
@@ -514,10 +513,9 @@ static NSString *SPTableViewSqlColumnID = @"sql";
}
// Select either the currently selected table, or the first item in the list, or if no table in db switch to "New Table" mode
- if ([[theDelegate valueForKeyPath:@"tableDocumentInstance"] table] != nil
- && ![[tablesListInstance tableName] isEqualToString:@""]
- && [allTableNames containsObject:[tablesListInstance tableName]]) {
- [tableTargetPopup selectItemWithTitle:[tablesListInstance tableName]];
+ if ([[tablesListInstance selectedTableNames] count]
+ && [allTableNames containsObject:[[tablesListInstance selectedTableNames] objectAtIndex:0]]) {
+ [tableTargetPopup selectItemWithTitle:[[tablesListInstance selectedTableNames] objectAtIndex:0]];
} else {
if([allTableNames count])
[tableTargetPopup selectItemAtIndex:3];
diff --git a/Source/SPTableData.m b/Source/SPTableData.m
index de253e57..1936d0b1 100644
--- a/Source/SPTableData.m
+++ b/Source/SPTableData.m
@@ -928,7 +928,7 @@
BOOL changeEncoding = ![[mySQLConnection encoding] isEqualToString:@"utf8"];
// Catch unselected tables and return false
- if ([[tableListInstance tableName] isEqualToString:@""] || ![tableListInstance tableName]) {
+ if (![tableListInstance tableName]) {
pthread_mutex_unlock(&dataProcessingLock);
return FALSE;
}
diff --git a/Source/SPTableInfo.m b/Source/SPTableInfo.m
index d06198b4..bb9abacd 100644
--- a/Source/SPTableInfo.m
+++ b/Source/SPTableInfo.m
@@ -126,9 +126,11 @@
[info removeAllObjects];
- if ([[tableListInstance tableName] isEqualToString:@""]) {
+ if (![tableListInstance tableName]) {
[info addObject:NSLocalizedString(@"INFORMATION", @"header for blank info pane")];
- [info addObject:NSLocalizedString(@"multiple selection", @"multiple selection")];
+ if ([[tableListInstance selectedTableItems] count]) {
+ [info addObject:NSLocalizedString(@"multiple selection", @"multiple selection")];
+ }
[infoTable reloadData];
return;
}
diff --git a/Source/SPTablesList.m b/Source/SPTablesList.m
index e81f78b1..fe43c845 100644
--- a/Source/SPTablesList.m
+++ b/Source/SPTablesList.m
@@ -760,17 +760,7 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable";
#endif
// Update the selected table name and type
if (selectedTableName) [selectedTableName release];
-
-#ifndef SP_REFACTOR /* ui manipulation */
- if ([indexes count]) {
- selectedTableName = [[NSString alloc] initWithString:@""];
- }
- else {
-#endif
- selectedTableName = nil;
-#ifndef SP_REFACTOR /* ui manipulation */
- }
-#endif
+ selectedTableName = nil;
#ifndef SP_REFACTOR /* ui manipulation */
// Set gear menu items Remove/Duplicate table/view according to the table types
@@ -1552,8 +1542,12 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable";
if ([tablesListView numberOfSelectedRows] != 1) {
// Ensure the state is cleared
- if ([tableDocumentInstance table]) [tableDocumentInstance loadTable:nil ofType:SPTableTypeNone];
- else [self setSelectionState:nil];
+ if ([tableDocumentInstance table]) {
+ [tableDocumentInstance loadTable:nil ofType:SPTableTypeNone];
+ } else {
+ [self setSelectionState:nil];
+ [tableInfoInstance tableChanged:nil];
+ }
if (selectedTableName) [selectedTableName release], selectedTableName = nil;
selectedTableType = SPTableTypeNone;
return;