aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/SPConstants.h2
-rw-r--r--Source/SPConstants.m1
-rw-r--r--Source/SPCustomQuery.m6
-rw-r--r--Source/SPTableStructure.h13
-rw-r--r--Source/SPTableStructure.m14
-rw-r--r--Source/SPTableStructureDelegate.m10
6 files changed, 21 insertions, 25 deletions
diff --git a/Source/SPConstants.h b/Source/SPConstants.h
index fd8c3af6..a3665661 100644
--- a/Source/SPConstants.h
+++ b/Source/SPConstants.h
@@ -211,9 +211,9 @@ extern NSString *SPKillProcessConnectionMode;
extern NSString *SPDefaultMonospacedFontName;
// Table view drag types
+extern NSString *SPDefaultPasteboardDragType;
extern NSString *SPFavoritesPasteboardDragType;
extern NSString *SPContentFilterPasteboardDragType;
-extern NSString *SPQueryFavortiesPasteboardDragType;
// File extensions
extern NSString *SPFileExtensionDefault;
diff --git a/Source/SPConstants.m b/Source/SPConstants.m
index 3dadf8c4..1b76d688 100644
--- a/Source/SPConstants.m
+++ b/Source/SPConstants.m
@@ -39,6 +39,7 @@ NSString *SPKillProcessConnectionMode = @"SPKillProcessConnectionMode
NSString *SPDefaultMonospacedFontName = @"Monaco";
// Table view drag types
+NSString *SPDefaultPasteboardDragType = @"SequelProPasteboard";
NSString *SPFavoritesPasteboardDragType = @"SPFavoritesPasteboard";
NSString *SPContentFilterPasteboardDragType = @"SPContentFilterPasteboard";
diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m
index 203f9ae6..31ff02d7 100644
--- a/Source/SPCustomQuery.m
+++ b/Source/SPCustomQuery.m
@@ -2128,9 +2128,9 @@
if ( aTableView == queryFavoritesView ) {
if ([pboardTypes count] == 1 && row != -1)
{
- if ([[pboardTypes objectAtIndex:0] isEqualToString:@"SequelProPasteboard"]==YES && operation==NSTableViewDropAbove)
+ if ([[pboardTypes objectAtIndex:0] isEqualToString:SPDefaultPasteboardDragType]==YES && operation==NSTableViewDropAbove)
{
- originalRow = [[[info draggingPasteboard] stringForType:@"SequelProPasteboard"] intValue];
+ originalRow = [[[info draggingPasteboard] stringForType:SPDefaultPasteboardDragType] intValue];
if (row != originalRow && row != (originalRow+1))
{
@@ -2151,7 +2151,7 @@
NSMutableDictionary *draggedRow;
if ( aTableView == queryFavoritesView ) {
- originalRow = [[[info draggingPasteboard] stringForType:@"SequelProPasteboard"] intValue];
+ originalRow = [[[info draggingPasteboard] stringForType:SPDefaultPasteboardDragType] intValue];
destinationRow = row;
if ( destinationRow > originalRow )
diff --git a/Source/SPTableStructure.h b/Source/SPTableStructure.h
index 657cf777..68225fab 100644
--- a/Source/SPTableStructure.h
+++ b/Source/SPTableStructure.h
@@ -33,6 +33,7 @@
IBOutlet id tableInfoInstance;
IBOutlet id extendedTableInfoInstance;
IBOutlet id indexesController;
+ IBOutlet id databaseDataInstance;
IBOutlet id keySheet;
IBOutlet id resetAutoIncrementSheet;
@@ -54,11 +55,8 @@
IBOutlet NSButton *indexesShowButton;
IBOutlet id viewColumnsMenu;
-
IBOutlet id encodingPopupCell;
-
- id databaseDataInstance;
-
+
MCPConnection *mySQLConnection;
MCPResult *tableSourceResult;
MCPResult *indexResult;
@@ -67,17 +65,18 @@
NSMutableArray *tableFields;
NSMutableDictionary *oldRow, *enumFields;
NSDictionary *defaultValues;
- BOOL isEditingRow, isEditingNewRow, isSavingRow, alertSheetOpened;
NSInteger currentlyEditingRow;
NSUserDefaults *prefs;
NSArray *collations;
NSArray *typeSuggestions;
+
+ BOOL isEditingRow, isEditingNewRow, isSavingRow, alertSheetOpened;
}
-// Table methods
+// Table loading
- (void)loadTable:(NSString *)aTable;
- (IBAction)reloadTable:(id)sender;
-- (void) setTableDetails:(NSDictionary *)tableDetails;
+- (void)setTableDetails:(NSDictionary *)tableDetails;
// Edit methods
- (IBAction)addField:(id)sender;
diff --git a/Source/SPTableStructure.m b/Source/SPTableStructure.m
index 3290df89..86644319 100644
--- a/Source/SPTableStructure.m
+++ b/Source/SPTableStructure.m
@@ -133,9 +133,6 @@
nil] retain];
// Hint: _isFieldTypeDate and _isFieldTypeNumeric must be changed if typeSuggestions was changed!
-
- databaseDataInstance = [tableDocumentInstance valueForKeyPath:@"databaseDataInstance"];
-
// Add observers for document task activity
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(startDocumentTaskForTab:)
@@ -193,7 +190,7 @@
[theTableFields setArray:[NSArray array]];
// Make a mutable copy out of the cached [tableDataInstance columns] since we're adding infos
- for(id col in [tableDataInstance columns])
+ for (id col in [tableDataInstance columns])
[theTableFields addObject:[[col mutableCopy] autorelease]];
// Retrieve the indexes for the table
@@ -712,7 +709,7 @@
#pragma mark Index sheet methods
/**
- * Closes the current sheet and stops the modal session
+ * Closes the current sheet and stops the modal session.
*/
- (IBAction)closeSheet:(id)sender
{
@@ -721,14 +718,13 @@
}
/**
-closes the keySheet
-*/
+ * Closes the key sheet.
+ */
- (IBAction)closeKeySheet:(id)sender
{
[NSApp stopModalWithCode:[sender tag]];
}
-
#pragma mark -
#pragma mark Additional methods
@@ -743,7 +739,7 @@ closes the keySheet
[indexesController setConnection:mySQLConnection];
// Set up tableView
- [tableSourceView registerForDraggedTypes:[NSArray arrayWithObjects:@"SequelProPasteboard", nil]];
+ [tableSourceView registerForDraggedTypes:[NSArray arrayWithObjects:SPDefaultPasteboardDragType, nil]];
}
/**
diff --git a/Source/SPTableStructureDelegate.m b/Source/SPTableStructureDelegate.m
index 377fd7b3..d3954df7 100644
--- a/Source/SPTableStructureDelegate.m
+++ b/Source/SPTableStructureDelegate.m
@@ -160,8 +160,8 @@
if ( ![self saveRowOnDeselect] ) return NO;
if ([rows count] == 1) {
- [pboard declareTypes:[NSArray arrayWithObject:@"SequelProPasteboard"] owner:nil];
- [pboard setString:[[NSNumber numberWithInteger:[rows firstIndex]] stringValue] forType:@"SequelProPasteboard"];
+ [pboard declareTypes:[NSArray arrayWithObject:SPDefaultPasteboardDragType] owner:nil];
+ [pboard setString:[[NSNumber numberWithInteger:[rows firstIndex]] stringValue] forType:SPDefaultPasteboardDragType];
return YES;
}
else {
@@ -184,11 +184,11 @@
NSInteger originalRow;
// Ensure the drop is of the correct type
- if (operation == NSTableViewDropAbove && row != -1 && [pboardTypes containsObject:@"SequelProPasteboard"]) {
+ if (operation == NSTableViewDropAbove && row != -1 && [pboardTypes containsObject:SPDefaultPasteboardDragType]) {
// Ensure the drag originated within this table
if ([info draggingSource] == tableView) {
- originalRow = [[[info draggingPasteboard] stringForType:@"SequelProPasteboard"] integerValue];
+ originalRow = [[[info draggingPasteboard] stringForType:SPDefaultPasteboardDragType] integerValue];
if (row != originalRow && row != (originalRow+1)) {
return NSDragOperationMove;
@@ -212,7 +212,7 @@
NSDictionary *originalRow;
// Extract the original row position from the pasteboard and retrieve the details
- originalRowIndex = [[[info draggingPasteboard] stringForType:@"SequelProPasteboard"] integerValue];
+ originalRowIndex = [[[info draggingPasteboard] stringForType:SPDefaultPasteboardDragType] integerValue];
originalRow = [[NSDictionary alloc] initWithDictionary:[tableFields objectAtIndex:originalRowIndex]];
[[NSNotificationCenter defaultCenter] postNotificationName:@"SMySQLQueryWillBePerformed" object:tableDocumentInstance];