diff options
author | mltownsend <mltownsend@gmail.com> | 2009-08-11 17:00:46 +0000 |
---|---|---|
committer | mltownsend <mltownsend@gmail.com> | 2009-08-11 17:00:46 +0000 |
commit | 80f757d7f217ae836f6c8de60134bc2a5d005687 (patch) | |
tree | 6969e36a3bd1f63227d67d2f2bdb224c36b1aeed /Source/TableDocument.m | |
parent | f6afd1e9699b891f1deee9058a1737e8c5744bd7 (diff) | |
download | sequelpro-80f757d7f217ae836f6c8de60134bc2a5d005687.tar.gz sequelpro-80f757d7f217ae836f6c8de60134bc2a5d005687.tar.bz2 sequelpro-80f757d7f217ae836f6c8de60134bc2a5d005687.zip |
User Manager feature
Diffstat (limited to 'Source/TableDocument.m')
-rw-r--r-- | Source/TableDocument.m | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/Source/TableDocument.m b/Source/TableDocument.m index 02212647..ee314b65 100644 --- a/Source/TableDocument.m +++ b/Source/TableDocument.m @@ -47,6 +47,7 @@ #import "SPPreferenceController.h" #import "SPPrintAccessory.h" #import "QLPreviewPanel.h" +#import "SPUserManager.h" // Used for printing #import "MGTemplateEngine.h" @@ -2174,7 +2175,15 @@ [toolbarItem setTarget:self]; [toolbarItem setAction:@selector(viewRelations:)]; - + } else if ([itemIdentifier isEqualToString:@"SwitchToUserManagerToolbarItemIdentifier"]) { + [toolbarItem setLabel:NSLocalizedString(@"Users", @"toolbar item label for switching to the User Manager tab")]; + [toolbarItem setPaletteLabel:NSLocalizedString(@"Users", @"toolbar item label for switching to the User Manager tab")]; + //set up tooltip and image + [toolbarItem setToolTip:NSLocalizedString(@"Switch to the User Manager tab", @"tooltip for toolbar item for switching to the User Manager tab")]; + [toolbarItem setImage:[NSImage imageNamed:NSImageNameEveryone]]; + //set up the target action + [toolbarItem setTarget:self]; + [toolbarItem setAction:@selector(showUserManager:)]; } else { //itemIdentifier refered to a toolbar item that is not provided or supported by us or cocoa toolbarItem = nil; @@ -2199,6 +2208,7 @@ @"SwitchToRunQueryToolbarItemIdentifier", @"SwitchToTableInfoToolbarItemIdentifier", @"SwitchToTableRelationsToolbarItemIdentifier", + @"SwitchToUserManagerToolbarItemIdentifier", NSToolbarCustomizeToolbarItemIdentifier, NSToolbarFlexibleSpaceItemIdentifier, NSToolbarSpaceItemIdentifier, @@ -2220,6 +2230,7 @@ @"SwitchToRunQueryToolbarItemIdentifier", NSToolbarFlexibleSpaceItemIdentifier, @"HistoryNavigationToolbarItemIdentifier", + @"SwitchToUserManagerToolbarItemIdentifier", @"ShowConsoleIdentifier", nil]; } @@ -2542,6 +2553,16 @@ if(queryEditorInitString) [queryEditorInitString release]; [super dealloc]; } + +- (void)showUserManager:(id)sender +{ + if (userManagerInstance == nil) + { + userManagerInstance = [[SPUserManager alloc] initWithConnection:mySQLConnection]; + } else { + [userManagerInstance show]; + } +} @end |