aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2009-04-16 01:39:54 +0000
committerrowanbeentje <rowan@beent.je>2009-04-16 01:39:54 +0000
commit20c46135604cfd3a38c55647438264e5360c80a4 (patch)
tree7e0ac9e61ec9636584ce71ee11f50a58a8672f18
parent70b0c84d4e62117075d347f905b5543bc4d537ee (diff)
downloadsequelpro-20c46135604cfd3a38c55647438264e5360c80a4.tar.gz
sequelpro-20c46135604cfd3a38c55647438264e5360c80a4.tar.bz2
sequelpro-20c46135604cfd3a38c55647438264e5360c80a4.zip
- Amend the connection sheet to add an "Add to favorites" button, remove the + and - buttons, and re-enable double-click to connect. This addresses the majority of Issue #232, although the "Edit" button is not yet functioning.
- Fix a bug where if an autoconnection failed, connection was automatically reattempted - Add a name field to the connection sheet, and display the name in the window title in place of user@host if set
-rw-r--r--Interfaces/English.lproj/DBView.xib360
-rw-r--r--Source/TableDocument.h7
-rw-r--r--Source/TableDocument.m114
-rw-r--r--Source/TablesList.m20
4 files changed, 290 insertions, 211 deletions
diff --git a/Interfaces/English.lproj/DBView.xib b/Interfaces/English.lproj/DBView.xib
index 6ed622de..60a03b6a 100644
--- a/Interfaces/English.lproj/DBView.xib
+++ b/Interfaces/English.lproj/DBView.xib
@@ -8,6 +8,7 @@
<string key="IBDocument.HIToolboxVersion">353.00</string>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
+ <integer value="40"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -370,7 +371,7 @@
<reference key="NSControlView" ref="1029554648"/>
<int key="NSButtonFlags">-2042609409</int>
<int key="NSButtonFlags2">35</int>
- <object class="NSCustomResource" key="NSNormalImage" id="1068138296">
+ <object class="NSCustomResource" key="NSNormalImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">button_action</string>
</object>
@@ -385,7 +386,10 @@
<string key="NSKeyEquiv"/>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSImage" ref="1068138296"/>
+ <object class="NSCustomResource" key="NSImage" id="335884728">
+ <string key="NSClassName">NSImage</string>
+ <string key="NSResourceName">button_action</string>
+ </object>
<string key="NSAction">_popUpItemAction:</string>
<reference key="NSTarget" ref="753352469"/>
</object>
@@ -2927,10 +2931,7 @@
<reference key="NSControlView" ref="363916571"/>
<int key="NSButtonFlags">-2042609409</int>
<int key="NSButtonFlags2">35</int>
- <object class="NSCustomResource" key="NSNormalImage">
- <string key="NSClassName">NSImage</string>
- <string key="NSResourceName">button_action</string>
- </object>
+ <reference key="NSNormalImage" ref="335884728"/>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">400</int>
@@ -2942,7 +2943,7 @@
<string key="NSKeyEquiv"/>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSImage" ref="1068138296"/>
+ <reference key="NSImage" ref="335884728"/>
<string key="NSAction">_popUpItemAction:</string>
<reference key="NSTarget" ref="984501775"/>
</object>
@@ -3685,7 +3686,7 @@
<object class="NSWindowTemplate" id="456332212">
<int key="NSWindowStyleMask">1</int>
<int key="NSWindowBacking">2</int>
- <string key="NSWindowRect">{{469, 447}, {519, 335}}</string>
+ <string key="NSWindowRect">{{469, 435}, {519, 347}}</string>
<int key="NSWTFlags">1886914560</int>
<string key="NSWindowTitle">connectSheet</string>
<string key="NSWindowClass">NSWindow</string>
@@ -3695,7 +3696,7 @@
<string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string>
<string key="NSWindowContentMinSize">{256, 191}</string>
<object class="NSView" key="NSWindowView" id="586457094">
- <nil key="NSNextResponder"/>
+ <reference key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -3757,7 +3758,7 @@
<object class="NSTextField" id="593089150">
<reference key="NSNextResponder" ref="586457094"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{71, 290}, {97, 21}}</string>
+ <string key="NSFrame">{{71, 302}, {97, 21}}</string>
<reference key="NSSuperview" ref="586457094"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="196685261">
@@ -3789,7 +3790,7 @@
<string>NeXT TIFF v4.0 pasteboard type</string>
</object>
</object>
- <string key="NSFrame">{{15, 275}, {48, 48}}</string>
+ <string key="NSFrame">{{15, 287}, {48, 48}}</string>
<reference key="NSSuperview" ref="586457094"/>
<bool key="NSEnabled">YES</bool>
<object class="NSImageCell" key="NSCell" id="706772332">
@@ -3855,7 +3856,7 @@
<object class="NSTextField" id="252686319">
<reference key="NSNextResponder" ref="781284031"/>
<int key="NSvFlags">256</int>
- <string key="NSFrame">{{320, 166}, {185, 18}}</string>
+ <string key="NSFrame">{{320, 150}, {185, 18}}</string>
<reference key="NSSuperview" ref="781284031"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="959000443">
@@ -3872,7 +3873,7 @@
<object class="NSTextField" id="317936232">
<reference key="NSNextResponder" ref="781284031"/>
<int key="NSvFlags">256</int>
- <string key="NSFrame">{{287, 34}, {29, 17}}</string>
+ <string key="NSFrame">{{287, 18}, {29, 17}}</string>
<reference key="NSSuperview" ref="781284031"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="435677462">
@@ -3888,7 +3889,7 @@
<object class="NSTextField" id="706801224">
<reference key="NSNextResponder" ref="781284031"/>
<int key="NSvFlags">256</int>
- <string key="NSFrame">{{284, 164}, {33, 17}}</string>
+ <string key="NSFrame">{{284, 148}, {33, 17}}</string>
<reference key="NSSuperview" ref="781284031"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="217675313">
@@ -3904,7 +3905,7 @@
<object class="NSTextField" id="591248388">
<reference key="NSNextResponder" ref="781284031"/>
<int key="NSvFlags">256</int>
- <string key="NSFrame">{{320, 36}, {185, 18}}</string>
+ <string key="NSFrame">{{320, 20}, {185, 18}}</string>
<reference key="NSSuperview" ref="781284031"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="343850840">
@@ -3922,7 +3923,7 @@
<object class="NSTextField" id="473901395">
<reference key="NSNextResponder" ref="781284031"/>
<int key="NSvFlags">256</int>
- <string key="NSFrame">{{259, 86}, {57, 17}}</string>
+ <string key="NSFrame">{{259, 70}, {57, 17}}</string>
<reference key="NSSuperview" ref="781284031"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="780018727">
@@ -3938,7 +3939,7 @@
<object class="NSTextField" id="719075675">
<reference key="NSNextResponder" ref="781284031"/>
<int key="NSvFlags">256</int>
- <string key="NSFrame">{{285, 141}, {32, 17}}</string>
+ <string key="NSFrame">{{285, 122}, {32, 17}}</string>
<reference key="NSSuperview" ref="781284031"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="778458567">
@@ -3954,7 +3955,7 @@
<object class="NSTextField" id="622703817">
<reference key="NSNextResponder" ref="781284031"/>
<int key="NSvFlags">256</int>
- <string key="NSFrame">{{320, 114}, {185, 18}}</string>
+ <string key="NSFrame">{{320, 98}, {185, 18}}</string>
<reference key="NSSuperview" ref="781284031"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="348978059">
@@ -3971,7 +3972,7 @@
<object class="NSTextField" id="387080032">
<reference key="NSNextResponder" ref="781284031"/>
<int key="NSvFlags">256</int>
- <string key="NSFrame">{{320, 88}, {185, 18}}</string>
+ <string key="NSFrame">{{320, 72}, {185, 18}}</string>
<reference key="NSSuperview" ref="781284031"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="535348279">
@@ -3989,7 +3990,7 @@
<object class="NSTextField" id="744530295">
<reference key="NSNextResponder" ref="781284031"/>
<int key="NSvFlags">256</int>
- <string key="NSFrame">{{320, 140}, {185, 18}}</string>
+ <string key="NSFrame">{{320, 124}, {185, 18}}</string>
<reference key="NSSuperview" ref="781284031"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="370939232">
@@ -4006,7 +4007,7 @@
<object class="NSTextField" id="452595742">
<reference key="NSNextResponder" ref="781284031"/>
<int key="NSvFlags">256</int>
- <string key="NSFrame">{{320, 62}, {185, 18}}</string>
+ <string key="NSFrame">{{320, 46}, {185, 18}}</string>
<reference key="NSSuperview" ref="781284031"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="538051351">
@@ -4024,7 +4025,7 @@
<object class="NSTextField" id="187305739">
<reference key="NSNextResponder" ref="781284031"/>
<int key="NSvFlags">256</int>
- <string key="NSFrame">{{273, 60}, {43, 17}}</string>
+ <string key="NSFrame">{{273, 44}, {43, 17}}</string>
<reference key="NSSuperview" ref="781284031"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="209896109">
@@ -4050,7 +4051,7 @@
<object class="NSTableView" id="158332213">
<reference key="NSNextResponder" ref="131927425"/>
<int key="NSvFlags">4352</int>
- <string key="NSFrameSize">{213, 157}</string>
+ <string key="NSFrameSize">{213, 167}</string>
<reference key="NSSuperview" ref="131927425"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTableHeaderView" key="NSHeaderView" id="975843240">
@@ -4095,7 +4096,6 @@
</object>
<int key="NSResizingMask">3</int>
<bool key="NSIsResizeable">YES</bool>
- <bool key="NSIsEditable">YES</bool>
<reference key="NSTableView" ref="158332213"/>
</object>
</object>
@@ -4111,8 +4111,9 @@
<bool key="NSAllowsTypeSelect">YES</bool>
</object>
</object>
- <string key="NSFrame">{{1, 17}, {213, 157}}</string>
+ <string key="NSFrame">{{1, 17}, {213, 167}}</string>
<reference key="NSSuperview" ref="112292194"/>
+ <reference key="NSNextKeyView" ref="158332213"/>
<reference key="NSDocView" ref="158332213"/>
<reference key="NSBGColor" ref="1024678221"/>
<int key="NScvFlags">4</int>
@@ -4145,14 +4146,16 @@
</object>
<string key="NSFrame">{{1, 0}, {213, 17}}</string>
<reference key="NSSuperview" ref="112292194"/>
+ <reference key="NSNextKeyView" ref="975843240"/>
<reference key="NSDocView" ref="975843240"/>
<reference key="NSBGColor" ref="1024678221"/>
<int key="NScvFlags">4</int>
</object>
<reference ref="1013344315"/>
</object>
- <string key="NSFrame">{{12, 34}, {215, 175}}</string>
+ <string key="NSFrame">{{12, 34}, {215, 185}}</string>
<reference key="NSSuperview" ref="781284031"/>
+ <reference key="NSNextKeyView" ref="131927425"/>
<int key="NSsFlags">562</int>
<reference key="NSVScroller" ref="785468991"/>
<reference key="NSHScroller" ref="710690013"/>
@@ -4164,7 +4167,7 @@
<object class="NSTextField" id="770654438">
<reference key="NSNextResponder" ref="781284031"/>
<int key="NSvFlags">256</int>
- <string key="NSFrame">{{259, 112}, {58, 17}}</string>
+ <string key="NSFrame">{{259, 96}, {58, 17}}</string>
<reference key="NSSuperview" ref="781284031"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="61722355">
@@ -4180,7 +4183,7 @@
<object class="NSTextField" id="223403285">
<reference key="NSNextResponder" ref="781284031"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{269, 192}, {236, 17}}</string>
+ <string key="NSFrame">{{269, 202}, {236, 17}}</string>
<reference key="NSSuperview" ref="781284031"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="605875122">
@@ -4200,77 +4203,83 @@
<object class="NSButton" id="79322639">
<reference key="NSNextResponder" ref="781284031"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{12, 13}, {28, 23}}</string>
+ <string key="NSFrame">{{12, 13}, {46, 23}}</string>
<reference key="NSSuperview" ref="781284031"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="745497435">
<int key="NSCellFlags">-2080244224</int>
- <int key="NSCellFlags2">134217728</int>
- <string key="NSContents"/>
- <reference key="NSSupport" ref="244931163"/>
+ <int key="NSCellFlags2">134348800</int>
+ <string key="NSContents">Edit...</string>
+ <reference key="NSSupport" ref="26"/>
<reference key="NSControlView" ref="79322639"/>
<int key="NSButtonFlags">-2033434369</int>
<int key="NSButtonFlags2">162</int>
- <object class="NSCustomResource" key="NSNormalImage" id="318135375">
- <string key="NSClassName">NSImage</string>
- <string key="NSResourceName">NSAddTemplate</string>
- </object>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">400</int>
<int key="NSPeriodicInterval">75</int>
</object>
</object>
- <object class="NSButton" id="63622597">
+ <object class="NSButton" id="799384073">
<reference key="NSNextResponder" ref="781284031"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{39, 13}, {28, 23}}</string>
+ <string key="NSFrame">{{57, 13}, {170, 23}}</string>
<reference key="NSSuperview" ref="781284031"/>
<bool key="NSEnabled">YES</bool>
- <object class="NSButtonCell" key="NSCell" id="316876744">
+ <object class="NSButtonCell" key="NSCell" id="151967533">
<int key="NSCellFlags">-2080244224</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents"/>
<reference key="NSSupport" ref="244931163"/>
- <reference key="NSControlView" ref="63622597"/>
- <int key="NSButtonFlags">-2033434369</int>
+ <reference key="NSControlView" ref="799384073"/>
+ <int key="NSButtonFlags">147603711</int>
<int key="NSButtonFlags2">162</int>
- <object class="NSCustomResource" key="NSNormalImage" id="837120569">
- <string key="NSClassName">NSImage</string>
- <string key="NSResourceName">NSRemoveTemplate</string>
- </object>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">400</int>
<int key="NSPeriodicInterval">75</int>
</object>
</object>
- <object class="NSButton" id="799384073">
+ <object class="NSTextField" id="480030144">
<reference key="NSNextResponder" ref="781284031"/>
- <int key="NSvFlags">268</int>
- <string key="NSFrame">{{66, 13}, {161, 23}}</string>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{320, 176}, {185, 18}}</string>
<reference key="NSSuperview" ref="781284031"/>
<bool key="NSEnabled">YES</bool>
- <object class="NSButtonCell" key="NSCell" id="151967533">
- <int key="NSCellFlags">-2080244224</int>
- <int key="NSCellFlags2">134217728</int>
+ <object class="NSTextFieldCell" key="NSCell" id="240173702">
+ <int key="NSCellFlags">-1804468671</int>
+ <int key="NSCellFlags2">4326400</int>
<string key="NSContents"/>
- <reference key="NSSupport" ref="244931163"/>
- <reference key="NSControlView" ref="799384073"/>
- <int key="NSButtonFlags">147603711</int>
- <int key="NSButtonFlags2">162</int>
- <string key="NSAlternateContents"/>
- <string key="NSKeyEquivalent"/>
- <int key="NSPeriodicDelay">400</int>
- <int key="NSPeriodicInterval">75</int>
+ <reference key="NSSupport" ref="26"/>
+ <string key="NSPlaceholderString">optional</string>
+ <reference key="NSControlView" ref="480030144"/>
+ <bool key="NSDrawsBackground">YES</bool>
+ <reference key="NSBackgroundColor" ref="480189472"/>
+ <reference key="NSTextColor" ref="690893883"/>
+ </object>
+ </object>
+ <object class="NSTextField" id="230979761">
+ <reference key="NSNextResponder" ref="781284031"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{237, 173}, {80, 18}}</string>
+ <reference key="NSSuperview" ref="781284031"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="443231554">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">71303168</int>
+ <string key="NSContents">Name:</string>
+ <reference key="NSSupport" ref="26"/>
+ <reference key="NSControlView" ref="230979761"/>
+ <reference key="NSBackgroundColor" ref="62854682"/>
+ <reference key="NSTextColor" ref="454249633"/>
</object>
</object>
</object>
- <string key="NSFrame">{{1, 1}, {523, 220}}</string>
+ <string key="NSFrame">{{1, 1}, {523, 230}}</string>
<reference key="NSSuperview" ref="248896606"/>
</object>
</object>
- <string key="NSFrame">{{-3, 42}, {525, 222}}</string>
+ <string key="NSFrame">{{-3, 44}, {525, 232}}</string>
<reference key="NSSuperview" ref="586457094"/>
<string key="NSOffsets">{0, 0}</string>
<object class="NSTextFieldCell" key="NSTitleCell">
@@ -4290,8 +4299,29 @@
<int key="NSTitlePosition">0</int>
<bool key="NSTransparent">NO</bool>
</object>
+ <object class="NSButton" id="55442463">
+ <reference key="NSNextResponder" ref="586457094"/>
+ <int key="NSvFlags">289</int>
+ <string key="NSFrame">{{184, 12}, {143, 32}}</string>
+ <reference key="NSSuperview" ref="586457094"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="729601679">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">134217728</int>
+ <string key="NSContents">Add to Favorites</string>
+ <reference key="NSSupport" ref="244931163"/>
+ <reference key="NSControlView" ref="55442463"/>
+ <int key="NSButtonFlags">-2038284033</int>
+ <int key="NSButtonFlags2">129</int>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
</object>
- <string key="NSFrameSize">{519, 335}</string>
+ <string key="NSFrameSize">{519, 347}</string>
+ <reference key="NSSuperview"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
<string key="NSMinSize">{256, 213}</string>
@@ -4450,7 +4480,7 @@
<object class="NSTextView" id="798764405">
<reference key="NSNextResponder" ref="593223452"/>
<int key="NSvFlags">2322</int>
- <string key="NSFrameSize">{588, 0}</string>
+ <string key="NSFrameSize">{588, 72}</string>
<reference key="NSSuperview" ref="593223452"/>
<object class="NSTextContainer" key="NSTextContainer" id="623412409">
<object class="NSLayoutManager" key="NSLayoutManager">
@@ -6826,7 +6856,10 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<reference key="NSControlView" ref="611899502"/>
<int key="NSButtonFlags">-2033434369</int>
<int key="NSButtonFlags2">162</int>
- <reference key="NSNormalImage" ref="318135375"/>
+ <object class="NSCustomResource" key="NSNormalImage">
+ <string key="NSClassName">NSImage</string>
+ <string key="NSResourceName">NSAddTemplate</string>
+ </object>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">400</int>
@@ -6847,7 +6880,10 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<reference key="NSControlView" ref="795238066"/>
<int key="NSButtonFlags">-2033434369</int>
<int key="NSButtonFlags2">162</int>
- <reference key="NSNormalImage" ref="837120569"/>
+ <object class="NSCustomResource" key="NSNormalImage">
+ <string key="NSClassName">NSImage</string>
+ <string key="NSResourceName">NSRemoveTemplate</string>
+ </object>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">400</int>
@@ -9908,10 +9944,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<string key="NSClassName">NSView</string>
</object>
<object class="NSUserDefaultsController" id="461189245">
- <object class="NSMutableArray" key="NSDeclaredKeys">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>favorites</string>
- </object>
<bool key="NSSharedInstance">YES</bool>
</object>
<object class="NSArrayController" id="302582105">
@@ -11389,14 +11421,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">nextKeyView</string>
- <reference key="source" ref="112292194"/>
- <reference key="destination" ref="252686319"/>
- </object>
- <int key="connectionID">4001</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">nextKeyView</string>
<reference key="source" ref="252686319"/>
<reference key="destination" ref="744530295"/>
</object>
@@ -11507,14 +11531,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<int key="connectionID">4505</int>
</object>
<object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">connectSheetAddToFavorites:</string>
- <reference key="source" ref="427689665"/>
- <reference key="destination" ref="79322639"/>
- </object>
- <int key="connectionID">4517</int>
- </object>
- <object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">initialFirstResponder</string>
<reference key="source" ref="207157706"/>
@@ -11736,14 +11752,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
- <string key="label">removeFavorite:</string>
- <reference key="source" ref="427689665"/>
- <reference key="destination" ref="316876744"/>
- </object>
- <int key="connectionID">4675</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
<string key="label">filterTable:</string>
<reference key="source" ref="392169872"/>
<reference key="destination" ref="983589239"/>
@@ -12526,6 +12534,74 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
</object>
<int key="connectionID">5388</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">editFavorites:</string>
+ <reference key="source" ref="427689665"/>
+ <reference key="destination" ref="79322639"/>
+ </object>
+ <int key="connectionID">5389</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBBindingConnection" key="connection">
+ <string key="label">enabled: canRemove</string>
+ <reference key="source" ref="55442463"/>
+ <reference key="destination" ref="302582105"/>
+ <object class="NSNibBindingConnector" key="connector">
+ <reference key="NSSource" ref="55442463"/>
+ <reference key="NSDestination" ref="302582105"/>
+ <string key="NSLabel">enabled: canRemove</string>
+ <string key="NSBinding">enabled</string>
+ <string key="NSKeyPath">canRemove</string>
+ <object class="NSDictionary" key="NSOptions">
+ <string key="NS.key.0">NSValueTransformerName</string>
+ <string key="NS.object.0">NSNegateBoolean</string>
+ </object>
+ <int key="NSNibBindingConnectorVersion">2</int>
+ </object>
+ </object>
+ <int key="connectionID">5397</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">connectSheetAddToFavorites:</string>
+ <reference key="source" ref="427689665"/>
+ <reference key="destination" ref="55442463"/>
+ </object>
+ <int key="connectionID">5398</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">delegate</string>
+ <reference key="source" ref="480030144"/>
+ <reference key="destination" ref="427689665"/>
+ </object>
+ <int key="connectionID">5403</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">nextKeyView</string>
+ <reference key="source" ref="480030144"/>
+ <reference key="destination" ref="252686319"/>
+ </object>
+ <int key="connectionID">5404</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">nameField</string>
+ <reference key="source" ref="427689665"/>
+ <reference key="destination" ref="480030144"/>
+ </object>
+ <int key="connectionID">5405</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">nextKeyView</string>
+ <reference key="source" ref="112292194"/>
+ <reference key="destination" ref="480030144"/>
+ </object>
+ <int key="connectionID">5406</int>
+ </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -12598,6 +12674,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<reference ref="565663839"/>
<reference ref="725657385"/>
<reference ref="248896606"/>
+ <reference ref="55442463"/>
</object>
<reference key="parent" ref="456332212"/>
</object>
@@ -12665,6 +12742,10 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<reference key="object" ref="248896606"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="112292194"/>
+ <reference ref="223403285"/>
+ <reference ref="799384073"/>
+ <reference ref="79322639"/>
<reference ref="252686319"/>
<reference ref="317936232"/>
<reference ref="706801224"/>
@@ -12676,12 +12757,9 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<reference ref="744530295"/>
<reference ref="452595742"/>
<reference ref="187305739"/>
- <reference ref="112292194"/>
<reference ref="770654438"/>
- <reference ref="223403285"/>
- <reference ref="63622597"/>
- <reference ref="799384073"/>
- <reference ref="79322639"/>
+ <reference ref="480030144"/>
+ <reference ref="230979761"/>
</object>
<reference key="parent" ref="586457094"/>
</object>
@@ -14842,20 +14920,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<reference key="parent" ref="79322639"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">4513</int>
- <reference key="object" ref="63622597"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="316876744"/>
- </object>
- <reference key="parent" ref="248896606"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">4514</int>
- <reference key="object" ref="316876744"/>
- <reference key="parent" ref="63622597"/>
- </object>
- <object class="IBObjectRecord">
<int key="objectID">4515</int>
<reference key="object" ref="799384073"/>
<object class="NSMutableArray" key="children">
@@ -17762,6 +17826,48 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<reference key="parent" ref="1043842561"/>
<string key="objectName">SPExportController</string>
</object>
+ <object class="IBObjectRecord">
+ <int key="objectID">5390</int>
+ <reference key="object" ref="55442463"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="729601679"/>
+ </object>
+ <reference key="parent" ref="586457094"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">5391</int>
+ <reference key="object" ref="729601679"/>
+ <reference key="parent" ref="55442463"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">5401</int>
+ <reference key="object" ref="480030144"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="240173702"/>
+ </object>
+ <reference key="parent" ref="248896606"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">5402</int>
+ <reference key="object" ref="240173702"/>
+ <reference key="parent" ref="480030144"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">5407</int>
+ <reference key="object" ref="230979761"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="443231554"/>
+ </object>
+ <reference key="parent" ref="248896606"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">5408</int>
+ <reference key="object" ref="443231554"/>
+ <reference key="parent" ref="230979761"/>
+ </object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
@@ -18497,8 +18603,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<string>4504.IBPluginDependency</string>
<string>4511.IBPluginDependency</string>
<string>4512.IBPluginDependency</string>
- <string>4513.IBPluginDependency</string>
- <string>4514.IBPluginDependency</string>
<string>4515.IBPluginDependency</string>
<string>4516.IBPluginDependency</string>
<string>4521.IBPluginDependency</string>
@@ -18876,6 +18980,14 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<string>5361.IBPluginDependency</string>
<string>5369.IBPluginDependency</string>
<string>5377.IBPluginDependency</string>
+ <string>5390.IBPluginDependency</string>
+ <string>5391.IBPluginDependency</string>
+ <string>5401.IBPluginDependency</string>
+ <string>5401.ImportedFromIB2</string>
+ <string>5402.IBPluginDependency</string>
+ <string>5407.IBPluginDependency</string>
+ <string>5407.ImportedFromIB2</string>
+ <string>5408.IBPluginDependency</string>
<string>557.IBPluginDependency</string>
<string>557.ImportedFromIB2</string>
<string>565.IBEditorWindowLastContentRect</string>
@@ -19754,8 +19866,8 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{397, 484}, {519, 335}}</string>
- <string>{{397, 484}, {519, 335}}</string>
+ <string>{{397, 472}, {519, 347}}</string>
+ <string>{{397, 472}, {519, 347}}</string>
<reference ref="9"/>
<string>{{136, 447}, {519, 335}}</string>
<reference ref="8"/>
@@ -19966,8 +20078,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{408, 721}, {417, 135}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
@@ -20489,6 +20599,14 @@ aGUgYWN0aXZlIHNlbGVjdGlvbiAo4oyl4oyYUik</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <reference ref="9"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
<string>{{456, 426}, {292, 112}}</string>
<string>{{456, 426}, {292, 112}}</string>
@@ -20759,7 +20877,7 @@ Y2hhbmdlIHRoZSBvcmRlcg</string>
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">5388</int>
+ <int key="maxID">5408</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -21288,6 +21406,7 @@ Y2hhbmdlIHRoZSBvcmRlcg</string>
<string>connectSheetAddToFavorites:</string>
<string>connectToDB:</string>
<string>copyCreateTableSyntax:</string>
+ <string>editFavorites:</string>
<string>export:</string>
<string>exportMultipleTables:</string>
<string>exportTable:</string>
@@ -21296,7 +21415,6 @@ Y2hhbmdlIHRoZSBvcmRlcg</string>
<string>import:</string>
<string>optimizeTable:</string>
<string>removeDatabase:</string>
- <string>removeFavorite:</string>
<string>repairTable:</string>
<string>setDatabases:</string>
<string>showCreateTableSyntax:</string>
@@ -21364,6 +21482,7 @@ Y2hhbmdlIHRoZSBvcmRlcg</string>
<string>favoritesController</string>
<string>hostField</string>
<string>keyChainInstance</string>
+ <string>nameField</string>
<string>passwordField</string>
<string>portField</string>
<string>queryProgressBar</string>
@@ -21417,6 +21536,7 @@ Y2hhbmdlIHRoZSBvcmRlcg</string>
<string>id</string>
<string>id</string>
<string>id</string>
+ <string>id</string>
<string>NSTabView</string>
<string>id</string>
<string>id</string>
diff --git a/Source/TableDocument.h b/Source/TableDocument.h
index f6019e58..10b780a5 100644
--- a/Source/TableDocument.h
+++ b/Source/TableDocument.h
@@ -54,6 +54,7 @@
IBOutlet id favoritesButton;
IBOutlet NSTableView *connectFavoritesTableView;
IBOutlet NSArrayController *favoritesController;
+ IBOutlet id nameField;
IBOutlet id hostField;
IBOutlet id socketField;
IBOutlet id userField;
@@ -86,7 +87,6 @@
NSString *selectedDatabase;
NSString *mySQLVersion;
NSUserDefaults *prefs;
- NSString *favoriteNameBeingChanged;
NSMenu *selectEncodingMenu;
BOOL _supportsEncoding;
@@ -107,11 +107,11 @@
- (IBAction)cancelConnectSheet:(id)sender;
- (IBAction)closeSheet:(id)sender;
- (IBAction)chooseFavorite:(id)sender;
-- (IBAction)removeFavorite:(id)sender;
+- (IBAction)editFavorites:(id)sender;
- (id)selectedFavorite;
- (NSString *)selectedFavoritePassword;
- (void)connectSheetAddToFavorites:(id)sender;
-- (void)addToFavoritesHost:(NSString *)host socket:(NSString *)socket
+- (void)addToFavoritesName:(NSString *)name host:(NSString *)host socket:(NSString *)socket
user:(NSString *)user password:(NSString *)password
port:(NSString *)port database:(NSString *)database
useSSH:(BOOL)useSSH // no-longer in use
@@ -164,6 +164,7 @@
- (void)closeConnection;
//getter methods
+- (NSString *)name;
- (NSString *)database;
- (NSString *)table;
- (NSString *)mySQLVersion;
diff --git a/Source/TableDocument.m b/Source/TableDocument.m
index 97e3ecbc..f58b9b29 100644
--- a/Source/TableDocument.m
+++ b/Source/TableDocument.m
@@ -75,6 +75,7 @@ NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocum
// register double click for the favorites view (double click favorite to connect)
[connectFavoritesTableView setTarget:self];
+ [connectFavoritesTableView setDoubleAction:@selector(connect:)];
// find the Database -> Database Encoding menu (it's not in our nib, so we can't use interface builder)
selectEncodingMenu = [[[[[NSApp mainMenu] itemWithTag:1] submenu] itemWithTag:1] submenu];
@@ -240,6 +241,7 @@ NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocum
// Connect automatically to the last used or default favourite
// connectSheet must open first.
if (_shouldOpenConnectionAutomatically) {
+ _shouldOpenConnectionAutomatically = false;
[self connect:self];
}
}
@@ -341,8 +343,7 @@ NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocum
[tableDataInstance setConnection:mySQLConnection];
[self setFileName:[NSString stringWithFormat:@"(MySQL %@) %@@%@ %@", mySQLVersion, [userField stringValue],
[hostField stringValue], [databaseField stringValue]]];
- [tableWindow setTitle:[NSString stringWithFormat:@"(MySQL %@) %@@%@/%@", mySQLVersion, [userField stringValue],
- [hostField stringValue], [databaseField stringValue]]];
+ [tableWindow setTitle:[NSString stringWithFormat:@"(MySQL %@) %@/%@", mySQLVersion, [self name], [databaseField stringValue]]];
// Connected Growl notification
[[SPGrowlController sharedGrowlController] notifyWithTitle:@"Connected"
@@ -391,6 +392,7 @@ NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocum
if (![self selectedFavorite])
return;
+ [nameField setStringValue:[self valueForKeyPath:@"selectedFavorite.name"]];
[hostField setStringValue:[self valueForKeyPath:@"selectedFavorite.host"]];
[socketField setStringValue:[self valueForKeyPath:@"selectedFavorite.socket"]];
[userField setStringValue:[self valueForKeyPath:@"selectedFavorite.user"]];
@@ -402,28 +404,11 @@ NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocum
}
/**
- * Remove the selected favourite. Instead of calling the remove: method of the Favorites NSArrayController
- * directly in the XIB we do it here because we also need to remove the keychain password.
+ * Opens the preferences window, or brings it to the front, and switch to the favorites tab.
+ * If a favorite is selected in the connection sheet, it is also select in the prefs window.
*/
-- (IBAction)removeFavorite:(id)sender
+- (IBAction)editFavorites:(id)sender
{
- if (![self selectedFavorite]) {
- return;
- }
-
- NSString *name = [self valueForKeyPath:@"selectedFavorite.name"];
- NSString *user = [self valueForKeyPath:@"selectedFavorite.user"];
- NSString *host = [self valueForKeyPath:@"selectedFavorite.host"];
- NSString *database = [self valueForKeyPath:@"selectedFavorite.database"];
- int favoriteid = [[self valueForKeyPath:@"selectedFavorite.id"] intValue];
-
- [keyChainInstance deletePasswordForName:[NSString stringWithFormat:@"Sequel Pro : %@ (%i)", name, favoriteid]
- account:[NSString stringWithFormat:@"%@@%@/%@", user, host, database]];
- [keyChainInstance deletePasswordForName:[NSString stringWithFormat:@"Sequel Pro SSHTunnel : %@ (%i)", name, favoriteid]
- account:[NSString stringWithFormat:@"%@@%@/%@", user, host, database]];
-
- // Remove from favorites array controller
- [favoritesController remove:[self selectedFavorite]];
}
@@ -459,24 +444,24 @@ NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocum
- (void)connectSheetAddToFavorites:(id)sender
{
- [self addToFavoritesHost:[hostField stringValue] socket:[socketField stringValue] user:[userField stringValue] password:[passwordField stringValue] port:[portField stringValue] database:[databaseField stringValue] useSSH:false sshHost:@"" sshUser:@"" sshPassword:@"" sshPort:@""];
+ [self addToFavoritesName:[nameField stringValue] host:[hostField stringValue] socket:[socketField stringValue] user:[userField stringValue] password:[passwordField stringValue] port:[portField stringValue] database:[databaseField stringValue] useSSH:false sshHost:@"" sshUser:@"" sshPassword:@"" sshPort:@""];
}
/**
* add actual connection to favorites
*/
-- (void)addToFavoritesHost:(NSString *)host socket:(NSString *)socket
- user:(NSString *)user password:(NSString *)password
- port:(NSString *)port database:(NSString *)database
- useSSH:(BOOL)useSSH // no-longer in use
- sshHost:(NSString *)sshHost // no-longer in use
- sshUser:(NSString *)sshUser // no-longer in use
- sshPassword:(NSString *)sshPassword // no-longer in use
- sshPort:(NSString *)sshPort // no-longer in use
+- (void)addToFavoritesName:(NSString *)name host:(NSString *)host socket:(NSString *)socket
+ user:(NSString *)user password:(NSString *)password
+ port:(NSString *)port database:(NSString *)database
+ useSSH:(BOOL)useSSH // no-longer in use
+ sshHost:(NSString *)sshHost // no-longer in use
+ sshUser:(NSString *)sshUser // no-longer in use
+ sshPassword:(NSString *)sshPassword // no-longer in use
+ sshPort:(NSString *)sshPort // no-longer in use
{
- NSString *favoriteName = [NSString stringWithFormat:@"%@@%@", user, host];
+ NSString *favoriteName = [name length]?name:[NSString stringWithFormat:@"%@@%@", user, host];
NSNumber *favoriteid = [NSNumber numberWithInt:[[NSString stringWithFormat:@"%f", [[NSDate date] timeIntervalSince1970]] hash]];
- if (![database isEqualToString:@""])
+ if (![name length] && ![database isEqualToString:@""])
favoriteName = [NSString stringWithFormat:@"%@ %@", database, favoriteName];
// test if host and socket are not nil
@@ -529,7 +514,7 @@ NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocum
[self setDatabases:self];
[tablesListInstance setConnection:mySQLConnection];
[tableDumpInstance setConnection:mySQLConnection];
- [tableWindow setTitle:[NSString stringWithFormat:@"(MySQL %@) %@@%@/", mySQLVersion, [userField stringValue], [hostField stringValue]]];
+ [tableWindow setTitle:[NSString stringWithFormat:@"(MySQL %@) %@/", mySQLVersion, [self name]]];
}
}
@@ -601,7 +586,7 @@ NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocum
selectedDatabase = [[chooseDatabaseButton titleOfSelectedItem] retain];
[tablesListInstance setConnection:mySQLConnection];
[tableDumpInstance setConnection:mySQLConnection];
- [tableWindow setTitle:[NSString stringWithFormat:@"(MySQL %@) %@@%@/%@", mySQLVersion, [userField stringValue], [hostField stringValue], [self database]]];
+ [tableWindow setTitle:[NSString stringWithFormat:@"(MySQL %@) %@/%@", mySQLVersion, [self name], [self database]]];
}
/**
@@ -670,7 +655,7 @@ NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocum
[self setDatabases:self];
[tablesListInstance setConnection:mySQLConnection];
[tableDumpInstance setConnection:mySQLConnection];
- [tableWindow setTitle:[NSString stringWithFormat:@"(MySQL %@) %@@%@/%@", mySQLVersion, [userField stringValue], [hostField stringValue], selectedDatabase]];
+ [tableWindow setTitle:[NSString stringWithFormat:@"(MySQL %@) %@/%@", mySQLVersion, [self name], selectedDatabase]];
}
/**
@@ -1239,6 +1224,17 @@ NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocum
}
/**
+ * Returns the name
+ */
+- (NSString *)name
+{
+ if ([[nameField stringValue] length]) {
+ return [nameField stringValue];
+ }
+ return [NSString stringWithFormat:@"%@@%@", [userField stringValue], [hostField stringValue]];
+}
+
+/**
* Passes query to tablesListInstance
*/
- (void)doPerformQueryService:(NSString *)query
@@ -1860,8 +1856,10 @@ NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocum
*/
- (void) controlTextDidChange:(NSNotification *)aNotification
{
- if ([aNotification object] == hostField || [aNotification object] == userField || [aNotification object] == passwordField
- || [aNotification object] == databaseField || [aNotification object] == socketField || [aNotification object] == portField) {
+ if ([aNotification object] == nameField || [aNotification object] == hostField
+ || [aNotification object] == userField || [aNotification object] == passwordField
+ || [aNotification object] == databaseField || [aNotification object] == socketField
+ || [aNotification object] == portField) {
[favoritesController setSelectionIndexes:[NSIndexSet indexSet]];
}
else if ([aNotification object] == databaseNameField) {
@@ -1956,46 +1954,6 @@ NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocum
return theValue;
}
-/**
- * Although the connection sheet tableview uses bindings to display the favourites we implement this method in
- * order to update the keychain associated with favourites that are renamed. Its not the best approach, but it works.
- */
-- (void)tableView:(NSTableView *)tableView setObjectValue:(id)object forTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)rowIndex
-{
- NSDictionary *favorite = [[favoritesController arrangedObjects] objectAtIndex:rowIndex];
- NSMutableDictionary *newFavorite;
-
- [keyChainInstance deletePasswordForName:[NSString stringWithFormat:@"Sequel Pro : %@ (%i)", favoriteNameBeingChanged, [[favorite objectForKey:@"id"] intValue]]
- account:[NSString stringWithFormat:@"%@@%@/%@", [favorite objectForKey:@"user"], [favorite objectForKey:@"host"], [favorite objectForKey:@"database"]]];
-
- if ([[passwordField stringValue] length]) {
- [keyChainInstance addPassword:[passwordField stringValue]
- forName:[NSString stringWithFormat:@"Sequel Pro : %@ (%i)", object, [[favorite objectForKey:@"id"] intValue]]
- account:[NSString stringWithFormat:@"%@@%@/%@", [favorite objectForKey:@"user"], [favorite objectForKey:@"host"], [favorite objectForKey:@"database"]]];
- }
-
- // Update the favorites array controller
- newFavorite = [NSMutableDictionary dictionaryWithDictionary:favorite];
- [newFavorite setObject:[NSString stringWithString:object] forKey:@"name"];
- [favoritesController insertObject:newFavorite atArrangedObjectIndex:rowIndex];
- [favoritesController removeObjectAtArrangedObjectIndex:(rowIndex+1)];
- [favoritesController setSelectionIndex:rowIndex];
-
- favoriteNameBeingChanged = nil;
-}
-
-/**
- * We implement this method so we can get the name of the favourtie before its renamed. We need the name so we
- * look it up in the keychain and update its name, which is done in the above method. This is obviously not the
- * best approach to doing this as it means we need an ivar just to track the favourite that is about to be renamed.
- */
-- (BOOL)tableView:(NSTableView *)tableView shouldEditTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)rowIndex
-{
- favoriteNameBeingChanged = [[[favoritesController arrangedObjects] objectAtIndex:rowIndex] objectForKey:@"name"];
-
- return YES;
-}
-
- (IBAction)terminate:(id)sender
{
[[NSApp orderedDocuments] makeObjectsPerformSelector:@selector(cancelConnectSheet:) withObject:nil];
diff --git a/Source/TablesList.m b/Source/TablesList.m
index 148c7ab2..ef1f3531 100644
--- a/Source/TablesList.m
+++ b/Source/TablesList.m
@@ -179,8 +179,8 @@
}
// Set window title
- [tableWindow setTitle:[NSString stringWithFormat:@"(MySQL %@) %@@%@/%@/%@", [tableDocumentInstance mySQLVersion], [tableDocumentInstance user],
- [tableDocumentInstance host], [tableDocumentInstance database], tableName]];
+ [tableWindow setTitle:[NSString stringWithFormat:@"(MySQL %@) %@/%@/%@", [tableDocumentInstance mySQLVersion],
+ [tableDocumentInstance name], [tableDocumentInstance database], tableName]];
}
else {
// Error while creating new table
@@ -397,8 +397,8 @@
[tablesListView reloadData];
// set window title
- [tableWindow setTitle:[NSString stringWithFormat:@"(MySQL %@) %@@%@/%@", [tableDocumentInstance mySQLVersion], [tableDocumentInstance user],
- [tableDocumentInstance host], [tableDocumentInstance database]]];
+ [tableWindow setTitle:[NSString stringWithFormat:@"(MySQL %@) %@/%@", [tableDocumentInstance mySQLVersion],
+ [tableDocumentInstance name], [tableDocumentInstance database]]];
if ( error )
NSBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, tableWindow, self, nil, nil, nil,
[NSString stringWithFormat:NSLocalizedString(@"Couldn't remove table.\nMySQL said: %@", @"message of panel when table cannot be removed"), errorText]);
@@ -579,8 +579,8 @@
}
// Set window title
- [tableWindow setTitle:[NSString stringWithFormat:@"(MySQL %@) %@@%@/%@/%@", [tableDocumentInstance mySQLVersion], [tableDocumentInstance user],
- [tableDocumentInstance host], [tableDocumentInstance database], anObject]];
+ [tableWindow setTitle:[NSString stringWithFormat:@"(MySQL %@) %@/%@/%@", [tableDocumentInstance mySQLVersion],
+ [tableDocumentInstance name], [tableDocumentInstance database], anObject]];
}
else {
// Error while renaming
@@ -685,8 +685,8 @@
}
// set window title
- [tableWindow setTitle:[NSString stringWithFormat:@"(MySQL %@) %@@%@/%@/%@", [tableDocumentInstance mySQLVersion], [tableDocumentInstance user],
- [tableDocumentInstance host], [tableDocumentInstance database], [tables objectAtIndex:[tablesListView selectedRow]]]];
+ [tableWindow setTitle:[NSString stringWithFormat:@"(MySQL %@) %@/%@/%@", [tableDocumentInstance mySQLVersion],
+ [tableDocumentInstance name], [tableDocumentInstance database], [tables objectAtIndex:[tablesListView selectedRow]]]];
} else {
[tableSourceInstance loadTable:nil];
[tableContentInstance loadTable:nil];
@@ -696,8 +696,8 @@
statusLoaded = NO;
// set window title
- [tableWindow setTitle:[NSString stringWithFormat:@"(MySQL %@) %@@%@/%@", [tableDocumentInstance mySQLVersion], [tableDocumentInstance user],
- [tableDocumentInstance host], [tableDocumentInstance database]]];
+ [tableWindow setTitle:[NSString stringWithFormat:@"(MySQL %@) %@/%@", [tableDocumentInstance mySQLVersion],
+ [tableDocumentInstance name], [tableDocumentInstance database]]];
}
}