aboutsummaryrefslogtreecommitdiffstats
path: root/Source/TableDocument.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/TableDocument.m')
-rw-r--r--Source/TableDocument.m23
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