aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2010-03-27 01:25:27 +0000
committerstuconnolly <stuart02@gmail.com>2010-03-27 01:25:27 +0000
commit0201464cf3c23d82ea5a476d9224e82ec5b2e479 (patch)
treee6bdbfc862150282094ae51ecc94b4663ca18870
parent7c2de8d57e2ef4e463ae788ab2b58b019c8c9828 (diff)
downloadsequelpro-0201464cf3c23d82ea5a476d9224e82ec5b2e479.tar.gz
sequelpro-0201464cf3c23d82ea5a476d9224e82ec5b2e479.tar.bz2
sequelpro-0201464cf3c23d82ea5a476d9224e82ec5b2e479.zip
Add a contextual menu to the favorites table view in the preferences.
-rw-r--r--Interfaces/English.lproj/Preferences.xib157
-rw-r--r--Source/SPPreferenceController.h3
-rw-r--r--Source/SPPreferenceController.m64
3 files changed, 145 insertions, 79 deletions
diff --git a/Interfaces/English.lproj/Preferences.xib b/Interfaces/English.lproj/Preferences.xib
index f71065f5..b08bd332 100644
--- a/Interfaces/English.lproj/Preferences.xib
+++ b/Interfaces/English.lproj/Preferences.xib
@@ -12,6 +12,8 @@
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
+ <integer value="1547"/>
+ <integer value="406"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -57,7 +59,7 @@
<string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string>
</object>
<object class="NSCustomView" id="594324362">
- <reference key="NSNextResponder"/>
+ <nil key="NSNextResponder"/>
<int key="NSvFlags">268</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -66,7 +68,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{151, 121}, {254, 26}}</string>
<reference key="NSSuperview" ref="594324362"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSPopUpButtonCell" key="NSCell" id="562129977">
<int key="NSCellFlags">-2076049856</int>
@@ -404,7 +405,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{152, 214}, {209, 18}}</string>
<reference key="NSSuperview" ref="594324362"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="964808674">
<int key="NSCellFlags">67239424</int>
@@ -432,7 +432,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{40, 242}, {108, 17}}</string>
<reference key="NSSuperview" ref="594324362"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="996600667">
<int key="NSCellFlags">68288064</int>
@@ -465,7 +464,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{151, 236}, {254, 26}}</string>
<reference key="NSSuperview" ref="594324362"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSPopUpButtonCell" key="NSCell" id="406329678">
<int key="NSCellFlags">-2076049856</int>
@@ -498,7 +496,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{33, 85}, {116, 17}}</string>
<reference key="NSSuperview" ref="594324362"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="513222356">
<int key="NSCellFlags">68288064</int>
@@ -515,7 +512,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{33, 127}, {116, 17}}</string>
<reference key="NSSuperview" ref="594324362"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="163779676">
<int key="NSCellFlags">68288064</int>
@@ -532,7 +528,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{152, 84}, {166, 18}}</string>
<reference key="NSSuperview" ref="594324362"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="530413242">
<int key="NSCellFlags">67239424</int>
@@ -555,7 +550,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{152, 62}, {181, 18}}</string>
<reference key="NSSuperview" ref="594324362"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="218042555">
<int key="NSCellFlags">67239424</int>
@@ -578,7 +572,6 @@
<int key="NSvFlags">12</int>
<string key="NSFrame">{{154, 156}, {326, 5}}</string>
<reference key="NSSuperview" ref="594324362"/>
- <reference key="NSWindow"/>
<string key="NSOffsets">{0, 0}</string>
<object class="NSTextFieldCell" key="NSTitleCell">
<int key="NSCellFlags">67239424</int>
@@ -609,7 +602,6 @@
<int key="NSvFlags">12</int>
<string key="NSFrame">{{154, 108}, {326, 5}}</string>
<reference key="NSSuperview" ref="594324362"/>
- <reference key="NSWindow"/>
<string key="NSOffsets">{0, 0}</string>
<object class="NSTextFieldCell" key="NSTitleCell">
<int key="NSCellFlags">67239424</int>
@@ -632,7 +624,6 @@
<int key="NSvFlags">12</int>
<string key="NSFrame">{{154, 53}, {326, 5}}</string>
<reference key="NSSuperview" ref="594324362"/>
- <reference key="NSWindow"/>
<string key="NSOffsets">{0, 0}</string>
<object class="NSTextFieldCell" key="NSTitleCell">
<int key="NSCellFlags">67239424</int>
@@ -655,7 +646,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{42, 23}, {106, 17}}</string>
<reference key="NSSuperview" ref="594324362"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="899935643">
<int key="NSCellFlags">68288064</int>
@@ -672,7 +662,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{153, 20}, {38, 22}}</string>
<reference key="NSSuperview" ref="594324362"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="875775803">
<int key="NSCellFlags">-1804468671</int>
@@ -749,7 +738,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{197, 23}, {162, 17}}</string>
<reference key="NSSuperview" ref="594324362"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="710086132">
<int key="NSCellFlags">68288064</int>
@@ -766,7 +754,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{151, 169}, {254, 26}}</string>
<reference key="NSSuperview" ref="594324362"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSPopUpButtonCell" key="NSCell" id="404009397">
<int key="NSCellFlags">-2076049856</int>
@@ -890,7 +877,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{61, 175}, {88, 17}}</string>
<reference key="NSSuperview" ref="594324362"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="840580273">
<int key="NSCellFlags">68288064</int>
@@ -907,7 +893,6 @@
<int key="NSvFlags">12</int>
<string key="NSFrame">{{154, 204}, {326, 5}}</string>
<reference key="NSSuperview" ref="594324362"/>
- <reference key="NSWindow"/>
<string key="NSOffsets">{0, 0}</string>
<object class="NSTextFieldCell" key="NSTitleCell">
<int key="NSCellFlags">67239424</int>
@@ -927,12 +912,10 @@
</object>
</object>
<string key="NSFrameSize">{500, 280}</string>
- <reference key="NSSuperview"/>
- <reference key="NSWindow"/>
<string key="NSClassName">NSView</string>
</object>
<object class="NSCustomView" id="395894064">
- <reference key="NSNextResponder"/>
+ <nil key="NSNextResponder"/>
<int key="NSvFlags">268</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -941,7 +924,6 @@
<int key="NSvFlags">289</int>
<string key="NSFrame">{{395, 12}, {90, 32}}</string>
<reference key="NSSuperview" ref="395894064"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="828765183">
<int key="NSCellFlags">67239424</int>
@@ -962,7 +944,6 @@
<int key="NSvFlags">289</int>
<string key="NSFrame">{{163, 20}, {221, 19}}</string>
<reference key="NSSuperview" ref="395894064"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="82174450">
<int key="NSCellFlags">-2076049856</int>
@@ -984,7 +965,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{162, 56}, {320, 26}}</string>
<reference key="NSSuperview" ref="395894064"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSPopUpButtonCell" key="NSCell" id="323591102">
<int key="NSCellFlags">-2076049856</int>
@@ -1054,7 +1034,6 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{8, 22}, {148, 17}}</string>
<reference key="NSSuperview" ref="395894064"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="578929076">
<int key="NSCellFlags">68288064</int>
@@ -1071,7 +1050,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{17, 62}, {140, 17}}</string>
<reference key="NSSuperview" ref="395894064"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="449580049">
<int key="NSCellFlags">68288064</int>
@@ -1088,7 +1066,6 @@
<int key="NSvFlags">12</int>
<string key="NSFrame">{{163, 86}, {316, 5}}</string>
<reference key="NSSuperview" ref="395894064"/>
- <reference key="NSWindow"/>
<string key="NSOffsets">{0, 0}</string>
<object class="NSTextFieldCell" key="NSTitleCell">
<int key="NSCellFlags">67239424</int>
@@ -1111,7 +1088,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{161, 238}, {123, 18}}</string>
<reference key="NSSuperview" ref="395894064"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="7693853">
<int key="NSCellFlags">67239424</int>
@@ -1134,7 +1110,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{32, 277}, {125, 17}}</string>
<reference key="NSSuperview" ref="395894064"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="524603578">
<int key="NSCellFlags">67239488</int>
@@ -1151,7 +1126,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{383, 144}, {38, 17}}</string>
<reference key="NSSuperview" ref="395894064"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="596167553">
<int key="NSCellFlags">67239488</int>
@@ -1168,7 +1142,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{161, 278}, {106, 18}}</string>
<reference key="NSSuperview" ref="395894064"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="29938940">
<int key="NSCellFlags">-2080244224</int>
@@ -1191,7 +1164,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{161, 143}, {115, 18}}</string>
<reference key="NSSuperview" ref="395894064"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="920748663">
<int key="NSCellFlags">67239424</int>
@@ -1214,7 +1186,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{161, 258}, {105, 18}}</string>
<reference key="NSSuperview" ref="395894064"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="516443326">
<int key="NSCellFlags">-2080244224</int>
@@ -1237,7 +1208,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{362, 138}, {19, 27}}</string>
<reference key="NSSuperview" ref="395894064"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSStepperCell" key="NSCell" id="1061407286">
<int key="NSCellFlags">917024</int>
@@ -1256,7 +1226,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{282, 141}, {75, 22}}</string>
<reference key="NSSuperview" ref="395894064"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="585678618">
<int key="NSCellFlags">-1804468672</int>
@@ -1327,7 +1296,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{14, 99}, {143, 17}}</string>
<reference key="NSSuperview" ref="395894064"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="609090823">
<int key="NSCellFlags">68288064</int>
@@ -1344,7 +1312,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{163, 97}, {75, 22}}</string>
<reference key="NSSuperview" ref="395894064"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="82744709">
<int key="NSCellFlags">-1804468671</int>
@@ -1363,7 +1330,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{161, 198}, {297, 18}}</string>
<reference key="NSSuperview" ref="395894064"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="441275">
<int key="NSCellFlags">67239424</int>
@@ -1386,7 +1352,6 @@
<int key="NSvFlags">12</int>
<string key="NSFrame">{{163, 45}, {316, 5}}</string>
<reference key="NSSuperview" ref="395894064"/>
- <reference key="NSWindow"/>
<string key="NSOffsets">{0, 0}</string>
<object class="NSTextFieldCell" key="NSTitleCell">
<int key="NSCellFlags">67239424</int>
@@ -1409,7 +1374,6 @@
<int key="NSvFlags">12</int>
<string key="NSFrame">{{163, 224}, {316, 5}}</string>
<reference key="NSSuperview" ref="395894064"/>
- <reference key="NSWindow"/>
<string key="NSOffsets">{0, 0}</string>
<object class="NSTextFieldCell" key="NSTitleCell">
<int key="NSCellFlags">67239424</int>
@@ -1432,7 +1396,6 @@
<int key="NSvFlags">12</int>
<string key="NSFrame">{{163, 169}, {316, 5}}</string>
<reference key="NSSuperview" ref="395894064"/>
- <reference key="NSWindow"/>
<string key="NSOffsets">{0, 0}</string>
<object class="NSTextFieldCell" key="NSTitleCell">
<int key="NSCellFlags">67239424</int>
@@ -1455,7 +1418,6 @@
<int key="NSvFlags">12</int>
<string key="NSFrame">{{163, 130}, {316, 5}}</string>
<reference key="NSSuperview" ref="395894064"/>
- <reference key="NSWindow"/>
<string key="NSOffsets">{0, 0}</string>
<object class="NSTextFieldCell" key="NSTitleCell">
<int key="NSCellFlags">67239424</int>
@@ -1478,7 +1440,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{161, 178}, {206, 18}}</string>
<reference key="NSSuperview" ref="395894064"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="542131730">
<int key="NSCellFlags">-2080244224</int>
@@ -1498,12 +1459,10 @@
</object>
</object>
<string key="NSFrameSize">{499, 316}</string>
- <reference key="NSSuperview"/>
- <reference key="NSWindow"/>
<string key="NSClassName">NSView</string>
</object>
<object class="NSCustomView" id="593732956">
- <nil key="NSNextResponder"/>
+ <reference key="NSNextResponder"/>
<int key="NSvFlags">274</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -2564,6 +2523,7 @@
</object>
</object>
<string key="NSFrameSize">{500, 381}</string>
+ <reference key="NSSuperview"/>
<string key="NSClassName">NSView</string>
</object>
<object class="NSCustomView" id="1041614321">
@@ -4143,6 +4103,38 @@ AQAAAAA</bytes>
<object class="NSCustomObject" id="721264488">
<string key="NSClassName">SUUpdater</string>
</object>
+ <object class="NSMenu" id="982657201">
+ <string key="NSTitle"/>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="30395779">
+ <reference key="NSMenu" ref="982657201"/>
+ <string key="NSTitle">Remove Favorite</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="1039721224"/>
+ <reference key="NSMixedImage" ref="720177216"/>
+ </object>
+ <object class="NSMenuItem" id="102426580">
+ <reference key="NSMenu" ref="982657201"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="1039721224"/>
+ <reference key="NSMixedImage" ref="720177216"/>
+ </object>
+ <object class="NSMenuItem" id="580038192">
+ <reference key="NSMenu" ref="982657201"/>
+ <string key="NSTitle">Duplicate Favorite</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="1039721224"/>
+ <reference key="NSMixedImage" ref="720177216"/>
+ </object>
+ </object>
+ </object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
<object class="NSMutableArray" key="connectionRecords">
@@ -6396,6 +6388,38 @@ AQAAAAA</bytes>
</object>
<int key="connectionID">1545</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">menu</string>
+ <reference key="source" ref="279932544"/>
+ <reference key="destination" ref="982657201"/>
+ </object>
+ <int key="connectionID">1552</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">removeFavorite:</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="30395779"/>
+ </object>
+ <int key="connectionID">1553</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">duplicateFavorite:</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="580038192"/>
+ </object>
+ <int key="connectionID">1554</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">delegate</string>
+ <reference key="source" ref="982657201"/>
+ <reference key="destination" ref="1001"/>
+ </object>
+ <int key="connectionID">1555</int>
+ </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -9039,6 +9063,33 @@ AQAAAAA</bytes>
<reference key="object" ref="628895309"/>
<reference key="parent" ref="1007936999"/>
</object>
+ <object class="IBObjectRecord">
+ <int key="objectID">1547</int>
+ <reference key="object" ref="982657201"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="30395779"/>
+ <reference ref="580038192"/>
+ <reference ref="102426580"/>
+ </object>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">Context Menu</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">1548</int>
+ <reference key="object" ref="30395779"/>
+ <reference key="parent" ref="982657201"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">1549</int>
+ <reference key="object" ref="580038192"/>
+ <reference key="parent" ref="982657201"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">1551</int>
+ <reference key="object" ref="102426580"/>
+ <reference key="parent" ref="982657201"/>
+ </object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
@@ -9272,6 +9323,11 @@ AQAAAAA</bytes>
<string>1542.IBPluginDependency</string>
<string>1543.IBPluginDependency</string>
<string>1546.IBPluginDependency</string>
+ <string>1547.IBEditorWindowLastContentRect</string>
+ <string>1547.IBPluginDependency</string>
+ <string>1548.IBPluginDependency</string>
+ <string>1549.IBPluginDependency</string>
+ <string>1551.IBPluginDependency</string>
<string>17.IBEditorWindowLastContentRect</string>
<string>17.IBPluginDependency</string>
<string>17.IBUserGuides</string>
@@ -9767,6 +9823,11 @@ AQAAAAA</bytes>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{{908, 461}, {175, 53}}</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>{{571, 222}, {500, 280}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSMutableArray">
@@ -9848,7 +9909,7 @@ AQAAAAA</bytes>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
- <string>{{467, 270}, {500, 381}}</string>
+ <string>{{627, 350}, {500, 381}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -10150,7 +10211,7 @@ AQAAAAA</bytes>
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">1546</int>
+ <int key="maxID">1555</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
diff --git a/Source/SPPreferenceController.h b/Source/SPPreferenceController.h
index 62babfed..e8e7a50d 100644
--- a/Source/SPPreferenceController.h
+++ b/Source/SPPreferenceController.h
@@ -89,8 +89,7 @@
- (IBAction)addFavorite:(id)sender;
- (IBAction)removeFavorite:(id)sender;
- (IBAction)duplicateFavorite:(id)sender;
-- (IBAction)saveFavorite:(id)sender;
-- (IBAction)updateDefaultFavorite:(id)sender;
+ - (IBAction)updateDefaultFavorite:(id)sender;
- (IBAction)showCustomQueryFontPanel:(id)sender;
- (IBAction)showGlobalResultTableFontPanel:(id)sender;
- (IBAction)setDefaultColors:(id)sender;
diff --git a/Source/SPPreferenceController.m b/Source/SPPreferenceController.m
index e365f296..af80ba7f 100644
--- a/Source/SPPreferenceController.m
+++ b/Source/SPPreferenceController.m
@@ -49,6 +49,7 @@
{
if (self = [super initWithWindowNibName:@"Preferences"]) {
prefs = [NSUserDefaults standardUserDefaults];
+
[self applyRevisionChanges];
currentFavorite = nil;
@@ -410,14 +411,6 @@
}
// -------------------------------------------------------------------------------
-// saveFavorite:
-// -------------------------------------------------------------------------------
-- (IBAction)saveFavorite:(id)sender
-{
-
-}
-
-// -------------------------------------------------------------------------------
// updateDefaultFavorite:
// -------------------------------------------------------------------------------
- (IBAction)updateDefaultFavorite:(id)sender
@@ -558,15 +551,15 @@
// -------------------------------------------------------------------------------
- (BOOL)tableView:(NSTableView *)aTableView writeRowsWithIndexes:(NSIndexSet *)rows toPasteboard:(NSPasteboard*)pboard
{
-
if ([rows count] == 1) {
[pboard declareTypes:[NSArray arrayWithObject:SPFavoritesPasteboardDragType] owner:nil];
[pboard setString:[[NSNumber numberWithInteger:[rows firstIndex]] stringValue] forType:SPFavoritesPasteboardDragType];
+
return YES;
- } else {
+ }
+ else {
return NO;
}
-
}
// -------------------------------------------------------------------------------
@@ -627,6 +620,7 @@
if ([prefs integerForKey:SPDefaultFavorite] == originalRow) {
[prefs setInteger:destinationRow forKey:SPDefaultFavorite];
}
+
[self updateDefaultFavoritePopup];
return YES;
@@ -777,7 +771,6 @@
// -------------------------------------------------------------------------------
- (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor
{
-
// Request a password refresh to keep keychain references in synch with favorites
[self updateFavoritePasswordsFromField:control];
@@ -793,8 +786,8 @@
// -------------------------------------------------------------------------------
- (void)controlTextDidChange:(NSNotification *)aNotification
{
-
id field = [aNotification object];
+
BOOL nameFieldIsEmpty = (
[[favoritesController valueForKeyPath:@"selection.name"] isEqualToString:@""]
|| [[favoriteNameTextField stringValue] isEqualToString:@""]);
@@ -831,11 +824,9 @@
break;
}
-
if(field == favoriteNameTextField) {
favoriteNameFieldWasTouched = YES;
}
-
}
// -------------------------------------------------------------------------------
// favoriteTypeDidChange:
@@ -843,7 +834,6 @@
// -------------------------------------------------------------------------------
- (IBAction)favoriteTypeDidChange:(id)sender
{
-
// If not socket and host is localhost, clear.
if ([sender indexOfSelectedItem] != 1
&& [[favoritesController valueForKeyPath:@"selection.host"] isEqualToString:@"localhost"])
@@ -963,11 +953,9 @@
// -------------------------------------------------------------------------------
- (void)windowWillClose:(NSNotification *)notification
{
-
// Mark the currently selected field in the window as having finished editing, to trigger saves.
if ([preferencesWindow firstResponder])
[preferencesWindow endEditingFor:[preferencesWindow firstResponder]];
-
}
#pragma mark -
@@ -1072,10 +1060,10 @@
[[NSFontPanel sharedFontPanel] setPanelFont:[NSUnarchiver unarchiveObjectWithData:[prefs dataForKey:SPCustomQueryEditorFont]] isMultiple:NO];
[[NSFontPanel sharedFontPanel] makeKeyAndOrderFront:self];
}
+
// reset syntax highlighting colors
- (IBAction)setDefaultColors:(id)sender
{
-
[prefs setObject:[NSArchiver archivedDataWithRootObject:[NSColor colorWithDeviceRed:0.000 green:0.455 blue:0.000 alpha:1.000]] forKey:SPCustomQueryEditorCommentColor];
[prefs setObject:[NSArchiver archivedDataWithRootObject:[NSColor colorWithDeviceRed:0.769 green:0.102 blue:0.086 alpha:1.000]] forKey:SPCustomQueryEditorQuoteColor];
[prefs setObject:[NSArchiver archivedDataWithRootObject:[NSColor colorWithDeviceRed:0.200 green:0.250 blue:1.000 alpha:1.000]] forKey:SPCustomQueryEditorSQLKeywordColor];
@@ -1086,7 +1074,6 @@
[prefs setObject:[NSArchiver archivedDataWithRootObject:[NSColor blackColor]] forKey:SPCustomQueryEditorTextColor];
[prefs setObject:[NSArchiver archivedDataWithRootObject:[NSColor blackColor]] forKey:SPCustomQueryEditorCaretColor];
[prefs setObject:[NSArchiver archivedDataWithRootObject:[NSColor whiteColor]] forKey:SPCustomQueryEditorBackgroundColor];
-
}
// Set font panel's valid modes
@@ -1099,20 +1086,39 @@
- (void)changeFont:(id)sender
{
NSFont *nf;
- switch(fontChangeTarget) {
+
+ switch(fontChangeTarget)
+ {
case 1:
- nf = [[NSFontPanel sharedFontPanel] panelConvertFont:[NSUnarchiver unarchiveObjectWithData:[prefs dataForKey:SPGlobalResultTableFont]]];
- [prefs setObject:[NSArchiver archivedDataWithRootObject:nf] forKey:SPGlobalResultTableFont];
- [globalResultTableFontName setStringValue:[NSString stringWithFormat:@"%@, %.1f pt", [nf displayName], [nf pointSize]]];
- break;
+ nf = [[NSFontPanel sharedFontPanel] panelConvertFont:[NSUnarchiver unarchiveObjectWithData:[prefs dataForKey:SPGlobalResultTableFont]]];
+ [prefs setObject:[NSArchiver archivedDataWithRootObject:nf] forKey:SPGlobalResultTableFont];
+ [globalResultTableFontName setStringValue:[NSString stringWithFormat:@"%@, %.1f pt", [nf displayName], [nf pointSize]]];
+ break;
case 2:
- nf = [[NSFontPanel sharedFontPanel] panelConvertFont:[NSUnarchiver unarchiveObjectWithData:[prefs dataForKey:SPCustomQueryEditorFont]]];
- [prefs setObject:[NSArchiver archivedDataWithRootObject:nf] forKey:SPCustomQueryEditorFont];
- [editorFontName setStringValue:[NSString stringWithFormat:@"%@, %.1f pt", [nf displayName], [nf pointSize]]];
- break;
+ nf = [[NSFontPanel sharedFontPanel] panelConvertFont:[NSUnarchiver unarchiveObjectWithData:[prefs dataForKey:SPCustomQueryEditorFont]]];
+ [prefs setObject:[NSArchiver archivedDataWithRootObject:nf] forKey:SPCustomQueryEditorFont];
+ [editorFontName setStringValue:[NSString stringWithFormat:@"%@, %.1f pt", [nf displayName], [nf pointSize]]];
+ break;
}
}
+/**
+ * Menu item validation;
+ */
+- (BOOL)validateMenuItem:(NSMenuItem *)menuItem
+{
+ SEL action = [menuItem action];
+
+ if ((action == @selector(removeFavorite:)) || (action == @selector(duplicateFavorite:))) {
+ return ([favoritesTableView numberOfSelectedRows] > 0);
+ }
+
+ return [super validateMenuItem:menuItem];
+}
+
+
+#pragma mark -
+
// -------------------------------------------------------------------------------
// dealloc
// -------------------------------------------------------------------------------
5'>1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912