Permalink
Browse files

Merge remote-tracking branch 'origin/mergeclasses'

Conflicts:
	Source/SPQueryControllerInitializer.m
	Source/SPQueryDocumentsController.m
	Source/SPQueryFavoriteManager.m
  • Loading branch information...
dmoagx committed Jan 20, 2018
2 parents ef21bc5 + b04243d commit d403528b2e2be083fe80f5a915d1f6867ec9074e
Showing with 9,910 additions and 13,126 deletions.
  1. +1 −1 Source/MGTemplateEngine.m
  2. +1 −1 Source/NoodleLineNumberView.m
  3. +2 −4 Source/SPActivityTextFieldCell.m
  4. +22 −0 Source/SPAppController.h
  5. +238 −1 Source/SPAppController.m
  6. +0 −41 Source/SPAppleScriptSupport.h
  7. +0 −128 Source/SPAppleScriptSupport.m
  8. +0 −43 Source/SPCSVExporterDelegate.h
  9. +0 −124 Source/SPCSVExporterDelegate.m
  10. +1 −1 Source/SPCSVParser.m
  11. +1 −1 Source/SPCharsetCollationHelper.m
  12. +2 −2 Source/SPColorSelectorView.h
  13. +2 −2 Source/SPColorSelectorView.m
  14. +0 −4 Source/SPComboPopupButton.h
  15. +5 −11 Source/SPComboPopupButton.m
  16. +26 −2 Source/SPConnectionController.h
  17. +1,614 −7 Source/SPConnectionController.m
  18. +0 −42 Source/SPConnectionControllerDataSource.h
  19. +0 −121 Source/SPConnectionControllerDataSource.m
  20. +0 −47 Source/SPConnectionControllerDelegate.h
  21. +0 −756 Source/SPConnectionControllerDelegate.m
  22. +4 −2 Source/SPConnectionControllerDelegateProtocol.h
  23. +0 −49 Source/SPConnectionControllerInitializer.h
  24. +0 −417 Source/SPConnectionControllerInitializer.m
  25. +0 −42 Source/SPConnectionDelegate.h
  26. +0 −209 Source/SPConnectionDelegate.m
  27. +0 −53 Source/SPConnectionHandler.h
  28. +0 −538 Source/SPConnectionHandler.m
  29. +0 −2 Source/SPContentFilterManager.m
  30. +2 −3 Source/SPCustomQuery.m
  31. +0 −1 Source/SPDataImport.m
  32. +2 −4 Source/SPDataStorage.m
  33. +42 −1 Source/SPDatabaseDocument.h
  34. +1,186 −12 Source/SPDatabaseDocument.m
  35. +1 −6 Source/SPDatabaseStructure.m
  36. +0 −65 Source/SPDatabaseViewController.h
  37. +0 −641 Source/SPDatabaseViewController.m
  38. +0 −43 Source/SPDotExporterDelegate.h
  39. +0 −78 Source/SPDotExporterDelegate.m
  40. +1 −1 Source/SPEditorPreferencePane.m
  41. +0 −36 Source/SPExportController+SharedPrivateAPI.h
  42. +62 −0 Source/SPExportController.h
  43. +2,706 −19 Source/SPExportController.m
  44. +0 −42 Source/SPExportControllerDelegate.h
  45. +0 −359 Source/SPExportControllerDelegate.m
  46. +0 −49 Source/SPExportFileUtilities.h
  47. +0 −373 Source/SPExportFileUtilities.m
  48. +0 −51 Source/SPExportFilenameUtilities.h
  49. +0 −332 Source/SPExportFilenameUtilities.m
  50. +0 −54 Source/SPExportInitializer.h
  51. +0 −611 Source/SPExportInitializer.m
  52. +0 −42 Source/SPExportInterfaceController.h
  53. +0 −150 Source/SPExportInterfaceController.m
  54. +0 −64 Source/SPExportSettingsPersistence.h
  55. +0 −803 Source/SPExportSettingsPersistence.m
  56. +0 −1 Source/SPExtendedTableInfo.m
  57. +3 −3 Source/SPFavoritesOutlineView.m
  58. +7 −0 Source/SPFieldEditorController.h
  59. +3 −7 Source/SPFieldEditorController.m
  60. +1 −1 Source/SPFieldMapperController.m
  61. +2 −6 Source/SPGeometryDataView.m
  62. +1 −1 Source/SPGotoDatabaseController.m
  63. +0 −43 Source/SPHTMLExporterDelegate.h
  64. +0 −49 Source/SPHTMLExporterDelegate.m
  65. +0 −1 Source/SPHistoryController.m
  66. +2 −2 Source/SPImageView.h
  67. +2 −2 Source/SPImageView.m
  68. +0 −2 Source/SPIndexesController.m
  69. +1 −2 Source/SPNarrowDownCompletion.m
  70. +0 −2 Source/SPNavigatorController.m
  71. +1 −1 Source/SPNetworkPreferencePane.m
  72. +0 −43 Source/SPPDFExporterDelegate.h
  73. +0 −49 Source/SPPDFExporterDelegate.m
  74. +98 −1 Source/SPPreferenceController.m
  75. +0 −42 Source/SPPreferenceControllerDelegate.h
  76. +0 −131 Source/SPPreferenceControllerDelegate.m
  77. +0 −42 Source/SPPrintController.h
  78. +0 −461 Source/SPPrintController.m
  79. +65 −1 Source/SPProcessListController.m
  80. +0 −33 Source/SPProcessListControllerDataSource.h
  81. +0 −96 Source/SPProcessListControllerDataSource.m
  82. +0 −35 Source/SPQueryConsoleDataSource.h
  83. +0 −111 Source/SPQueryConsoleDataSource.m
  84. +32 −0 Source/SPQueryController.h
  85. +564 −1 Source/SPQueryController.m
  86. +0 −37 Source/SPQueryControllerInitializer.h
  87. +0 −151 Source/SPQueryControllerInitializer.m
  88. +0 −61 Source/SPQueryDocumentsController.h
  89. +0 −410 Source/SPQueryDocumentsController.m
  90. +1 −1 Source/SPQueryFavoriteManager.m
  91. +0 −43 Source/SPSQLExporterDelegate.h
  92. +0 −82 Source/SPSQLExporterDelegate.m
  93. +3 −7 Source/SPSQLParser.m
  94. +1 −5 Source/SPSplitView.m
  95. +11 −1 Source/SPTableContent.h
  96. +1,201 −10 Source/SPTableContent.m
  97. +0 −37 Source/SPTableContentDataSource.h
  98. +0 −255 Source/SPTableContentDataSource.m
  99. +0 −35 Source/SPTableContentDelegate.h
  100. +0 −845 Source/SPTableContentDelegate.m
  101. +0 −37 Source/SPTableContentFilter.h
  102. +0 −246 Source/SPTableContentFilter.m
  103. +1 −1 Source/SPTableData.m
  104. +1 −1 Source/SPTableFilterParser.m
  105. +1 −1 Source/SPTableInfo.m
  106. +51 −0 Source/SPTableRelations.m
  107. +0 −35 Source/SPTableRelationsDelegate.h
  108. +0 −87 Source/SPTableRelationsDelegate.m
  109. +6 −0 Source/SPTableStructure.h
  110. +1,145 −3 Source/SPTableStructure.m
  111. +0 −44 Source/SPTableStructureDelegate.h
  112. +0 −868 Source/SPTableStructureDelegate.m
  113. +0 −44 Source/SPTableStructureLoading.h
  114. +0 −368 Source/SPTableStructureLoading.m
  115. +59 −0 Source/SPTableTriggers.m
  116. +0 −33 Source/SPTableTriggersDelegate.h
  117. +0 −100 Source/SPTableTriggersDelegate.m
  118. +3 −3 Source/SPTableView.m
  119. +0 −2 Source/SPTablesList.m
  120. +2 −8 Source/SPTextView.m
  121. +0 −1 Source/SPTextViewAdditions.m
  122. +1 −1 Source/SPTooltip.m
  123. +307 −0 Source/SPUserManager.m
  124. +0 −35 Source/SPUserManagerDataSource.h
  125. +0 −51 Source/SPUserManagerDataSource.m
  126. +0 −35 Source/SPUserManagerDelegate.h
  127. +0 −335 Source/SPUserManagerDelegate.m
  128. +412 −2 Source/SPWindowController.m
  129. +0 −39 Source/SPWindowControllerDelegate.h
  130. +0 −457 Source/SPWindowControllerDelegate.m
  131. +0 −55 Source/SPWindowManagement.h
  132. +0 −182 Source/SPWindowManagement.m
  133. +0 −43 Source/SPXMLExporterDelegate.h
  134. +0 −134 Source/SPXMLExporterDelegate.m
  135. +1 −1 Source/YRKSpinningProgressIndicator.m
  136. +0 −234 sequel-pro.xcodeproj/project.pbxproj
@@ -28,7 +28,7 @@
#define GLOBAL_DELIM_EXPR_END @"expressionEnd"
#define GLOBAL_DELIM_FILTER @"filter"
@interface MGTemplateEngine (PrivateMethods)
@interface MGTemplateEngine ()
- (NSObject *)valueForVariable:(NSString *)var parent:(NSObject **)parent parentKey:(NSString **)parentKey;
- (void)setValue:(NSObject *)newValue forVariable:(NSString *)var forceCurrentStackFrame:(BOOL)inStackFrame;
@@ -53,7 +53,7 @@
#pragma mark -
@interface NoodleLineNumberView (Private)
@interface NoodleLineNumberView ()
- (NSArray *)lineIndices;
- (void)invalidateLineIndices;
@@ -33,7 +33,7 @@
#define FAVORITE_NAME_FONT_SIZE 12.0f
@interface SPActivityTextFieldCell (PrivateAPI)
@interface SPActivityTextFieldCell ()
- (NSAttributedString *)constructSubStringAttributedString;
- (NSAttributedString *)attributedStringForFavoriteName;
@@ -332,9 +332,7 @@ - (void)dealloc
[super dealloc];
}
@end
@implementation SPActivityTextFieldCell (PrivateAPI)
#pragma mark - Private API
/**
* Constructs the attributed string to be used as the cell's substring.
View
@@ -37,6 +37,7 @@
@class SPAboutController;
@class SPDatabaseDocument;
@class SPBundleEditorController;
@class SPWindowController;
@interface SPAppController : NSObject <FRFeedbackReporterDelegate, NSApplicationDelegate, NSOpenSavePanelDelegate, NSFileManagerDelegate>
{
@@ -116,4 +117,25 @@
- (void)addHTMLOutputController:(id)controller;
- (void)removeHTMLOutputController:(id)controller;
#pragma mark - SPAppleScriptSupport
- (NSArray *)orderedDocuments;
- (void)insertInOrderedDocuments:(SPDatabaseDocument *)doc;
- (NSArray *)orderedWindows;
- (id)handleQuitScriptCommand:(NSScriptCommand *)command;
- (id)handleOpenScriptCommand:(NSScriptCommand *)command;
#pragma mark - SPWindowManagement
- (IBAction)newWindow:(id)sender;
- (IBAction)newTab:(id)sender;
- (IBAction)duplicateTab:(id)sender;
- (SPWindowController *)newWindow;
- (SPDatabaseDocument *)makeNewConnectionTabOrWindow;
- (SPWindowController *)frontController;
- (NSWindow *)frontDocumentWindow;
- (void)tabDragStarted:(id)sender;
@end
View
@@ -47,7 +47,6 @@
#import "SPFavoritesController.h"
#import "SPEditorTokens.h"
#import "SPBundleCommandRunner.h"
#import "SPWindowManagement.h"
#import "SPCopyTable.h"
#import "SPSyntaxParser.h"
#import "SPOSInfo.h"
@@ -2362,6 +2361,244 @@ - (void)_copyDefaultThemes
}
}
#pragma mark - SPAppleScriptSupport
/**
* Is needed to interact with AppleScript for set/get internal SP variables
*/
- (BOOL)application:(NSApplication *)sender delegateHandlesKey:(NSString *)key
{
NSLog(@"Not yet implemented.");
return NO;
}
/**
* AppleScript call to get the available documents.
*/
- (NSArray *)orderedDocuments
{
NSMutableArray *orderedDocuments = [NSMutableArray array];
for (NSWindow *aWindow in [self orderedWindows])
{
if ([[aWindow windowController] isMemberOfClass:[SPWindowController class]]) {
[orderedDocuments addObjectsFromArray:[[aWindow windowController] documents]];
}
}
return orderedDocuments;
}
/**
* AppleScript support for 'make new document'.
*
* TODO: following tab support this has been disabled - need to discuss reimplmenting vs syntax.
*/
- (void)insertInOrderedDocuments:(SPDatabaseDocument *)doc
{
[self newWindow:self];
// Set autoconnection if appropriate
if ([[NSUserDefaults standardUserDefaults] boolForKey:SPAutoConnectToDefault]) {
[[self frontDocument] connect];
}
}
/**
* AppleScript call to get the available windows.
*/
- (NSArray *)orderedWindows
{
return [NSApp orderedWindows];
}
/**
* AppleScript handler to quit Sequel Pro
*
* This handler is required to allow termination via the Dock or AppleScript event after activating it using AppleScript
*/
- (id)handleQuitScriptCommand:(NSScriptCommand *)command
{
[NSApp terminate:self];
return nil;
}
/**
* AppleScript open handler
*
* This handler is required to catch the 'open' command if no argument was passed which would cause a crash.
*/
- (id)handleOpenScriptCommand:(NSScriptCommand *)command
{
return nil;
}
/**
* AppleScript print handler
*
* This handler prints the active view.
*/
- (id)handlePrintScriptCommand:(NSScriptCommand *)command
{
SPDatabaseDocument *frontDoc = [self frontDocument];
if (frontDoc && ![frontDoc isWorking] && ![[frontDoc connectionID] isEqualToString:@"_"]) {
[frontDoc startPrintDocumentOperation];
}
return nil;
}
#pragma mark - SPWindowManagement
- (IBAction)newWindow:(id)sender
{
[self newWindow];
}
/**
* Create a new window, containing a single tab.
*/
- (SPWindowController *)newWindow
{
static NSPoint cascadeLocation = {.x = 0, .y = 0};
// Create a new window controller, and set up a new connection view within it.
SPWindowController *newWindowController = [[SPWindowController alloc] initWithWindowNibName:@"MainWindow"];
NSWindow *newWindow = [newWindowController window];
// Cascading defaults to on - retrieve the window origin automatically assigned by cascading,
// and convert to a top left point.
NSPoint topLeftPoint = [newWindow frame].origin;
topLeftPoint.y += [newWindow frame].size.height;
// The first window should use autosaving; subsequent windows should cascade.
// So attempt to set the frame autosave name; this will succeed for the very
// first window, and fail for others.
BOOL usedAutosave = [newWindow setFrameAutosaveName:@"DBView"];
if (!usedAutosave) {
[newWindow setFrameUsingName:@"DBView"];
}
// Add the connection view
[newWindowController addNewConnection];
// Cascade according to the statically stored cascade location.
cascadeLocation = [newWindow cascadeTopLeftFromPoint:cascadeLocation];
// Set the window controller as the window's delegate
[newWindow setDelegate:newWindowController];
// Show the window, and perform frontmost tasks again once the window has drawn
[newWindowController showWindow:self];
[[newWindowController selectedTableDocument] didBecomeActiveTabInWindow];
return newWindowController;
}
/**
* Create a new tab in the frontmost window.
*/
- (IBAction)newTab:(id)sender
{
SPWindowController *frontController = [self frontController];
// If no window was found, create a new one
if (!frontController) {
[self newWindow:self];
}
else {
if ([[frontController window] isMiniaturized]) {
[[frontController window] deminiaturize:self];
}
[frontController addNewConnection:self];
}
}
- (SPDatabaseDocument *)makeNewConnectionTabOrWindow
{
SPWindowController *frontController = [self frontController];
SPDatabaseDocument *frontDocument;
// If no window was found or the front most window has no tabs, create a new one
if (!frontController || [[frontController valueForKeyPath:@"tabView"] numberOfTabViewItems] == 1) {
frontController = [self newWindow];
frontDocument = [frontController selectedTableDocument];
}
// Open the spf file in a new tab if the tab bar is visible
else {
if ([[frontController window] isMiniaturized]) [[frontController window] deminiaturize:self];
frontDocument = [frontController addNewConnection];
}
return frontDocument;
}
/**
* Duplicate the current connection tab
*/
- (IBAction)duplicateTab:(id)sender
{
SPDatabaseDocument *theFrontDocument = [self frontDocument];
if (!theFrontDocument) return [self newTab:sender];
// Add a new tab to the window
if ([[self frontDocumentWindow] isMiniaturized]) {
[[self frontDocumentWindow] deminiaturize:self];
}
SPDatabaseDocument *newConnection = [[self frontController] addNewConnection];
// Get the state of the previously-frontmost document
NSDictionary *allStateDetails = @{
@"connection" : @YES,
@"history" : @YES,
@"session" : @YES,
@"query" : @YES,
@"password" : @YES
};
NSMutableDictionary *frontState = [NSMutableDictionary dictionaryWithDictionary:[theFrontDocument stateIncludingDetails:allStateDetails]];
// Ensure it's set to autoconnect
[frontState setObject:@YES forKey:@"auto_connect"];
// Set the connection on the new tab
[newConnection setState:frontState];
}
/**
* Retrieve the frontmost document window; returns nil if not found.
*/
- (NSWindow *)frontDocumentWindow
{
return [[self frontController] window];
}
- (SPWindowController *)frontController
{
for (NSWindow *aWindow in [NSApp orderedWindows]) {
id ctr = [aWindow windowController];
if ([ctr isMemberOfClass:[SPWindowController class]]) {
return ctr;
}
}
return nil;
}
/**
* When tab drags start, bring all the windows in front of other applications.
*/
- (void)tabDragStarted:(id)sender
{
[NSApp arrangeInFront:self];
}
#pragma mark -
- (void)dealloc

This file was deleted.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit d403528

Please sign in to comment.