From 9cbae0171595e4afbd6109098b89f1922c623827 Mon Sep 17 00:00:00 2001 From: mltownsend Date: Tue, 11 Aug 2009 20:45:28 +0000 Subject: Fix some MainMenu references by index. --- Source/TableDocument.m | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'Source/TableDocument.m') diff --git a/Source/TableDocument.m b/Source/TableDocument.m index ee314b65..523031cd 100644 --- a/Source/TableDocument.m +++ b/Source/TableDocument.m @@ -194,6 +194,14 @@ [tableDataInstance setConnection:mySQLConnection]; [extendedTableInfoInstance setConnection:mySQLConnection]; [databaseDataInstance setConnection:mySQLConnection]; + if (userManagerInstance == nil) + { + userManagerInstance = [[SPUserManager alloc] initWithConnection:mySQLConnection]; + } + else + { + [userManagerInstance setConnection:mySQLConnection]; + } // Set the cutom query editor's MySQL version [customQueryInstance setMySQLversion:mySQLVersion]; @@ -679,7 +687,7 @@ // Get the menu item for showing and hiding the console. This is isn't the best way to get it as any // changes to the menu structure will result in the wrong item being selected. - NSMenuItem *menuItem = [[[[NSApp mainMenu] itemAtIndex:3] submenu] itemAtIndex:5]; + NSMenuItem *menuItem = [[[[NSApp mainMenu] itemWithTitle:@"View"] submenu] itemAtIndex:5]; // Only update the menu item title if its the menu item and not the toolbar [menuItem setTitle:(!isConsoleVisible) ? NSLocalizedString(@"Hide Console", @"Hide Console") : NSLocalizedString(@"Show Console", @"Show Console")]; @@ -2551,6 +2559,7 @@ if (mySQLVersion) [mySQLVersion release]; [allDatabases release]; if(queryEditorInitString) [queryEditorInitString release]; + if(userManagerInstance) [userManagerInstance release]; [super dealloc]; } @@ -2559,9 +2568,9 @@ if (userManagerInstance == nil) { userManagerInstance = [[SPUserManager alloc] initWithConnection:mySQLConnection]; - } else { - [userManagerInstance show]; } + + [userManagerInstance show]; } @end -- cgit v1.2.3