diff options
author | stuconnolly <stuart02@gmail.com> | 2012-05-02 13:12:38 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2012-05-02 13:12:38 +0000 |
commit | 5d87f0f50fc90c7ed47ff82b35f07b2749262132 (patch) | |
tree | 37ab959b7385c8f5aaf2d1465e1f19fbd47247c7 /Source/SPConnectionController.h | |
parent | dea294a90f9bf6017986f9c950991a7fc7c9645e (diff) | |
parent | fe555b6d511a51f3bdfb5c0a2b00a3206993076b (diff) | |
download | sequelpro-5d87f0f50fc90c7ed47ff82b35f07b2749262132.tar.gz sequelpro-5d87f0f50fc90c7ed47ff82b35f07b2749262132.tar.bz2 sequelpro-5d87f0f50fc90c7ed47ff82b35f07b2749262132.zip |
Merge outline view branch into trunk.
Adds support for managing and grouping favorites into folders in the connection view and removes the associated favorites management from the preferences window.
NOTE: On first launch your connection favorites will be migrated from Sequel Pro's preference file to a new file in ~/Application Support/Sequel Pro/Data. Your old favorites will remain in the preference file until removed in a future version.
Outstanding known issues:
- Removing a group node with no child favorites presents a warning about also removing the non-existent favorites.
- Starting the application with no favorites, creating a group node then selecting, hides the connection details input. Doesn't support emoty selection.
- Setting the name of a connection, adding it to the favorites and then swicthing to a different connection type, screws with the favorite name.
- The preservation between launches of whether group nodes are collapsed or not is currently not supported.
Diffstat (limited to 'Source/SPConnectionController.h')
-rw-r--r-- | Source/SPConnectionController.h | 130 |
1 files changed, 74 insertions, 56 deletions
diff --git a/Source/SPConnectionController.h b/Source/SPConnectionController.h index bc593685..eeb7f2d0 100644 --- a/Source/SPConnectionController.h +++ b/Source/SPConnectionController.h @@ -27,12 +27,18 @@ #import <SPMySQL/SPMySQLConnectionDelegate.h> #ifndef SP_REFACTOR /* headers */ -#import "SPFavoritesOutlineView.h" #endif -@class SPDatabaseDocument, SPSSHTunnel, SPKeychain, SPMySQLConnection +@class SPDatabaseDocument, + SPFavoritesController, + SPSSHTunnel, + SPTreeNode, + SPFavoritesOutlineView, + SPMySQLConnection #ifndef SP_REFACTOR /* class decl */ -, BWAnchoredButtonBar, SPFavoriteNode + ,SPKeychain, + BWAnchoredButtonBar, + SPFavoriteNode #endif ; @@ -44,36 +50,31 @@ @end -@interface SPFlippedView : NSView - -- (BOOL)isFlipped; - -@end #endif @interface SPConnectionController : NSViewController <SPMySQLConnectionDelegate> { id <SPConnectionControllerDelegateProtocol, NSObject> delegate; - SPDatabaseDocument *tableDocument; + SPDatabaseDocument *dbDocument; + SPSSHTunnel *sshTunnel; + SPMySQLConnection *mySQLConnection; + #ifndef SP_REFACTOR /* ivars */ + SPKeychain *keychain; NSView *databaseConnectionSuperview; NSSplitView *databaseConnectionView; NSOpenPanel *keySelectionPanel; #endif - SPKeychain *keychain; NSUserDefaults *prefs; -#ifndef SP_REFACTOR NSMutableArray *favorites; -#endif - SPSSHTunnel *sshTunnel; - SPMySQLConnection *mySQLConnection; + #ifndef SP_REFACTOR /* ivars */ BOOL automaticFavoriteSelection; -#endif BOOL cancellingConnection; BOOL isConnecting; -#ifndef SP_REFACTOR /* ivars */ + + // Standard details NSInteger previousType; #endif NSInteger type; @@ -84,37 +85,39 @@ NSString *database; NSString *socket; NSString *port; - int useSSL; - int sslKeyFileLocationEnabled; + + // SSL details + NSInteger useSSL; + NSInteger sslKeyFileLocationEnabled; NSString *sslKeyFileLocation; - int sslCertificateFileLocationEnabled; + NSInteger sslCertificateFileLocationEnabled; NSString *sslCertificateFileLocation; - int sslCACertFileLocationEnabled; + NSInteger sslCACertFileLocationEnabled; NSString *sslCACertFileLocation; + + // SSH details NSString *sshHost; NSString *sshUser; NSString *sshPassword; - int sshKeyLocationEnabled; + NSInteger sshKeyLocationEnabled; NSString *sshKeyLocation; NSString *sshPort; -#ifndef SP_REFACTOR /* ivars */ - @private NSString *favoritesPBoardType; -#endif NSString *connectionKeychainID; NSString *connectionKeychainItemName; +#ifndef SP_REFACTOR /* ivars */ NSString *connectionKeychainItemAccount; NSString *connectionSSHKeychainItemName; NSString *connectionSSHKeychainItemAccount; -#ifndef SP_REFACTOR /* ivars */ NSMutableArray *nibObjectsToRelease; IBOutlet NSView *connectionView; IBOutlet NSSplitView *connectionSplitView; IBOutlet NSScrollView *connectionDetailsScrollView; + IBOutlet NSTextField *connectionInstructionsTextField; IBOutlet BWAnchoredButtonBar *connectionSplitViewButtonBar; - IBOutlet SPFavoritesOutlineView *favoritesTable; + IBOutlet SPFavoritesOutlineView *favoritesOutlineView; IBOutlet NSWindow *errorDetailWindow; IBOutlet NSTextView *errorDetailText; @@ -130,8 +133,14 @@ IBOutlet NSView *sslCertificateLocationHelp; IBOutlet NSView *sslCACertLocationHelp; + IBOutlet NSTextField *standardNameField; + IBOutlet NSTextField *sshNameField; + IBOutlet NSTextField *socketNameField; IBOutlet NSTextField *standardSQLHostField; IBOutlet NSTextField *sshSQLHostField; + IBOutlet NSTextField *standardUserField; + IBOutlet NSTextField *socketUserField; + IBOutlet NSTextField *sshUserField; IBOutlet NSSecureTextField *standardPasswordField; IBOutlet NSSecureTextField *socketPasswordField; IBOutlet NSSecureTextField *sshPasswordField; @@ -150,15 +159,22 @@ IBOutlet NSProgressIndicator *progressIndicator; IBOutlet NSTextField *progressIndicatorText; IBOutlet NSMenuItem *favoritesSortByMenuItem; + IBOutlet NSView *exportPanelAccessoryView; + BOOL isEditing; BOOL reverseFavoritesSort; #endif - BOOL mySQLConnectionCancelled; + BOOL favoriteNameFieldWasTouched; + #ifndef SP_REFACTOR /* ivars */ - SPFavoritesSortItem previousSortItem, currentSortItem; + NSArray *draggedNodes; + NSImage *folderImage; - SPFavoriteNode *favoritesRoot; + SPTreeNode *favoritesRoot; + SPFavoriteNode *currentFavorite; + SPFavoritesController *favoritesController; + SPFavoritesSortItem previousSortItem, currentSortItem; #endif } @@ -171,64 +187,66 @@ @property (readwrite, retain) NSString *database; @property (readwrite, retain) NSString *socket; @property (readwrite, retain) NSString *port; -@property (readwrite, assign) int useSSL; -@property (readwrite, assign) int sslKeyFileLocationEnabled; +@property (readwrite, assign) NSInteger useSSL; +@property (readwrite, assign) NSInteger sslKeyFileLocationEnabled; @property (readwrite, retain) NSString *sslKeyFileLocation; -@property (readwrite, assign) int sslCertificateFileLocationEnabled; +@property (readwrite, assign) NSInteger sslCertificateFileLocationEnabled; @property (readwrite, retain) NSString *sslCertificateFileLocation; -@property (readwrite, assign) int sslCACertFileLocationEnabled; +@property (readwrite, assign) NSInteger sslCACertFileLocationEnabled; @property (readwrite, retain) NSString *sslCACertFileLocation; @property (readwrite, retain) NSString *sshHost; @property (readwrite, retain) NSString *sshUser; @property (readwrite, retain) NSString *sshPassword; -@property (readwrite, assign) int sshKeyLocationEnabled; +@property (readwrite, assign) NSInteger sshKeyLocationEnabled; @property (readwrite, retain) NSString *sshKeyLocation; @property (readwrite, retain) NSString *sshPort; +#ifndef SP_REFACTOR /* ivars */ + @property (readwrite, retain) NSString *connectionKeychainItemName; @property (readwrite, retain) NSString *connectionKeychainItemAccount; @property (readwrite, retain) NSString *connectionSSHKeychainItemName; @property (readwrite, retain) NSString *connectionSSHKeychainItemAccount; - -@property (readonly, assign) BOOL isConnecting; -#ifndef SP_REFACTOR /* ivars */ -@property (readonly, assign) NSString *favoritesPBoardType; #endif -- (id)initWithDocument:(SPDatabaseDocument *)theTableDocument; +@property (readonly, assign) BOOL isConnecting; // Connection processes - (IBAction)initiateConnection:(id)sender; +#ifndef SP_REFACTOR /* method decls */ - (IBAction)cancelMySQLConnection:(id)sender; -- (void)initiateSSHTunnelConnection; -- (void)sshTunnelCallback:(SPSSHTunnel *)theTunnel; -- (void)initiateMySQLConnection; -- (void)cancelConnection; -- (void)failConnectionWithTitle:(NSString *)theTitle errorMessage:(NSString *)theErrorMessage detail:(NSString *)errorDetail; -- (void)addConnectionToDocument; // Interface interaction -- (IBAction)chooseKeyLocation:(NSButton *)sender; -#ifndef SP_REFACTOR /* method decls */ -- (IBAction)editFavorites:(id)sender; +- (IBAction)nodeDoubleClicked:(id)sender; +- (IBAction)chooseKeyLocation:(id)sender; - (IBAction)showHelp:(id)sender; - (IBAction)updateSSLInterface:(id)sender; - (IBAction)updateKeyLocationFileVisibility:(id)sender; - (void)resizeTabViewToConnectionType:(NSUInteger)theType animating:(BOOL)animate; - (IBAction)sortFavorites:(id)sender; - (IBAction)reverseSortFavorites:(NSMenuItem *)sender; -#endif -// Connection details interaction -- (BOOL)checkHost; +- (void)resizeTabViewToConnectionType:(NSUInteger)theType animating:(BOOL)animate; -#ifndef SP_REFACTOR // Favorites interaction -- (void)updateFavorites; - (void)updateFavoriteSelection:(id)sender; -- (id)selectedFavorite; -- (IBAction)addFavorite:(id)sender; +- (NSMutableDictionary *)selectedFavorite; +- (SPTreeNode *)selectedFavoriteNode; +- (NSArray *)selectedFavoriteNodes; -- (void)scrollViewFrameChanged:(NSNotification *)aNotification; +- (IBAction)addFavorite:(id)sender; +- (IBAction)addFavoriteUsingCurrentDetails:(id)sender; +- (IBAction)addGroup:(id)sender; +- (IBAction)removeNode:(id)sender; +- (IBAction)duplicateFavorite:(id)sender; +- (IBAction)renameNode:(id)sender; +- (IBAction)makeSelectedFavoriteDefault:(id)sender; + +// Import/export favorites +- (IBAction)importFavorites:(id)sender; +- (IBAction)exportFavorites:(id)sender; + +// Accessors +- (SPFavoritesOutlineView *)favoritesOutlineView; #endif @end |