aboutsummaryrefslogtreecommitdiffstats
path: root/Source/TableDocument.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2009-11-12 23:44:09 +0000
committerstuconnolly <stuart02@gmail.com>2009-11-12 23:44:09 +0000
commita5af1bc73e296ff0b545310782a446259d896389 (patch)
tree82165af1afe69187bafd3e96c8b6e9bb41b4700b /Source/TableDocument.m
parent64010e52c3f4bcec585b7fb2494ccf38a481b5f6 (diff)
downloadsequelpro-a5af1bc73e296ff0b545310782a446259d896389.tar.gz
sequelpro-a5af1bc73e296ff0b545310782a446259d896389.tar.bz2
sequelpro-a5af1bc73e296ff0b545310782a446259d896389.zip
- New server processes panel, accessible via the 'Database' menu and alt+cmd+P. Includes the ability to kill queries and connections as well as live filtering support and the ability to save all processes or the current filtered set to a file. Implements issue #458.
- Reorganise 'Database' menu. - Give 'Flush Privileges' key equivalent of shift+cmd+F.
Diffstat (limited to 'Source/TableDocument.m')
-rw-r--r--Source/TableDocument.m36
1 files changed, 32 insertions, 4 deletions
diff --git a/Source/TableDocument.m b/Source/TableDocument.m
index b8071060..683d6237 100644
--- a/Source/TableDocument.m
+++ b/Source/TableDocument.m
@@ -52,6 +52,7 @@
#import "SPEncodingPopupAccessory.h"
#import "SPConstants.h"
#import "YRKSpinningProgressIndicator.h"
+#import "SPProcessListController.h"
// Printing
#import "MGTemplateEngine.h"
@@ -166,8 +167,12 @@
// Set the connection controller's delegate
[connectionController setDelegate:self];
+
+ // Set the server variables table view's vertical gridlines if required
+ [variablesTableView setGridStyleMask:([[NSUserDefaults standardUserDefaults] boolForKey:SPDisplayTableViewVerticalGridlines]) ? NSTableViewSolidVerticalGridLineMask : NSTableViewGridNone];
// Register observers for when the DisplayTableViewVerticalGridlines preference changes
+ [prefs addObserver:self forKeyPath:SPDisplayTableViewVerticalGridlines options:NSKeyValueObservingOptionNew context:NULL];
[prefs addObserver:tableSourceInstance forKeyPath:SPDisplayTableViewVerticalGridlines options:NSKeyValueObservingOptionNew context:NULL];
[prefs addObserver:tableContentInstance forKeyPath:SPDisplayTableViewVerticalGridlines options:NSKeyValueObservingOptionNew context:NULL];
[prefs addObserver:customQueryInstance forKeyPath:SPDisplayTableViewVerticalGridlines options:NSKeyValueObservingOptionNew context:NULL];
@@ -1046,6 +1051,23 @@
}
/**
+ * Displays the database process list sheet.
+ */
+- (IBAction)showDatabaseProcessList:(id)sender
+{
+ if (!processListController) {
+ processListController = [[SPProcessListController alloc] init];
+
+ [processListController setConnection:mySQLConnection];
+
+ // Register to obeserve table view vertical grid line pref changes
+ [prefs addObserver:processListController forKeyPath:SPDisplayTableViewVerticalGridlines options:NSKeyValueObservingOptionNew context:NULL];
+ }
+
+ [processListController displayProcessListSheetAttachedToWindow:tableWindow];
+}
+
+/**
* Returns an array of all available database names
*/
- (NSArray *)allDatabaseNames
@@ -2015,7 +2037,7 @@
// If it was the server variables sheet that was closed release the relevant arrays if necessary
if ([sender window] == variablesSheet) {
- // If the filtered array is allocated and its not a reference to the variables array get rid of it
+ // If the filtered array is allocated and it's not a reference to the variables array get rid of it
if ((variablesFiltered) && (variablesFiltered != variables)) {
[variablesFiltered release], variablesFiltered = nil;
}
@@ -2168,6 +2190,9 @@
if ([keyPath isEqualToString:SPConsoleEnableLogging]) {
[mySQLConnection setDelegateQueryLogging:[[change objectForKey:NSKeyValueChangeNewKey] boolValue]];
}
+ else if ([keyPath isEqualToString:SPDisplayTableViewVerticalGridlines]) {
+ [variablesTableView setGridStyleMask:([[change objectForKey:NSKeyValueChangeNewKey] boolValue]) ? NSTableViewSolidVerticalGridLineMask : NSTableViewGridNone];
+ }
}
/*
@@ -3599,7 +3624,7 @@
}
#pragma mark -
-#pragma mark
+#pragma mark Connection controller delegate methods
/**
* Invoked by the connection controller when it starts the process of initiating a connection.
@@ -3620,7 +3645,7 @@
}
#pragma mark -
-#pragma mark Database name field delegate methods
+#pragma mark Text field delegate methods
/**
* When adding a database, enable the button only if the new name has a length.
@@ -3717,12 +3742,15 @@
#pragma mark -
+/**
+ * Dealloc
+ */
- (void)dealloc
{
-
[_encoding release];
[printWebView release];
if (connectionController) [connectionController release];
+ if (processListController) [processListController release];
if (mySQLConnection) [mySQLConnection release];
if (variables) [variables release];
if (selectedDatabase) [selectedDatabase release];