diff options
author | rowanbeentje <rowan@beent.je> | 2009-07-06 01:39:07 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2009-07-06 01:39:07 +0000 |
commit | 9ce12fd67f2b200cdb25dec7f70b724f4c8887e1 (patch) | |
tree | 2d54172365eccc3dc3a0329394fb979fa981ed65 /Source/TableDocument.h | |
parent | bd188daad56fcf518665e6b3617aebe4d6708667 (diff) | |
download | sequelpro-9ce12fd67f2b200cdb25dec7f70b724f4c8887e1.tar.gz sequelpro-9ce12fd67f2b200cdb25dec7f70b724f4c8887e1.tar.bz2 sequelpro-9ce12fd67f2b200cdb25dec7f70b724f4c8887e1.zip |
Overhaul the connection screen:
- Replace the connection sheet with a new connection view
- Provide a tab-based selection system for Standard, Socket, and SSH connections, and show only the necessary fields. This resolves Issue #50.
- Detect when "localhost" is used in error and alert the user (also to address Issue #50)
- Update favorite editing to match connection view
- Move connection methods to a new connection controller and tidy up TableDocument
Diffstat (limited to 'Source/TableDocument.h')
-rw-r--r-- | Source/TableDocument.h | 71 |
1 files changed, 11 insertions, 60 deletions
diff --git a/Source/TableDocument.h b/Source/TableDocument.h index e8702648..4816b4a3 100644 --- a/Source/TableDocument.h +++ b/Source/TableDocument.h @@ -28,9 +28,8 @@ #import <Cocoa/Cocoa.h> #import <MCPKit_bundled/MCPKit_bundled.h> #import <WebKit/WebKit.h> -#import "SPSSHTunnel.h" -@class CMMCPConnection, CMMCPResult; +@class CMMCPConnection, CMMCPResult, SPConnectionController; /** * The TableDocument class controls the primary database view window. @@ -38,7 +37,6 @@ @interface TableDocument : NSDocument { // IBOutlets - IBOutlet id keyChainInstance; IBOutlet id tablesListInstance; IBOutlet id tableSourceInstance; IBOutlet id tableContentInstance; @@ -56,31 +54,12 @@ IBOutlet id titleImageView; IBOutlet id titleStringView; - IBOutlet id connectSheet; IBOutlet id databaseSheet; IBOutlet id variablesSheet; IBOutlet id queryProgressBar; IBOutlet id favoritesButton; - IBOutlet NSTableView *connectFavoritesTableView; - IBOutlet NSArrayController *favoritesController; - IBOutlet id nameField; - IBOutlet id hostField; - IBOutlet id socketField; - IBOutlet id userField; - IBOutlet id passwordField; - IBOutlet id portField; - IBOutlet id databaseField; - IBOutlet id sshCheckbox; - IBOutlet id sshHostField; - IBOutlet id sshUserField; - IBOutlet id sshPasswordField; - IBOutlet id sshPortField; - IBOutlet NSWindow *errorDetailWindow; - IBOutlet NSTextView *errorDetailText; - - IBOutlet NSProgressIndicator *connectProgressBar; - IBOutlet NSTextField *connectProgressStatusText; + IBOutlet id databaseNameField; IBOutlet id databaseEncodingButton; IBOutlet id addDatabaseButton; @@ -101,24 +80,21 @@ IBOutlet id syntaxViewContent; IBOutlet NSWindow *createTableSyntaxWindow; + SPConnectionController *connectionController; + CMMCPConnection *mySQLConnection; - SPSSHTunnel *sshTunnel; NSArray *variables; NSString *selectedDatabase; NSString *mySQLVersion; NSUserDefaults *prefs; - NSString *connectionKeychainItemName; - NSString *connectionKeychainItemAccount; - NSString *connectionSSHKeychainItemName; - NSString *connectionSSHKeychainItemAccount; - NSMenu *selectEncodingMenu; BOOL _supportsEncoding; NSString *_encoding; BOOL _encodingViaLatin1; BOOL _shouldOpenConnectionAutomatically; + BOOL _isConnected; NSToolbar *mainToolbar; NSToolbarItem *chooseDatabaseToolbarItem; @@ -126,35 +102,12 @@ WebView *printWebView; } -//start sheet -- (void)setShouldAutomaticallyConnect:(BOOL)shouldAutomaticallyConnect; -- (IBAction)connectToDB:(id)sender; -- (IBAction)initiateConnection:(id)sender; -- (void)initiateSSHTunnelConnection; -- (void)sshTunnelCallback:(SPSSHTunnel *)theTunnel; -- (void)initiateMySQLConnection; -- (void)failConnectionWithErrorMessage:(NSString *)theErrorMessage withDetail:(NSString *)errorDetail; -- (IBAction)cancelConnectSheet:(id)sender; -- (IBAction)closeSheet:(id)sender; -- (IBAction)chooseFavorite:(id)sender; -- (IBAction)toggleUseSSH:(id)sender; -- (IBAction)editFavorites:(id)sender; -- (id)selectedFavorite; -- (void)connectSheetAddToFavorites:(id)sender; -- (void)addToFavoritesName:(NSString *)name host:(NSString *)host socket:(NSString *)socket - user:(NSString *)user password:(NSString *)password - port:(NSString *)port database:(NSString *)database - useSSH:(BOOL)useSSH // no-longer in use - sshHost:(NSString *)sshHost // no-longer in use - sshUser:(NSString *)sshUser // no-longer in use - sshPassword:(NSString *)sshPassword // no-longer in use - sshPort:(NSString *)sshPort; // no-longer in use -- (IBAction)connectSheetShowHelp:(id)sender; - - (NSString *)getHTMLforPrint; -//connection getter -- (CMMCPConnection *)sharedConnection; +// Connection callback and methods +- (void) setConnection:(CMMCPConnection *)theConnection; +- (void)setShouldAutomaticallyConnect:(BOOL)shouldAutomaticallyConnect; +- (BOOL)shouldAutomaticallyConnect; //database methods - (IBAction)setDatabases:(id)sender; @@ -207,7 +160,6 @@ - (void)willPerformQuery:(NSNotification *)notification; - (void)hasPerformedQuery:(NSNotification *)notification; - (void)applicationWillTerminate:(NSNotification *)notification; -- (void)tunnelStatusChanged:(NSNotification *)notification; //menu methods - (BOOL)validateMenuItem:(NSMenuItem *)anItem; @@ -239,7 +191,6 @@ - (void)willQueryString:(NSString *)query; - (void)queryGaveError:(NSString *)error; -@end +- (IBAction)closeSheet:(id)sender; -extern NSString *TableDocumentFavoritesControllerSelectionIndexDidChange; -extern NSString *TableDocumentFavoritesControllerFavoritesDidChange; +@end |