aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStuart Connolly <stuart02@gmail.com>2014-08-28 19:08:14 +0100
committerStuart Connolly <stuart02@gmail.com>2014-08-28 19:08:14 +0100
commit310fb079c75d551bf2a129b69c897905ca83e061 (patch)
treeae163e957f6e43c49fef9014a96f8cab7b99cbfa
parente3c342d623b24a55215fadb3b7c72f80df303e83 (diff)
downloadsequelpro-310fb079c75d551bf2a129b69c897905ca83e061.tar.gz
sequelpro-310fb079c75d551bf2a129b69c897905ca83e061.tar.bz2
sequelpro-310fb079c75d551bf2a129b69c897905ca83e061.zip
Resolve #1938: In the query console display the database the query was executed in.
-rw-r--r--Interfaces/English.lproj/Console.xib391
-rw-r--r--Resources/Plists/PreferenceDefaults.plist2
-rw-r--r--Source/SPConnectionDelegate.m40
-rw-r--r--Source/SPConsoleMessage.h12
-rw-r--r--Source/SPConsoleMessage.m9
-rw-r--r--Source/SPConstants.h1
-rw-r--r--Source/SPConstants.m1
-rw-r--r--Source/SPQueryConsoleDataSource.m10
-rw-r--r--Source/SPQueryController.h24
-rw-r--r--Source/SPQueryController.m52
-rw-r--r--Source/SPQueryControllerInitializer.m1
-rw-r--r--Source/SPTableContent.m8
12 files changed, 448 insertions, 103 deletions
diff --git a/Interfaces/English.lproj/Console.xib b/Interfaces/English.lproj/Console.xib
index 85f0063a..be2de0da 100644
--- a/Interfaces/English.lproj/Console.xib
+++ b/Interfaces/English.lproj/Console.xib
@@ -2,13 +2,13 @@
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1060</int>
- <string key="IBDocument.SystemVersion">13B3116</string>
- <string key="IBDocument.InterfaceBuilderVersion">4514</string>
- <string key="IBDocument.AppKitVersion">1265</string>
- <string key="IBDocument.HIToolboxVersion">696.00</string>
+ <string key="IBDocument.SystemVersion">13E28</string>
+ <string key="IBDocument.InterfaceBuilderVersion">5056</string>
+ <string key="IBDocument.AppKitVersion">1265.21</string>
+ <string key="IBDocument.HIToolboxVersion">698.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string key="NS.object.0">4514</string>
+ <string key="NS.object.0">5056</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>NSButton</string>
@@ -63,7 +63,7 @@
<nil key="NSUserInterfaceItemIdentifier"/>
<string key="NSWindowContentMinSize">{575, 130}</string>
<object class="NSView" key="NSWindowView" id="215475093">
- <nil key="NSNextResponder"/>
+ <reference key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="NSImageView" id="919154377">
@@ -79,6 +79,8 @@
</set>
<string key="NSFrame">{{62, 0}, {513, 23}}</string>
<reference key="NSSuperview" ref="215475093"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="301104034"/>
<bool key="NSEnabled">YES</bool>
<object class="NSImageCell" key="NSCell" id="127533557">
<int key="NSCellFlags">134217728</int>
@@ -100,6 +102,8 @@
<int key="NSvFlags">289</int>
<string key="NSFrame">{{399, 2}, {166, 17}}</string>
<reference key="NSSuperview" ref="215475093"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="95087038">
<int key="NSCellFlags">67108864</int>
@@ -125,6 +129,8 @@
<int key="NSvFlags">266</int>
<string key="NSFrame">{{10, 174}, {531, 19}}</string>
<reference key="NSSuperview" ref="215475093"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="223792049"/>
<bool key="NSEnabled">YES</bool>
<object class="NSSearchFieldCell" key="NSCell" id="220914667">
<int key="NSCellFlags">342884416</int>
@@ -203,6 +209,8 @@
<int key="NSvFlags">256</int>
<string key="NSFrameSize">{576, 126}</string>
<reference key="NSSuperview" ref="264199078"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="464398489"/>
<bool key="NSEnabled">YES</bool>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
<bool key="NSControlAllowsExpansionToolTips">YES</bool>
@@ -211,6 +219,8 @@
<int key="NSvFlags">256</int>
<string key="NSFrameSize">{576, 17}</string>
<reference key="NSSuperview" ref="486423323"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="264199078"/>
<reference key="NSTableView" ref="243353733"/>
</object>
<object class="_NSCornerView" key="NSCornerView">
@@ -292,11 +302,37 @@
<bool key="NSIsResizeable">YES</bool>
<reference key="NSTableView" ref="243353733"/>
</object>
- <object class="NSTableColumn" id="781897583">
+ <object class="NSTableColumn" id="171952907">
+ <string key="NSIdentifier">messageDatabase</string>
+ <double key="NSWidth">64</double>
+ <double key="NSMinWidth">50</double>
+ <double key="NSMaxWidth">1000</double>
+ <object class="NSTableHeaderCell" key="NSHeaderCell">
+ <int key="NSCellFlags">75497536</int>
+ <int key="NSCellFlags2">2048</int>
+ <string key="NSContents">Database</string>
+ <reference key="NSSupport" ref="26"/>
+ <reference key="NSBackgroundColor" ref="170782334"/>
+ <reference key="NSTextColor" ref="489725497"/>
+ </object>
+ <object class="NSTextFieldCell" key="NSDataCell" id="83483769">
+ <int key="NSCellFlags">337641536</int>
+ <int key="NSCellFlags2">133120</int>
+ <string key="NSContents">Text Cell</string>
+ <reference key="NSSupport" ref="26"/>
+ <reference key="NSControlView" ref="243353733"/>
+ <reference key="NSBackgroundColor" ref="357371173"/>
+ <reference key="NSTextColor" ref="22056724"/>
+ </object>
+ <int key="NSResizingMask">3</int>
+ <bool key="NSIsResizeable">YES</bool>
+ <reference key="NSTableView" ref="243353733"/>
+ </object>
+ <object class="NSTableColumn" id="871689097">
<string key="NSIdentifier">message</string>
- <double key="NSWidth">367</double>
- <double key="NSMinWidth">10</double>
- <double key="NSMaxWidth">10000</double>
+ <double key="NSWidth">300</double>
+ <double key="NSMinWidth">50</double>
+ <double key="NSMaxWidth">3.4028234663852886e+38</double>
<object class="NSTableHeaderCell" key="NSHeaderCell">
<int key="NSCellFlags">75497536</int>
<int key="NSCellFlags2">2048</int>
@@ -305,16 +341,16 @@
<reference key="NSBackgroundColor" ref="170782334"/>
<reference key="NSTextColor" ref="489725497"/>
</object>
- <object class="NSTextFieldCell" key="NSDataCell" id="973993322">
- <int key="NSCellFlags">67108928</int>
- <int key="NSCellFlags2">133376</int>
+ <object class="NSTextFieldCell" key="NSDataCell" id="855432522">
+ <int key="NSCellFlags">337641536</int>
+ <int key="NSCellFlags2">133120</int>
<string key="NSContents">Text Cell</string>
<reference key="NSSupport" ref="26"/>
<reference key="NSControlView" ref="243353733"/>
<reference key="NSBackgroundColor" ref="357371173"/>
<reference key="NSTextColor" ref="22056724"/>
</object>
- <int key="NSResizingMask">1</int>
+ <int key="NSResizingMask">3</int>
<bool key="NSIsResizeable">YES</bool>
<reference key="NSTableView" ref="243353733"/>
</object>
@@ -345,16 +381,33 @@
</array>
<string key="NSFrame">{{1, 17}, {576, 126}}</string>
<reference key="NSSuperview" ref="865703622"/>
+ <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="243353733"/>
<reference key="NSDocView" ref="243353733"/>
<reference key="NSBGColor" ref="357371173"/>
<int key="NScvFlags">4</int>
</object>
+ <object class="NSClipView" id="486423323">
+ <reference key="NSNextResponder" ref="865703622"/>
+ <int key="NSvFlags">2338</int>
+ <array class="NSMutableArray" key="NSSubviews">
+ <reference ref="1007693691"/>
+ </array>
+ <string key="NSFrame">{{1, 0}, {576, 17}}</string>
+ <reference key="NSSuperview" ref="865703622"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="1007693691"/>
+ <reference key="NSDocView" ref="1007693691"/>
+ <reference key="NSBGColor" ref="357371173"/>
+ <int key="NScvFlags">4</int>
+ </object>
<object class="NSScroller" id="464398489">
<reference key="NSNextResponder" ref="865703622"/>
<int key="NSvFlags">-2147483392</int>
<string key="NSFrame">{{539, 1}, {15, 124}}</string>
<reference key="NSSuperview" ref="865703622"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="688790145"/>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
<reference key="NSTarget" ref="865703622"/>
<string key="NSAction">_doScroller:</string>
@@ -363,32 +416,22 @@
<object class="NSScroller" id="444118053">
<reference key="NSNextResponder" ref="865703622"/>
<int key="NSvFlags">-2147483392</int>
- <string key="NSFrame">{{-100, -100}, {238, 15}}</string>
+ <string key="NSFrame">{{1, 127}, {576, 16}}</string>
<reference key="NSSuperview" ref="865703622"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="486423323"/>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
<int key="NSsFlags">1</int>
<reference key="NSTarget" ref="865703622"/>
<string key="NSAction">_doScroller:</string>
<double key="NSPercent">0.57142859697341919</double>
</object>
- <object class="NSClipView" id="486423323">
- <reference key="NSNextResponder" ref="865703622"/>
- <int key="NSvFlags">2338</int>
- <array class="NSMutableArray" key="NSSubviews">
- <reference ref="1007693691"/>
- </array>
- <string key="NSFrame">{{1, 0}, {576, 17}}</string>
- <reference key="NSSuperview" ref="865703622"/>
- <reference key="NSNextKeyView" ref="1007693691"/>
- <reference key="NSDocView" ref="1007693691"/>
- <reference key="NSBGColor" ref="357371173"/>
- <int key="NScvFlags">4</int>
- </object>
</array>
<string key="NSFrame">{{-1, 22}, {578, 144}}</string>
<reference key="NSSuperview" ref="215475093"/>
- <reference key="NSNextKeyView" ref="264199078"/>
- <int key="NSsFlags">133650</int>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="444118053"/>
+ <int key="NSsFlags">133682</int>
<reference key="NSVScroller" ref="464398489"/>
<reference key="NSHScroller" ref="444118053"/>
<reference key="NSContentView" ref="264199078"/>
@@ -403,6 +446,8 @@
<int key="NSvFlags">-2147482359</int>
<string key="NSFrame">{{549, 175}, {16, 16}}</string>
<reference key="NSSuperview" ref="215475093"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="544468485"/>
<int key="NSpiFlags">20746</int>
<double key="NSMinValue">16</double>
<double key="NSMaxValue">100</double>
@@ -412,6 +457,8 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{30, -1}, {32, 25}}</string>
<reference key="NSSuperview" ref="215475093"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="919154377"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="939936412">
<int key="NSCellFlags">-2080374784</int>
@@ -441,6 +488,8 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{-10, 0}, {46, 25}}</string>
<reference key="NSSuperview" ref="215475093"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="865703622"/>
<bool key="NSEnabled">YES</bool>
<object class="NSPopUpButtonCell" key="NSCell" id="146997448">
<int key="NSCellFlags">-2076180416</int>
@@ -500,6 +549,17 @@
<string key="NSAction">_popUpItemAction:</string>
<reference key="NSTarget" ref="146997448"/>
</object>
+ <object class="NSMenuItem" id="177020435">
+ <reference key="NSMenu" ref="636769899"/>
+ <string key="NSTitle">Show Databases</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <int key="NSState">1</int>
+ <reference key="NSOnImage" ref="896081251"/>
+ <reference key="NSMixedImage" ref="235191893"/>
+ <string key="NSAction">_popUpItemAction:</string>
+ <reference key="NSTarget" ref="146997448"/>
+ </object>
<object class="NSMenuItem" id="388274540">
<reference key="NSMenu" ref="636769899"/>
<bool key="NSIsDisabled">YES</bool>
@@ -536,7 +596,7 @@
</object>
</array>
</object>
- <int key="NSSelectedIndex">1</int>
+ <int key="NSSelectedIndex">-1</int>
<bool key="NSPullDown">YES</bool>
<int key="NSPreferredEdge">1</int>
<bool key="NSUsesItemFromMenu">YES</bool>
@@ -549,6 +609,8 @@
<int key="NSvFlags">290</int>
<string key="NSFrame">{{67, 4}, {375, 14}}</string>
<reference key="NSSuperview" ref="215475093"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="591384017"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="1054523894">
<int key="NSCellFlags">68157504</int>
@@ -569,6 +631,9 @@
</object>
</array>
<string key="NSFrameSize">{575, 203}</string>
+ <reference key="NSSuperview"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="139811820"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
<string key="NSMinSize">{575, 152}</string>
@@ -580,21 +645,23 @@
<nil key="NSNextResponder"/>
<int key="NSvFlags">268</int>
<array class="NSMutableArray" key="NSSubviews">
- <object class="NSButton" id="926588109">
+ <object class="NSButton" id="677347650">
<reference key="NSNextResponder" ref="841319465"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{10, 8}, {260, 18}}</string>
+ <string key="NSFrame">{{10, 7}, {136, 18}}</string>
<reference key="NSSuperview" ref="841319465"/>
+ <string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
- <object class="NSButtonCell" key="NSCell" id="570624841">
+ <object class="NSButtonCell" key="NSCell" id="1065951206">
<int key="NSCellFlags">-2080374784</int>
- <int key="NSCellFlags2">0</int>
- <string key="NSContents">Include Connections</string>
+ <int key="NSCellFlags2">268435456</int>
+ <string key="NSContents">Include Databases</string>
<reference key="NSSupport" ref="1012436895"/>
- <reference key="NSControlView" ref="926588109"/>
+ <string key="NSCellIdentifier">_NS:9</string>
+ <reference key="NSControlView" ref="677347650"/>
<int key="NSButtonFlags">1211912448</int>
<int key="NSButtonFlags2">2</int>
- <object class="NSCustomResource" key="NSNormalImage" id="882388873">
+ <object class="NSCustomResource" key="NSNormalImage" id="641392135">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">NSSwitch</string>
</object>
@@ -608,11 +675,36 @@
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
+ <object class="NSButton" id="926588109">
+ <reference key="NSNextResponder" ref="841319465"/>
+ <int key="NSvFlags">268</int>
+ <string key="NSFrame">{{10, 31}, {260, 18}}</string>
+ <reference key="NSSuperview" ref="841319465"/>
+ <reference key="NSNextKeyView" ref="677347650"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="570624841">
+ <int key="NSCellFlags">-2080374784</int>
+ <int key="NSCellFlags2">0</int>
+ <string key="NSContents">Include Connections</string>
+ <reference key="NSSupport" ref="1012436895"/>
+ <reference key="NSControlView" ref="926588109"/>
+ <int key="NSButtonFlags">1211912448</int>
+ <int key="NSButtonFlags2">2</int>
+ <reference key="NSNormalImage" ref="641392135"/>
+ <reference key="NSAlternateImage" ref="841662284"/>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
+ </object>
<object class="NSButton" id="296628662">
<reference key="NSNextResponder" ref="841319465"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{10, 32}, {260, 18}}</string>
+ <string key="NSFrame">{{10, 55}, {260, 18}}</string>
<reference key="NSSuperview" ref="841319465"/>
+ <reference key="NSNextKeyView" ref="926588109"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="640143248">
<int key="NSCellFlags">-2080374784</int>
@@ -622,7 +714,7 @@
<reference key="NSControlView" ref="296628662"/>
<int key="NSButtonFlags">1211912448</int>
<int key="NSButtonFlags2">2</int>
- <reference key="NSNormalImage" ref="882388873"/>
+ <reference key="NSNormalImage" ref="641392135"/>
<reference key="NSAlternateImage" ref="841662284"/>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
@@ -632,7 +724,8 @@
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
</array>
- <string key="NSFrameSize">{278, 56}</string>
+ <string key="NSFrameSize">{278, 79}</string>
+ <reference key="NSNextKeyView" ref="296628662"/>
<string key="NSClassName">NSView</string>
</object>
<object class="NSMenu" id="1011399888">
@@ -792,6 +885,22 @@
<string key="id">58</string>
</object>
<object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">toggleShowDatabases:</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="177020435"/>
+ </object>
+ <string key="id">qJH-at-hGq</string>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">includeDatabaseButton</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="677347650"/>
+ </object>
+ <string key="id">yvJ-aZ-4by</string>
+ </object>
+ <object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="139811820"/>
@@ -899,6 +1008,26 @@
</object>
<string key="id">124</string>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBBindingConnection" key="connection">
+ <string key="label">value: values.ConsoleShowDatabases</string>
+ <reference key="source" ref="177020435"/>
+ <reference key="destination" ref="320962651"/>
+ <object class="NSNibBindingConnector" key="connector">
+ <reference key="NSSource" ref="177020435"/>
+ <reference key="NSDestination" ref="320962651"/>
+ <string key="NSLabel">value: values.ConsoleShowDatabases</string>
+ <string key="NSBinding">value</string>
+ <string key="NSKeyPath">values.ConsoleShowDatabases</string>
+ <object class="NSDictionary" key="NSOptions">
+ <string key="NS.key.0">NSConditionallySetsEnabled</string>
+ <boolean value="NO" key="NS.object.0"/>
+ </object>
+ <int key="NSNibBindingConnectorVersion">2</int>
+ </object>
+ </object>
+ <string key="id">pY8-9m-mAK</string>
+ </object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
@@ -1003,6 +1132,7 @@
<array class="NSMutableArray" key="children">
<reference ref="296628662"/>
<reference ref="926588109"/>
+ <reference ref="677347650"/>
</array>
<reference key="parent" ref="0"/>
<string key="objectName">saveLogView</string>
@@ -1090,6 +1220,7 @@
<reference ref="60345708"/>
<reference ref="388274540"/>
<reference ref="825047486"/>
+ <reference ref="177020435"/>
</array>
<reference key="parent" ref="146997448"/>
</object>
@@ -1165,7 +1296,8 @@
<array class="NSMutableArray" key="children">
<reference ref="424669154"/>
<reference ref="925890526"/>
- <reference ref="781897583"/>
+ <reference ref="871689097"/>
+ <reference ref="171952907"/>
</array>
<reference key="parent" ref="865703622"/>
</object>
@@ -1186,27 +1318,58 @@
<reference key="parent" ref="243353733"/>
</object>
<object class="IBObjectRecord">
- <string key="id">17</string>
- <reference key="object" ref="781897583"/>
+ <string key="id">114</string>
+ <reference key="object" ref="293601307"/>
+ <reference key="parent" ref="925890526"/>
+ </object>
+ <object class="IBObjectRecord">
+ <string key="id">19</string>
+ <reference key="object" ref="353829655"/>
+ <reference key="parent" ref="424669154"/>
+ </object>
+ <object class="IBObjectRecord">
+ <string key="id">wyq-H4-GHT</string>
+ <reference key="object" ref="871689097"/>
<array class="NSMutableArray" key="children">
- <reference ref="973993322"/>
+ <reference ref="855432522"/>
</array>
<reference key="parent" ref="243353733"/>
</object>
<object class="IBObjectRecord">
- <string key="id">20</string>
- <reference key="object" ref="973993322"/>
- <reference key="parent" ref="781897583"/>
+ <string key="id">g2D-wF-fcB</string>
+ <reference key="object" ref="855432522"/>
+ <reference key="parent" ref="871689097"/>
</object>
<object class="IBObjectRecord">
- <string key="id">114</string>
- <reference key="object" ref="293601307"/>
- <reference key="parent" ref="925890526"/>
+ <string key="id">TqS-5i-3PL</string>
+ <reference key="object" ref="171952907"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="83483769"/>
+ </array>
+ <reference key="parent" ref="243353733"/>
</object>
<object class="IBObjectRecord">
- <string key="id">19</string>
- <reference key="object" ref="353829655"/>
- <reference key="parent" ref="424669154"/>
+ <string key="id">REt-h0-g0b</string>
+ <reference key="object" ref="83483769"/>
+ <reference key="parent" ref="171952907"/>
+ </object>
+ <object class="IBObjectRecord">
+ <string key="id">QeH-Fu-VaB</string>
+ <reference key="object" ref="177020435"/>
+ <reference key="parent" ref="636769899"/>
+ </object>
+ <object class="IBObjectRecord">
+ <string key="id">bTU-iR-4Vf</string>
+ <reference key="object" ref="677347650"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="1065951206"/>
+ </array>
+ <reference key="parent" ref="841319465"/>
+ </object>
+ <object class="IBObjectRecord">
+ <string key="id">kLs-LH-NAM</string>
+ <reference key="object" ref="1065951206"/>
+ <reference key="parent" ref="677347650"/>
</object>
</array>
</object>
@@ -1229,10 +1392,8 @@
<string key="14.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="15.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="16.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string key="17.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="18.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="19.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string key="20.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="3.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="3.IBWindowTemplateEditedContentRect">{{277, 574}, {575, 203}}</string>
<boolean value="NO" key="3.NSWindowTemplate.visibleAtLaunch"/>
@@ -1267,13 +1428,129 @@
<string key="83.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="89.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="9.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="QeH-Fu-VaB.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="REt-h0-g0b.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="TqS-5i-3PL.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="bTU-iR-4Vf.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="g2D-wF-fcB.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="kLs-LH-NAM.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="wyq-H4-GHT.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
</object>
- <object class="IBClassDescriber" key="IBDocument.Classes"/>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <array class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <object class="IBPartialClassDescription">
+ <string key="className">SPQueryController</string>
+ <string key="superclassName">NSWindowController</string>
+ <dictionary class="NSMutableDictionary" key="actions">
+ <string key="clearConsole:">id</string>
+ <string key="copy:">id</string>
+ <string key="saveConsoleAs:">id</string>
+ <string key="toggleShowConnections:">id</string>
+ <string key="toggleShowDatabases:">id</string>
+ <string key="toggleShowHelpStatements:">id</string>
+ <string key="toggleShowSelectShowStatements:">id</string>
+ <string key="toggleShowTimeStamps:">id</string>
+ </dictionary>
+ <dictionary class="NSMutableDictionary" key="actionInfosByName">
+ <object class="IBActionInfo" key="clearConsole:">
+ <string key="name">clearConsole:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo" key="copy:">
+ <string key="name">copy:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo" key="saveConsoleAs:">
+ <string key="name">saveConsoleAs:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo" key="toggleShowConnections:">
+ <string key="name">toggleShowConnections:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo" key="toggleShowDatabases:">
+ <string key="name">toggleShowDatabases:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo" key="toggleShowHelpStatements:">
+ <string key="name">toggleShowHelpStatements:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo" key="toggleShowSelectShowStatements:">
+ <string key="name">toggleShowSelectShowStatements:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo" key="toggleShowTimeStamps:">
+ <string key="name">toggleShowTimeStamps:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </dictionary>
+ <dictionary class="NSMutableDictionary" key="outlets">
+ <string key="clearConsoleButton">NSButton</string>
+ <string key="consoleSearchField">NSSearchField</string>
+ <string key="consoleTableView">NSTableView</string>
+ <string key="includeConnectionButton">NSButton</string>
+ <string key="includeDatabaseButton">NSButton</string>
+ <string key="includeTimeStampsButton">NSButton</string>
+ <string key="loggingDisabledTextField">NSTextField</string>
+ <string key="progressIndicator">NSProgressIndicator</string>
+ <string key="saveConsoleButton">NSButton</string>
+ <string key="saveLogView">NSView</string>
+ </dictionary>
+ <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <object class="IBToOneOutletInfo" key="clearConsoleButton">
+ <string key="name">clearConsoleButton</string>
+ <string key="candidateClassName">NSButton</string>
+ </object>
+ <object class="IBToOneOutletInfo" key="consoleSearchField">
+ <string key="name">consoleSearchField</string>
+ <string key="candidateClassName">NSSearchField</string>
+ </object>
+ <object class="IBToOneOutletInfo" key="consoleTableView">
+ <string key="name">consoleTableView</string>
+ <string key="candidateClassName">NSTableView</string>
+ </object>
+ <object class="IBToOneOutletInfo" key="includeConnectionButton">
+ <string key="name">includeConnectionButton</string>
+ <string key="candidateClassName">NSButton</string>
+ </object>
+ <object class="IBToOneOutletInfo" key="includeDatabaseButton">
+ <string key="name">includeDatabaseButton</string>
+ <string key="candidateClassName">NSButton</string>
+ </object>
+ <object class="IBToOneOutletInfo" key="includeTimeStampsButton">
+ <string key="name">includeTimeStampsButton</string>
+ <string key="candidateClassName">NSButton</string>
+ </object>
+ <object class="IBToOneOutletInfo" key="loggingDisabledTextField">
+ <string key="name">loggingDisabledTextField</string>
+ <string key="candidateClassName">NSTextField</string>
+ </object>
+ <object class="IBToOneOutletInfo" key="progressIndicator">
+ <string key="name">progressIndicator</string>
+ <string key="candidateClassName">NSProgressIndicator</string>
+ </object>
+ <object class="IBToOneOutletInfo" key="saveConsoleButton">
+ <string key="name">saveConsoleButton</string>
+ <string key="candidateClassName">NSButton</string>
+ </object>
+ <object class="IBToOneOutletInfo" key="saveLogView">
+ <string key="name">saveLogView</string>
+ <string key="candidateClassName">NSView</string>
+ </object>
+ </dictionary>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/SPQueryController.h</string>
+ </object>
+ </object>
+ </array>
+ </object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
<bool key="IBDocument.previouslyAttemptedUpgradeToXcode5">YES</bool>
diff --git a/Resources/Plists/PreferenceDefaults.plist b/Resources/Plists/PreferenceDefaults.plist
index 43ed5c1a..aec5bae9 100644
--- a/Resources/Plists/PreferenceDefaults.plist
+++ b/Resources/Plists/PreferenceDefaults.plist
@@ -18,6 +18,8 @@
<true/>
<key>ConsoleShowConnections</key>
<true/>
+ <key>ConsoleShowDatabases</key>
+ <true/>
<key>ConsoleShowHelps</key>
<true/>
<key>ConsoleShowSelectsAndShows</key>
diff --git a/Source/SPConnectionDelegate.m b/Source/SPConnectionDelegate.m
index b7bbc47e..caf7926c 100644
--- a/Source/SPConnectionDelegate.m
+++ b/Source/SPConnectionDelegate.m
@@ -48,11 +48,11 @@
{
#ifndef SP_CODA
if ([prefs boolForKey:SPConsoleEnableLogging]) {
- if ((_queryMode == SPInterfaceQueryMode && [prefs boolForKey:SPConsoleEnableInterfaceLogging])
- || (_queryMode == SPCustomQueryQueryMode && [prefs boolForKey:SPConsoleEnableCustomQueryLogging])
- || (_queryMode == SPImportExportQueryMode && [prefs boolForKey:SPConsoleEnableImportExportLogging]))
+ if ((_queryMode == SPInterfaceQueryMode && [prefs boolForKey:SPConsoleEnableInterfaceLogging]) ||
+ (_queryMode == SPCustomQueryQueryMode && [prefs boolForKey:SPConsoleEnableCustomQueryLogging]) ||
+ (_queryMode == SPImportExportQueryMode && [prefs boolForKey:SPConsoleEnableImportExportLogging]))
{
- [[SPQueryController sharedQueryController] showMessageInConsole:query connection:[self name]];
+ [[SPQueryController sharedQueryController] showMessageInConsole:query connection:[self name] database:[self database]];
}
}
#endif
@@ -65,7 +65,7 @@
{
#ifndef SP_CODA
if ([prefs boolForKey:SPConsoleEnableLogging] && [prefs boolForKey:SPConsoleEnableErrorLogging]) {
- [[SPQueryController sharedQueryController] showErrorInConsole:error connection:[self name]];
+ [[SPQueryController sharedQueryController] showErrorInConsole:error connection:[self name] database:[self database]];
}
#endif
}
@@ -75,7 +75,6 @@
*/
- (NSString *)keychainPasswordForConnection:(SPMySQLConnection *)connection
{
-
// If no keychain item is available, return an empty password
if (![connectionController connectionKeychainItemName]) return nil;
@@ -96,23 +95,26 @@
*/
- (NSString *)keychainPasswordForSSHConnection:(SPMySQLConnection *)connection
{
-
// If no keychain item is available, return an empty password
if (![connectionController connectionKeychainItemName]) return @"";
// Otherwise, pull the password from the keychain using the details from this connection
SPKeychain *keychain = [[SPKeychain alloc] init];
+
NSString *connectionSSHKeychainItemName = [[keychain nameForSSHForFavoriteName:[connectionController name] id:[self keyChainID]] retain];
NSString *connectionSSHKeychainItemAccount = [[keychain accountForSSHUser:[connectionController sshUser] sshHost:[connectionController sshHost]] retain];
- NSString *sshpw = [keychain getPasswordForName:connectionSSHKeychainItemName account:connectionSSHKeychainItemAccount];
- if (!sshpw || ![sshpw length])
- sshpw = @"";
+ NSString *sshPassword = [keychain getPasswordForName:connectionSSHKeychainItemName account:connectionSSHKeychainItemAccount];
+
+ if (!sshPassword || ![sshPassword length]) {
+ sshPassword = @"";
+ }
+
+ if (connectionSSHKeychainItemName) [connectionSSHKeychainItemName release];
+ if (connectionSSHKeychainItemAccount) [connectionSSHKeychainItemAccount release];
- if(connectionSSHKeychainItemName) [connectionSSHKeychainItemName release];
- if(connectionSSHKeychainItemAccount) [connectionSSHKeychainItemAccount release];
[keychain release];
- return sshpw;
+ return sshPassword;
}
/**
@@ -121,7 +123,17 @@
*/
- (void)noConnectionAvailable:(id)connection
{
- SPBeginAlertSheet(NSLocalizedString(@"No connection available", @"no connection available message"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [self parentWindow], self, nil, nil, NSLocalizedString(@"An error has occured and there doesn't seem to be a connection available.", @"no connection available informatie message"));
+ SPBeginAlertSheet(
+ NSLocalizedString(@"No connection available", @"no connection available message"),
+ NSLocalizedString(@"OK", @"OK button"),
+ nil,
+ nil,
+ [self parentWindow],
+ self,
+ nil,
+ nil,
+ NSLocalizedString(@"An error has occured and there doesn't seem to be a connection available.", @"no connection available informatie message")
+ );
}
/**
diff --git a/Source/SPConsoleMessage.h b/Source/SPConsoleMessage.h
index 7fe1b711..e79845ae 100644
--- a/Source/SPConsoleMessage.h
+++ b/Source/SPConsoleMessage.h
@@ -34,16 +34,24 @@
NSDate *messageDate;
NSString *message;
+ NSString *messageDatabase;
NSString *messageConnection;
}
@property (readwrite, assign) BOOL isError;
@property (readwrite, retain) NSDate *messageDate;
@property (readwrite, retain) NSString *message;
+@property (readwrite, retain) NSString *messageDatabase;
@property (readwrite, retain) NSString *messageConnection;
-+ (SPConsoleMessage *)consoleMessageWithMessage:(NSString *)consoleMessage date:(NSDate *)date connection:(NSString *)connection;
++ (SPConsoleMessage *)consoleMessageWithMessage:(NSString *)consoleMessage
+ date:(NSDate *)date
+ connection:(NSString *)connection
+ database:(NSString *)database;
-- (id)initWithMessage:(NSString *)message date:(NSDate *)date connection:(NSString *)connection;
+- (id)initWithMessage:(NSString *)message
+ date:(NSDate *)date
+ connection:(NSString *)connection
+ database:(NSString *)database;
@end
diff --git a/Source/SPConsoleMessage.m b/Source/SPConsoleMessage.m
index 0a5c2bcf..6ada323a 100644
--- a/Source/SPConsoleMessage.m
+++ b/Source/SPConsoleMessage.m
@@ -35,24 +35,26 @@
@synthesize isError;
@synthesize messageDate;
@synthesize message;
+@synthesize messageDatabase;
@synthesize messageConnection;
/**
* Returns a new console message instance using the suppled message, date and connection.
*/
-+ (SPConsoleMessage *)consoleMessageWithMessage:(NSString *)message date:(NSDate *)date connection:(NSString *)connection
++ (SPConsoleMessage *)consoleMessageWithMessage:(NSString *)message date:(NSDate *)date connection:(NSString *)connection database:(NSString *)database
{
- return [[[SPConsoleMessage alloc] initWithMessage:message date:date connection:connection] autorelease];
+ return [[[SPConsoleMessage alloc] initWithMessage:message date:date connection:connection database:database] autorelease];
}
/**
* Initializes a new console message instance using the suppled message, date and connection.
*/
-- (id)initWithMessage:(NSString *)consoleMessage date:(NSDate *)date connection:(NSString *)connection
+- (id)initWithMessage:(NSString *)consoleMessage date:(NSDate *)date connection:(NSString *)connection database:(NSString *)database
{
if ((self = [super init])) {
[self setMessageDate:date];
[self setMessage:consoleMessage];
+ [self setMessageDatabase:database];
[self setMessageConnection:connection];
}
@@ -65,6 +67,7 @@
{
[message release], message = nil;
[messageDate release], messageDate = nil;
+ [messageDatabase release], messageDatabase = nil;
[messageConnection release], messageConnection = nil;
[super dealloc];
diff --git a/Source/SPConstants.h b/Source/SPConstants.h
index 1778a1d5..76f51f49 100644
--- a/Source/SPConstants.h
+++ b/Source/SPConstants.h
@@ -355,6 +355,7 @@ extern NSString *SPLastUsedVersion;
// GUI Prefs
extern NSString *SPConsoleShowTimestamps;
extern NSString *SPConsoleShowConnections;
+extern NSString *SPConsoleShowDatabases;
extern NSString *SPConsoleShowSelectsAndShows;
extern NSString *SPConsoleShowHelps;
extern NSString *SPEditInSheetEnabled;
diff --git a/Source/SPConstants.m b/Source/SPConstants.m
index a1bcce8d..6b986506 100644
--- a/Source/SPConstants.m
+++ b/Source/SPConstants.m
@@ -163,6 +163,7 @@ NSString *SPConsoleShowHelps = @"ConsoleShowHelps";
NSString *SPConsoleShowSelectsAndShows = @"ConsoleShowSelectsAndShows";
NSString *SPConsoleShowTimestamps = @"ConsoleShowTimestamps";
NSString *SPConsoleShowConnections = @"ConsoleShowConnections";
+NSString *SPConsoleShowDatabases = @"ConsoleShowDatabases";
NSString *SPEditInSheetEnabled = @"EditInSheetEnabled";
NSString *SPTableInformationPanelCollapsed = @"TableInformationPanelCollapsed";
NSString *SPTableColumnWidths = @"tableColumnWidths";
diff --git a/Source/SPQueryConsoleDataSource.m b/Source/SPQueryConsoleDataSource.m
index 343f2dcd..eaac2151 100644
--- a/Source/SPQueryConsoleDataSource.m
+++ b/Source/SPQueryConsoleDataSource.m
@@ -54,8 +54,12 @@ static NSUInteger SPMessageTruncateCharacterLength = 256;
{
#ifndef SP_CODA
NSString *returnValue = nil;
+
+ NSString *identifier = [tableColumn identifier];
+
+ if (!identifier) return returnValue;
- id object = [[messagesVisibleSet objectAtIndex:row] valueForKey:[tableColumn identifier]];
+ id object = [[messagesVisibleSet objectAtIndex:row] valueForKey:identifier];
if ([[tableColumn identifier] isEqualToString:SPTableViewDateColumnID]) {
@@ -68,7 +72,9 @@ static NSUInteger SPMessageTruncateCharacterLength = 256;
returnValue = object;
}
-
+
+ if (!returnValue) return returnValue;
+
NSMutableDictionary *stringAtributes = nil;
if (consoleFont) {
diff --git a/Source/SPQueryController.h b/Source/SPQueryController.h
index ce48dced..8d128fe3 100644
--- a/Source/SPQueryController.h
+++ b/Source/SPQueryController.h
@@ -32,6 +32,7 @@
extern NSString *SPQueryConsoleWindowAutoSaveName;
extern NSString *SPTableViewDateColumnID;
extern NSString *SPTableViewConnectionColumnID;
+extern NSString *SPTableViewDatabaseColumnID;
#endif
@interface SPQueryController : NSWindowController
@@ -42,22 +43,26 @@ extern NSString *SPTableViewConnectionColumnID;
IBOutlet NSSearchField *consoleSearchField;
IBOutlet NSTextField *loggingDisabledTextField;
IBOutlet NSProgressIndicator *progressIndicator;
- IBOutlet NSButton *includeTimeStampsButton, *includeConnectionButton, *saveConsoleButton, *clearConsoleButton;
-
- NSFont *consoleFont;
- NSMutableArray *messagesFullSet, *messagesFilteredSet, *messagesVisibleSet;
+ IBOutlet NSButton *includeTimeStampsButton;
+ IBOutlet NSButton *includeConnectionButton;
+ IBOutlet NSButton *includeDatabaseButton;
+ IBOutlet NSButton *saveConsoleButton;
+ IBOutlet NSButton *clearConsoleButton;
+
BOOL showSelectStatementsAreDisabled;
BOOL showHelpStatementsAreDisabled;
BOOL filterIsActive;
BOOL allowConsoleUpdate;
-
+
+ NSFont *consoleFont;
NSMutableString *activeFilterString;
-
+ NSMutableArray *messagesFullSet, *messagesFilteredSet, *messagesVisibleSet;
+
// DocumentsController
- NSUInteger untitledDocumentCounter;
NSMutableDictionary *favoritesContainer;
NSMutableDictionary *historyContainer;
NSMutableDictionary *contentFilterContainer;
+ NSUInteger untitledDocumentCounter;
NSUInteger numberOfMaxAllowedHistory;
#endif
@@ -84,6 +89,7 @@ extern NSString *SPTableViewConnectionColumnID;
- (IBAction)saveConsoleAs:(id)sender;
- (IBAction)toggleShowTimeStamps:(id)sender;
- (IBAction)toggleShowConnections:(id)sender;
+- (IBAction)toggleShowDatabases:(id)sender;
- (IBAction)toggleShowSelectShowStatements:(id)sender;
- (IBAction)toggleShowHelpStatements:(id)sender;
@@ -92,8 +98,8 @@ extern NSString *SPTableViewConnectionColumnID;
- (BOOL)allowConsoleUpdate;
- (void)setAllowConsoleUpdate:(BOOL)allowUpdate;
-- (void)showMessageInConsole:(NSString *)message connection:(NSString *)connection;
-- (void)showErrorInConsole:(NSString *)error connection:(NSString *)connection;
+- (void)showMessageInConsole:(NSString *)message connection:(NSString *)connection database:(NSString *)database;
+- (void)showErrorInConsole:(NSString *)error connection:(NSString *)connection database:(NSString *)database;
- (NSUInteger)consoleMessageCount;
diff --git a/Source/SPQueryController.m b/Source/SPQueryController.m
index f31ce808..01cb50e1 100644
--- a/Source/SPQueryController.m
+++ b/Source/SPQueryController.m
@@ -39,6 +39,7 @@
NSString *SPQueryConsoleWindowAutoSaveName = @"QueryConsole";
NSString *SPTableViewDateColumnID = @"messageDate";
NSString *SPTableViewConnectionColumnID = @"messageConnection";
+NSString *SPTableViewDatabaseColumnID = @"messageDatabase";
#endif
@interface SPQueryController ()
@@ -46,8 +47,8 @@ NSString *SPTableViewConnectionColumnID = @"messageConnection";
- (void)_updateFilterState;
- (void)_allowFilterClearOrSave:(NSNumber *)enabled;
- (BOOL)_messageMatchesCurrentFilters:(NSString *)message;
-- (NSString *)_getConsoleStringWithTimeStamps:(BOOL)timeStamps connections:(BOOL)connections;
-- (void)_addMessageToConsole:(NSString *)message connection:(NSString *)connection isError:(BOOL)error;
+- (NSString *)_getConsoleStringWithTimeStamps:(BOOL)timeStamps connections:(BOOL)connections databases:(BOOL)databases;
+- (void)_addMessageToConsole:(NSString *)message connection:(NSString *)connection isError:(BOOL)error database:(NSString *)database;
@end
@@ -161,6 +162,7 @@ static SPQueryController *sharedQueryController = nil;
BOOL includeTimestamps = ![[consoleTableView tableColumnWithIdentifier:SPTableViewDateColumnID] isHidden];
BOOL includeConnections = ![[consoleTableView tableColumnWithIdentifier:SPTableViewConnectionColumnID] isHidden];
+ BOOL includeDatabases = ![[consoleTableView tableColumnWithIdentifier:SPTableViewDatabaseColumnID] isHidden];
[string setString:@""];
@@ -181,7 +183,12 @@ static SPQueryController *sharedQueryController = nil;
[string appendString:@" "];
}
- if (includeTimestamps || includeConnections) [string appendString:@"*/ "];
+ if (includeDatabases) {
+ [string appendString:[message messageDatabase]];
+ [string appendString:@" "];
+ }
+
+ if (includeTimestamps || includeConnections || includeDatabases) [string appendString:@"*/ "];
[string appendFormat:@"%@\n", [message message]];
}
@@ -228,10 +235,12 @@ static SPQueryController *sharedQueryController = nil;
[panel setAccessoryView:saveLogView];
[panel setNameFieldStringValue:NSLocalizedString(@"ConsoleLog", @"Console : Save as : Initial filename")];
+
[panel beginSheetModalForWindow:[self window] completionHandler:^(NSInteger returnCode) {
if (returnCode == NSOKButton) {
[[self _getConsoleStringWithTimeStamps:[includeTimeStampsButton state]
- connections:[includeConnectionButton state]] writeToFile:[[panel URL] path] atomically:YES encoding:NSUTF8StringEncoding error:NULL];
+ connections:[includeConnectionButton state]
+ databases:[includeDatabaseButton state]] writeToFile:[[panel URL] path] atomically:YES encoding:NSUTF8StringEncoding error:NULL];
}
}];
#endif
@@ -243,17 +252,27 @@ static SPQueryController *sharedQueryController = nil;
- (IBAction)toggleShowTimeStamps:(id)sender
{
#ifndef SP_CODA
- [[consoleTableView tableColumnWithIdentifier:SPTableViewDateColumnID] setHidden:([sender state])];
+ [[consoleTableView tableColumnWithIdentifier:SPTableViewDateColumnID] setHidden:[sender state]];
#endif
}
/**
- * Toggles the display of message connections column in the table view.
+ * Toggles the display of the message connections column in the table view.
*/
- (IBAction)toggleShowConnections:(id)sender
{
#ifndef SP_CODA
- [[consoleTableView tableColumnWithIdentifier:SPTableViewConnectionColumnID] setHidden:([sender state])];
+ [[consoleTableView tableColumnWithIdentifier:SPTableViewConnectionColumnID] setHidden:[sender state]];
+#endif
+}
+
+/**
+ * Toggles the display of the message databases column in the table view.
+ */
+- (IBAction)toggleShowDatabases:(id)sender
+{
+#ifndef SP_CODA
+ [[consoleTableView tableColumnWithIdentifier:SPTableViewDatabaseColumnID] setHidden:[sender state]];
#endif
}
@@ -286,20 +305,20 @@ static SPQueryController *sharedQueryController = nil;
/**
* Shows the supplied message from the supplied connection in the console.
*/
-- (void)showMessageInConsole:(NSString *)message connection:(NSString *)connection
+- (void)showMessageInConsole:(NSString *)message connection:(NSString *)connection database:(NSString *)database
{
#ifndef SP_CODA
- [self _addMessageToConsole:message connection:connection isError:NO];
+ [self _addMessageToConsole:message connection:connection isError:NO database:database];
#endif
}
/**
* Shows the supplied error from the supplied connection in the console.
*/
-- (void)showErrorInConsole:(NSString *)error connection:(NSString *)connection
+- (void)showErrorInConsole:(NSString *)error connection:(NSString *)connection database:(NSString *)database
{
#ifndef SP_CODA
- [self _addMessageToConsole:error connection:connection isError:YES];
+ [self _addMessageToConsole:error connection:connection isError:YES database:database];
#endif
}
@@ -538,7 +557,7 @@ static SPQueryController *sharedQueryController = nil;
* Creates and returns a string made entirely of all of the console's messages and includes the message
* time stamp and connection if specified.
*/
-- (NSString *)_getConsoleStringWithTimeStamps:(BOOL)timeStamps connections:(BOOL)connections
+- (NSString *)_getConsoleStringWithTimeStamps:(BOOL)timeStamps connections:(BOOL)connections databases:(BOOL)databases
{
NSMutableString *consoleString = [NSMutableString string];
@@ -563,6 +582,11 @@ static SPQueryController *sharedQueryController = nil;
[consoleString appendString:@" "];
}
+ if (databases && [message messageDatabase]) {
+ [consoleString appendString:[message messageDatabase]];
+ [consoleString appendString:@" "];
+ }
+
// Close the comment
if (timeStamps || connections) [consoleString appendString:@"*/ "];
@@ -578,7 +602,7 @@ static SPQueryController *sharedQueryController = nil;
/**
* Adds the supplied message to the query console.
*/
-- (void)_addMessageToConsole:(NSString *)message connection:(NSString *)connection isError:(BOOL)error
+- (void)_addMessageToConsole:(NSString *)message connection:(NSString *)connection isError:(BOOL)error database:(NSString *)database
{
#ifndef SP_CODA
NSString *messageTemp = [[message stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] stringByReplacingOccurrencesOfString:@"\n" withString:@" "];
@@ -586,7 +610,7 @@ static SPQueryController *sharedQueryController = nil;
// Only append a semi-colon (;) if the supplied message is not an error
if (!error) messageTemp = [messageTemp stringByAppendingString:@";"];
- SPConsoleMessage *consoleMessage = [SPConsoleMessage consoleMessageWithMessage:messageTemp date:[NSDate date] connection:connection];
+ SPConsoleMessage *consoleMessage = [SPConsoleMessage consoleMessageWithMessage:messageTemp date:[NSDate date] connection:connection database:database];
[consoleMessage setIsError:error];
diff --git a/Source/SPQueryControllerInitializer.m b/Source/SPQueryControllerInitializer.m
index 93854863..8890a607 100644
--- a/Source/SPQueryControllerInitializer.m
+++ b/Source/SPQueryControllerInitializer.m
@@ -57,6 +57,7 @@ static NSString *SPCompletionTokensSnippetsKey = @"function_argument_snippets";
// Show/hide table columns
[[consoleTableView tableColumnWithIdentifier:SPTableViewDateColumnID] setHidden:![prefs boolForKey:SPConsoleShowTimestamps]];
[[consoleTableView tableColumnWithIdentifier:SPTableViewConnectionColumnID] setHidden:![prefs boolForKey:SPConsoleShowConnections]];
+ [[consoleTableView tableColumnWithIdentifier:SPTableViewDatabaseColumnID] setHidden:![prefs boolForKey:SPConsoleShowDatabases]];
showSelectStatementsAreDisabled = ![prefs boolForKey:SPConsoleShowSelectsAndShows];
showHelpStatementsAreDisabled = ![prefs boolForKey:SPConsoleShowHelps];
diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m
index 8e537178..dcf22d49 100644
--- a/Source/SPTableContent.m
+++ b/Source/SPTableContent.m
@@ -2956,13 +2956,17 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper
[tableValues removeRowAtIndex:currentlyEditingRow];
[self updateCountText];
isEditingNewRow = NO;
- } else {
+ }
+ else {
[tableValues replaceRowAtIndex:currentlyEditingRow withRowContents:oldRow];
}
+
isEditingRow = NO;
currentlyEditingRow = -1;
[tableContentView reloadData];
- [[SPQueryController sharedQueryController] showErrorInConsole:NSLocalizedString(@"/* WARNING: No rows have been affected */\n", @"warning shown in the console when no rows have been affected after writing to the db") connection:[tableDocumentInstance name]];
+
+ [[SPQueryController sharedQueryController] showErrorInConsole:NSLocalizedString(@"/* WARNING: No rows have been affected */\n", @"warning shown in the console when no rows have been affected after writing to the db") connection:[tableDocumentInstance name] database:[tableDocumentInstance database]];
+
return YES;
// On success...