From f48b5ba6410a5d449fad026e870e2c3e5e0fcf53 Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Thu, 28 Oct 2010 15:35:40 +0000 Subject: Add SPDefaultPasteboardDragType constant. --- Interfaces/English.lproj/DBView.xib | 69 ++++++++++++++++++++++--------------- Source/SPConstants.h | 2 +- Source/SPConstants.m | 1 + Source/SPCustomQuery.m | 6 ++-- Source/SPTableStructure.h | 13 ++++--- Source/SPTableStructure.m | 14 +++----- Source/SPTableStructureDelegate.m | 10 +++--- 7 files changed, 63 insertions(+), 52 deletions(-) diff --git a/Interfaces/English.lproj/DBView.xib b/Interfaces/English.lproj/DBView.xib index fc0c5510..c2ad3857 100644 --- a/Interfaces/English.lproj/DBView.xib +++ b/Interfaces/English.lproj/DBView.xib @@ -3,7 +3,7 @@ 1050 10F569 - 804 + 823 1038.29 461.00 @@ -16,15 +16,15 @@ YES - 804 - 804 + 823 + 823 1.2.5 YES - + YES @@ -16167,6 +16167,14 @@ bGQgTmFtZQkgID0gQAoJCQkJICBMRU5HVEgoYEBgKSA+IEA 7669 + + + databaseDataInstance + + + + 7670 + @@ -25321,7 +25329,7 @@ bGQgTmFtZQkgID0gQAoJCQkJICBMRU5HVEgoYEBgKSA+IEA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{109, 183}, {943, 549}} + {{81, 183}, {943, 549}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -25813,7 +25821,7 @@ bGQgTmFtZQkgID0gQAoJCQkJICBMRU5HVEgoYEBgKSA+IEA - 7669 + 7670 @@ -25860,13 +25868,6 @@ bGQgTmFtZQkgID0gQAoJCQkJICBMRU5HVEgoYEBgKSA+IEA - - NSObject - - IBProjectSource - Frameworks/MCPKit/MCPFoundationKit/MCPConnection.h - - NSObject @@ -25964,6 +25965,8 @@ bGQgTmFtZQkgID0gQAoJCQkJICBMRU5HVEgoYEBgKSA+IEA doSelectionUpperCase: doTranspose: insertNULLvalue: + moveSelectionLineDown: + moveSelectionLineUp: selectCurrentLine: selectCurrentWord: selectEnclosingBrackets: @@ -25983,6 +25986,8 @@ bGQgTmFtZQkgID0gQAoJCQkJICBMRU5HVEgoYEBgKSA+IEA id id id + id + id @@ -25999,6 +26004,8 @@ bGQgTmFtZQkgID0gQAoJCQkJICBMRU5HVEgoYEBgKSA+IEA doSelectionUpperCase: doTranspose: insertNULLvalue: + moveSelectionLineDown: + moveSelectionLineUp: selectCurrentLine: selectCurrentWord: selectEnclosingBrackets: @@ -26045,6 +26052,14 @@ bGQgTmFtZQkgID0gQAoJCQkJICBMRU5HVEgoYEBgKSA+IEA insertNULLvalue: id + + moveSelectionLineDown: + id + + + moveSelectionLineUp: + id + selectCurrentLine: id @@ -28077,11 +28092,9 @@ bGQgTmFtZQkgID0gQAoJCQkJICBMRU5HVEgoYEBgKSA+IEA exportExcelSheetOrFilePerTableMatrix exportFilePerTableCheck exportFilenameDividerBox - exportHTMLIncludeStructureCheck exportInputPopUpButton exportOptionsTabBar exportOutputCompressionFormatPopupButton - exportPDFIncludeStructureCheck exportPathField exportProcessLowMemoryButton exportProgressIndicator @@ -28133,11 +28146,9 @@ bGQgTmFtZQkgID0gQAoJCQkJICBMRU5HVEgoYEBgKSA+IEA NSMatrix NSButton NSBox - NSButton NSPopUpButton NSTabView NSPopUpButton - NSButton NSTextField NSButton NSProgressIndicator @@ -28192,11 +28203,9 @@ bGQgTmFtZQkgID0gQAoJCQkJICBMRU5HVEgoYEBgKSA+IEA exportExcelSheetOrFilePerTableMatrix exportFilePerTableCheck exportFilenameDividerBox - exportHTMLIncludeStructureCheck exportInputPopUpButton exportOptionsTabBar exportOutputCompressionFormatPopupButton - exportPDFIncludeStructureCheck exportPathField exportProcessLowMemoryButton exportProgressIndicator @@ -28314,10 +28323,6 @@ bGQgTmFtZQkgID0gQAoJCQkJICBMRU5HVEgoYEBgKSA+IEA exportFilenameDividerBox NSBox - - exportHTMLIncludeStructureCheck - NSButton - exportInputPopUpButton NSPopUpButton @@ -28330,10 +28335,6 @@ bGQgTmFtZQkgID0gQAoJCQkJICBMRU5HVEgoYEBgKSA+IEA exportOutputCompressionFormatPopupButton NSPopUpButton - - exportPDFIncludeStructureCheck - NSButton - exportPathField NSTextField @@ -28445,6 +28446,13 @@ bGQgTmFtZQkgID0gQAoJCQkJICBMRU5HVEgoYEBgKSA+IEA Source/SPExportController.h + + SPExportController + + IBProjectSource + Source/SPExportControllerDelegate.h + + SPExportController @@ -30559,6 +30567,13 @@ bGQgTmFtZQkgID0gQAoJCQkJICBMRU5HVEgoYEBgKSA+IEA Source/SPTableStructure.h + + SPTableStructure + + IBProjectSource + Source/SPTableStructureDelegate.h + + SPTableStructure NSObject 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]; -- cgit v1.2.3