diff options
author | stuconnolly <stuart02@gmail.com> | 2012-03-18 20:05:36 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2012-03-18 20:05:36 +0000 |
commit | 524e8c356b4074f5be5933b0551374a130a8f6d1 (patch) | |
tree | 0dab40735f2d9484930050cd08376cbf15e4ea55 /Source/SPProcessListController.m | |
parent | be3263f8158cb6f3dfa1005f49beefa7e494b852 (diff) | |
download | sequelpro-524e8c356b4074f5be5933b0551374a130a8f6d1.tar.gz sequelpro-524e8c356b4074f5be5933b0551374a130a8f6d1.tar.bz2 sequelpro-524e8c356b4074f5be5933b0551374a130a8f6d1.zip |
Bring outline view branch up to date with trunk (r3471:r3517).
Diffstat (limited to 'Source/SPProcessListController.m')
-rw-r--r-- | Source/SPProcessListController.m | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/Source/SPProcessListController.m b/Source/SPProcessListController.m index 382940a1..c8e1f312 100644 --- a/Source/SPProcessListController.m +++ b/Source/SPProcessListController.m @@ -27,6 +27,7 @@ #import "SPDatabaseDocument.h" #import "SPAlertSheets.h" #import "SPAppController.h" +#import "SPMySQL.h" // Constants static NSString *SPKillProcessQueryMode = @"SPKillProcessQueryMode"; @@ -100,7 +101,7 @@ static NSString *SPTableViewIDColumnIdentifier = @"Id"; // Also, if available restore the table's column widths NSNumber *columnWidth = [[prefs objectForKey:SPProcessListTableColumnWidths] objectForKey:[[column headerCell] stringValue]]; - if (columnWidth) [column setWidth:[columnWidth doubleValue]]; + if (columnWidth) [column setWidth:[columnWidth floatValue]]; } // Register as an observer for the when the UseMonospacedFonts preference changes @@ -287,7 +288,7 @@ static NSString *SPTableViewIDColumnIdentifier = @"Id"; /** * Toggles the display of the process ID table column. */ -- (IBAction)toggleShowProcessID:(id)sender +- (IBAction)toggleShowProcessID:(NSMenuItem *)sender { [[processListTableView tableColumnWithIdentifier:SPTableViewIDColumnIdentifier] setHidden:([sender state])]; } @@ -295,7 +296,7 @@ static NSString *SPTableViewIDColumnIdentifier = @"Id"; /** * Toggles the display of the FULL process list. */ -- (IBAction)toggeleShowFullProcessList:(id)sender +- (IBAction)toggeleShowFullProcessList:(NSMenuItem *)sender { showFullProcessList = (!showFullProcessList); @@ -305,7 +306,7 @@ static NSString *SPTableViewIDColumnIdentifier = @"Id"; /** * Toggles whether or not auto refresh is enabled. */ -- (IBAction)toggleProcessListAutoRefresh:(id)sender +- (IBAction)toggleProcessListAutoRefresh:(NSButton *)sender { BOOL enable = [sender state]; @@ -690,18 +691,16 @@ static NSString *SPTableViewIDColumnIdentifier = @"Id"; // Get processes if ([connection isConnected]) { - MCPResult *processList = (showFullProcessList) ? [connection queryString:@"SHOW FULL PROCESSLIST"] : [connection listProcesses]; + SPMySQLResult *processList = (showFullProcessList) ? [connection queryString:@"SHOW FULL PROCESSLIST"] : [connection listProcesses]; [processList setReturnDataAsStrings:YES]; - - if ([processList numOfRows]) [processList dataSeek:0]; - + [processes removeAllObjects]; - for (i = 0; i < [processList numOfRows]; i++) + for (i = 0; i < [processList numberOfRows]; i++) { - //MCPKit currently returns numbers as NSString, which will break sorting of numbers in this case. - NSMutableDictionary *rowsFixed = [[processList fetchRowAsDictionary] mutableCopy]; + //SPMySQL.framewokr currently returns numbers as NSString, which will break sorting of numbers in this case. + NSMutableDictionary *rowsFixed = [[processList getRowAsDictionary] mutableCopy]; id idColumn = [rowsFixed objectForKey:@"Id"]; //Id is a signed int(11) - this is a signed 32 bit int value @@ -742,7 +741,7 @@ static NSString *SPTableViewIDColumnIdentifier = @"Id"; // Check for errors if ([connection queryErrored]) { SPBeginAlertSheet(NSLocalizedString(@"Unable to kill query", @"error killing query message"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [self window], self, nil, nil, - [NSString stringWithFormat:NSLocalizedString(@"An error occured while attempting to kill the query associated with connection %lu.\n\nMySQL said: %@", @"error killing query informative message"), (unsigned long)processId, [connection getLastErrorMessage]]); + [NSString stringWithFormat:NSLocalizedString(@"An error occured while attempting to kill the query associated with connection %lu.\n\nMySQL said: %@", @"error killing query informative message"), (unsigned long)processId, [connection lastErrorMessage]]); } // Refresh the process list @@ -760,7 +759,7 @@ static NSString *SPTableViewIDColumnIdentifier = @"Id"; // Check for errors if ([connection queryErrored]) { SPBeginAlertSheet(NSLocalizedString(@"Unable to kill connection", @"error killing connection message"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [self window], self, nil, nil, - [NSString stringWithFormat:NSLocalizedString(@"An error occured while attempting to kill connection %lu.\n\nMySQL said: %@", @"error killing query informative message"), (unsigned long)processId, [connection getLastErrorMessage]]); + [NSString stringWithFormat:NSLocalizedString(@"An error occured while attempting to kill connection %lu.\n\nMySQL said: %@", @"error killing query informative message"), (unsigned long)processId, [connection lastErrorMessage]]); } // Refresh the process list |