aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/SPContentFilterManager.h5
-rw-r--r--Source/SPCustomQuery.h5
-rw-r--r--Source/SPDatabaseDocument.m10
-rw-r--r--Source/SPFieldEditorController.h5
-rw-r--r--Source/SPIndexesController.h5
-rw-r--r--Source/SPQueryFavoriteManager.h5
-rw-r--r--Source/SPTableContent.h5
-rw-r--r--Source/SPTableStructure.h5
-rw-r--r--Source/SPTablesList.m21
9 files changed, 28 insertions, 38 deletions
diff --git a/Source/SPContentFilterManager.h b/Source/SPContentFilterManager.h
index ec23afe6..dda8995c 100644
--- a/Source/SPContentFilterManager.h
+++ b/Source/SPContentFilterManager.h
@@ -31,10 +31,9 @@
@end
-#ifndef SP_REFACTOR /* ivars */
@interface SPContentFilterManager : NSWindowController
-#else
-@interface SPContentFilterManager : NSWindowController <NSOpenSavePanelDelegate>
+#ifdef SP_REFACTOR /* ivars */
+<NSOpenSavePanelDelegate>
#endif
{
#ifndef SP_REFACTOR /* ivars */
diff --git a/Source/SPCustomQuery.h b/Source/SPCustomQuery.h
index 16aaca14..8d289f70 100644
--- a/Source/SPCustomQuery.h
+++ b/Source/SPCustomQuery.h
@@ -52,10 +52,9 @@
@class SPCopyTable, SPQueryFavoriteManager, SPDataStorage, NSSplitView, SPFieldEditorController;
#endif
-#ifndef SP_REFACTOR
@interface SPCustomQuery : NSObject
-#else
-@interface SPCustomQuery : NSObject <NSTableViewDataSource, NSWindowDelegate, NSTableViewDelegate>
+#ifdef SP_REFACTOR
+<NSTableViewDataSource, NSWindowDelegate, NSTableViewDelegate>
#endif
{
IBOutlet id tableDocumentInstance;
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m
index 308826e0..237b8d85 100644
--- a/Source/SPDatabaseDocument.m
+++ b/Source/SPDatabaseDocument.m
@@ -4147,7 +4147,8 @@ static NSString *SPCreateSyntx = @"SPCreateSyntax";
[connection setObject:[connectionController sshHost] forKey:@"ssh_host"];
[connection setObject:[connectionController sshUser] forKey:@"ssh_user"];
[connection setObject:[NSNumber numberWithInt:[connectionController sshKeyLocationEnabled]] forKey:@"ssh_keyLocationEnabled"];
- [connection setObject:[connectionController sshKeyLocation] forKey:@"ssh_keyLocation"];
+ if ([connectionController sshKeyLocation])
+ [connection setObject:[connectionController sshKeyLocation] forKey:@"ssh_keyLocation"];
if ([connectionController sshPort] && [[connectionController sshPort] length])
[connection setObject:[NSNumber numberWithInteger:[[connectionController sshPort] integerValue]] forKey:@"ssh_port"];
break;
@@ -4167,11 +4168,8 @@ static NSString *SPCreateSyntx = @"SPCreateSyntax";
if (includePasswords) {
NSString *pw = [self keychainPasswordForConnection:nil];
- if (![pw length]) pw = [connectionController password];
- if (pw)
- [connection setObject:pw forKey:@"password"];
- else
- [connection setObject:@"" forKey:@"password"];
+ if (!pw) pw = [connectionController password];
+ if (pw) [connection setObject:pw forKey:@"password"];
if ([connectionController type] == SPSSHTunnelConnection) {
NSString *sshpw = [self keychainPasswordForSSHConnection:nil];
diff --git a/Source/SPFieldEditorController.h b/Source/SPFieldEditorController.h
index e2cc3195..29d4c445 100644
--- a/Source/SPFieldEditorController.h
+++ b/Source/SPFieldEditorController.h
@@ -32,10 +32,9 @@
* This class offers a sheet for editing different kind of data such as text, blobs (including images) as
* editSheet and bit fields as bitSheet.
*/
-#ifndef SP_REFACTOR
@interface SPFieldEditorController : NSWindowController
-#else
-@interface SPFieldEditorController : NSWindowController <NSComboBoxDataSource>
+#ifdef SP_REFACTOR
+<NSComboBoxDataSource>
#endif
{
IBOutlet id editSheetProgressBar;
diff --git a/Source/SPIndexesController.h b/Source/SPIndexesController.h
index 6b755bcc..b91481bc 100644
--- a/Source/SPIndexesController.h
+++ b/Source/SPIndexesController.h
@@ -29,10 +29,9 @@
@class SPDatabaseDocument, SPTablesList, SPTableData, SPTableStructure, MCPConnection, SPTableView;
#endif
-#ifndef SP_REFACTOR
@interface SPIndexesController : NSWindowController
-#else
-@interface SPIndexesController : NSWindowController <NSTableViewDelegate, NSTableViewDataSource>
+#ifdef SP_REFACTOR
+<NSTableViewDelegate, NSTableViewDataSource>
#endif
{
// Controllers
diff --git a/Source/SPQueryFavoriteManager.h b/Source/SPQueryFavoriteManager.h
index 0ebdc837..66d43778 100644
--- a/Source/SPQueryFavoriteManager.h
+++ b/Source/SPQueryFavoriteManager.h
@@ -31,10 +31,9 @@
@end
-#ifndef SP_REFACTOR
@interface SPQueryFavoriteManager : NSWindowController
-#else
-@interface SPQueryFavoriteManager : NSWindowController <NSOpenSavePanelDelegate>
+#ifdef SP_REFACTOR
+<NSOpenSavePanelDelegate>
#endif
{
#ifndef SP_REFACTOR /* ivars */
diff --git a/Source/SPTableContent.h b/Source/SPTableContent.h
index 7d763ba1..036fde34 100644
--- a/Source/SPTableContent.h
+++ b/Source/SPTableContent.h
@@ -30,10 +30,9 @@
@class SPDatabaseDocument, SPCopyTable, SPTextAndLinkCell, SPHistoryController, SPTableInfo, SPDataStorage, SPTextView, SPFieldEditorController;
@class SPTableData, SPDatabaseDocument, SPTablesList, SPTableStructure, SPTableList, SPContentFilterManager;
-#ifndef SP_REFACTOR
@interface SPTableContent : NSObject
-#else
-@interface SPTableContent : NSObject <NSTableViewDelegate, NSTableViewDataSource, NSComboBoxDataSource, NSComboBoxDelegate>
+#ifdef SP_REFACTOR
+<NSTableViewDelegate, NSTableViewDataSource, NSComboBoxDataSource, NSComboBoxDelegate>
#endif
{
IBOutlet SPDatabaseDocument *tableDocumentInstance;
diff --git a/Source/SPTableStructure.h b/Source/SPTableStructure.h
index 0a608b89..ce0302fa 100644
--- a/Source/SPTableStructure.h
+++ b/Source/SPTableStructure.h
@@ -27,10 +27,9 @@
@class SPDatabaseDocument, SPTableFieldValidation, SPTableData, SPDatabaseData, SPTablesList, SPIndexesController, SPTableView;
-#ifndef SP_REFACTOR
@interface SPTableStructure : NSObject
-#else
-@interface SPTableStructure : NSObject <NSTableViewDelegate, NSTableViewDataSource, NSComboBoxCellDataSource>
+#ifdef SP_REFACTOR
+<NSTableViewDelegate, NSTableViewDataSource, NSComboBoxCellDataSource>
#endif
{
IBOutlet SPTablesList* tablesListInstance;
diff --git a/Source/SPTablesList.m b/Source/SPTablesList.m
index 9b92763a..9fc396d5 100644
--- a/Source/SPTablesList.m
+++ b/Source/SPTablesList.m
@@ -367,7 +367,7 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable";
NSArray *engines = [databaseDataInstance getDatabaseStorageEngines];
// Add default menu item
- [tableTypeButton addItemWithTitle:@"Default"];
+ [tableTypeButton addItemWithTitle:NSLocalizedString(@"Default",@"New Table Sheet : Table Engine Dropdown : Default")];
[[tableTypeButton menu] addItem:[NSMenuItem separatorItem]];
for (NSDictionary *engine in engines)
@@ -377,7 +377,7 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable";
// Populate the table encoding popup button with a default menu item
[tableEncodingButton removeAllItems];
- [tableEncodingButton addItemWithTitle:@"Default"];
+ [tableEncodingButton addItemWithTitle:NSLocalizedString(@"Default",@"New Table Sheet : Table Encoding Dropdown : Default")];
// Retrieve the server-supported encodings and add them to the menu
NSArray *encodings = [databaseDataInstance getDatabaseCharacterSetEncodings];
@@ -793,13 +793,8 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable";
NSIndexSet *indexes = [tablesListView selectedRowIndexes];
// Update the selected table name and type
if (selectedTableName) [selectedTableName release];
+ selectedTableName = nil;
- if ([indexes count]) {
- selectedTableName = [[NSString alloc] initWithString:@""];
- }
- else {
- selectedTableName = nil;
- }
#ifndef SP_REFACTOR /* ui manipulation */
// Set gear menu items Remove/Duplicate table/view according to the table types
@@ -1578,8 +1573,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;
@@ -2143,7 +2142,7 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable";
[alert addButtonWithTitle:NSLocalizedString(@"Stop", @"stop button")];
}
[alert setMessageText:NSLocalizedString(@"Error", @"error")];
- [alert setInformativeText:[NSString stringWithFormat:NSLocalizedString(@"Couldn't delete '%@'.\nMySQL said: %@", @"message of panel when an item cannot be deleted"), [tables objectAtIndex:currentIndex], [mySQLConnection getLastErrorMessage]]];
+ [alert setInformativeText:[NSString stringWithFormat:NSLocalizedString(@"Couldn't delete '%@'.\n\nMySQL said: %@", @"message of panel when an item cannot be deleted"), [filteredTables objectAtIndex:currentIndex], [mySQLConnection getLastErrorMessage]]];
[alert setAlertStyle:NSWarningAlertStyle];
if ([indexes indexLessThanIndex:currentIndex] == NSNotFound) {
[alert beginSheetModalForWindow:[tableDocumentInstance parentWindow] modalDelegate:self didEndSelector:nil contextInfo:nil];