aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2009-08-28 16:27:20 +0000
committerBibiko <bibiko@eva.mpg.de>2009-08-28 16:27:20 +0000
commit480e035307bfc2dfa5feee16dacd43150b520d6a (patch)
tree1b6eb7f50a3334acbcf9575f1a941bd01a62eb9a
parentc5db2b046cd823442ef7783446334accd084c332 (diff)
downloadsequelpro-480e035307bfc2dfa5feee16dacd43150b520d6a.tar.gz
sequelpro-480e035307bfc2dfa5feee16dacd43150b520d6a.tar.bz2
sequelpro-480e035307bfc2dfa5feee16dacd43150b520d6a.zip
• moved "Replace Editor Content" (Favorites/History) settings from popup lists to gear menu since these are settings
• revert the actual behaviour for "Save ... to Favorite" to "Save All to Favorite" since this was the default behaviour in previous releases - to restrict what should be save as favorite press ⌘ to toggle "Save All to Favorite" into "Save current query/selection to Favorite" • while choosing a favorite or history item each modifier key ⇧,^,⌥, or ⌘ inverts the current setting for "Replace Editor Content"
-rw-r--r--Interfaces/English.lproj/DBView.xib277
-rw-r--r--Source/CustomQuery.m77
2 files changed, 206 insertions, 148 deletions
diff --git a/Interfaces/English.lproj/DBView.xib b/Interfaces/English.lproj/DBView.xib
index b1d78499..35c6f941 100644
--- a/Interfaces/English.lproj/DBView.xib
+++ b/Interfaces/English.lproj/DBView.xib
@@ -8,7 +8,6 @@
<string key="IBDocument.HIToolboxVersion">353.00</string>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="663"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -47,7 +46,7 @@
<string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string>
<string key="NSWindowContentMinSize">{780, 480}</string>
<object class="NSView" key="NSWindowView" id="579726586">
- <reference key="NSNextResponder"/>
+ <nil key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -2856,29 +2855,6 @@
<object class="NSTextView" id="1055190999">
<reference key="NSNextResponder" ref="1072692119"/>
<int key="NSvFlags">6418</int>
- <object class="NSMutableSet" key="NSDragTypes">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSMutableArray" key="set.sortedObjects">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>Apple HTML pasteboard type</string>
- <string>Apple PDF pasteboard type</string>
- <string>Apple PICT pasteboard type</string>
- <string>Apple PNG pasteboard type</string>
- <string>Apple URL pasteboard type</string>
- <string>CorePasteboardFlavorType 0x6D6F6F76</string>
- <string>CorePasteboardFlavorType 0x75726C20</string>
- <string>NSColor pasteboard type</string>
- <string>NSFilenamesPboardType</string>
- <string>NSStringPboardType</string>
- <string>NeXT Encapsulated PostScript v1.2 pasteboard type</string>
- <string>NeXT RTFD pasteboard type</string>
- <string>NeXT Rich Text Format v1.0 pasteboard type</string>
- <string>NeXT TIFF v4.0 pasteboard type</string>
- <string>NeXT font pasteboard type</string>
- <string>NeXT ruler pasteboard type</string>
- <string>WebURLsWithTitlesPboardType</string>
- </object>
- </object>
<string key="NSFrameSize">{688, 14}</string>
<reference key="NSSuperview" ref="1072692119"/>
<object class="NSTextContainer" key="NSTextContainer" id="326170846">
@@ -3143,30 +3119,9 @@
<object class="NSMutableArray" key="NSMenuItems">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="13183167"/>
- <object class="NSMenuItem" id="96807437">
- <reference key="NSMenu" ref="766637184"/>
- <string key="NSTitle">Replace Editor Content</string>
- <string key="NSKeyEquiv"/>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="450876295"/>
- <reference key="NSMixedImage" ref="414351669"/>
- <string key="NSAction">_popUpItemAction:</string>
- <reference key="NSTarget" ref="830957297"/>
- </object>
- <object class="NSMenuItem" id="744554218">
- <reference key="NSMenu" ref="766637184"/>
- <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="450876295"/>
- <reference key="NSMixedImage" ref="414351669"/>
- <string key="NSAction">_popUpItemAction:</string>
- <reference key="NSTarget" ref="830957297"/>
- </object>
<object class="NSMenuItem" id="252023923">
<reference key="NSMenu" ref="766637184"/>
+ <bool key="NSIsHidden">YES</bool>
<string key="NSTitle">..placeholder for seachfield..</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
@@ -3177,7 +3132,6 @@
</object>
</object>
</object>
- <int key="NSSelectedIndex">1</int>
<bool key="NSPullDown">YES</bool>
<int key="NSPreferredEdge">3</int>
<bool key="NSUsesItemFromMenu">YES</bool>
@@ -3233,14 +3187,16 @@
<int key="NSTag">1000</int>
<reference key="NSTarget" ref="416049103"/>
</object>
- <object class="NSMenuItem" id="601952975">
+ <object class="NSMenuItem" id="336702336">
<reference key="NSMenu" ref="960790892"/>
- <string key="NSTitle">Replace Editor Content</string>
+ <bool key="NSIsAlternate">YES</bool>
+ <string key="NSTitle">Save All to Favorites</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="450876295"/>
<reference key="NSMixedImage" ref="414351669"/>
<string key="NSAction">_popUpItemAction:</string>
+ <int key="NSTag">1001</int>
<reference key="NSTarget" ref="416049103"/>
</object>
<object class="NSMenuItem" id="560786252">
@@ -3278,7 +3234,7 @@
</object>
</object>
</object>
- <int key="NSSelectedIndex">2</int>
+ <int key="NSSelectedIndex">1</int>
<bool key="NSPullDown">YES</bool>
<int key="NSPreferredEdge">3</int>
<bool key="NSUsesItemFromMenu">YES</bool>
@@ -3398,6 +3354,16 @@
<int key="NSTag">5</int>
<reference key="NSTarget" ref="984501775"/>
</object>
+ <object class="NSMenuItem" id="128208712">
+ <reference key="NSMenu" ref="60735230"/>
+ <string key="NSTitle">History Replaces Editor Content</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="450876295"/>
+ <reference key="NSMixedImage" ref="414351669"/>
+ <string key="NSAction">_popUpItemAction:</string>
+ <reference key="NSTarget" ref="984501775"/>
+ </object>
<object class="NSMenuItem" id="371024017">
<reference key="NSMenu" ref="60735230"/>
<bool key="NSIsDisabled">YES</bool>
@@ -3410,6 +3376,28 @@
<string key="NSAction">_popUpItemAction:</string>
<reference key="NSTarget" ref="984501775"/>
</object>
+ <object class="NSMenuItem" id="594285746">
+ <reference key="NSMenu" ref="60735230"/>
+ <string key="NSTitle">Favorite Replaces Editor Content</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="450876295"/>
+ <reference key="NSMixedImage" ref="414351669"/>
+ <string key="NSAction">_popUpItemAction:</string>
+ <reference key="NSTarget" ref="984501775"/>
+ </object>
+ <object class="NSMenuItem" id="635467451">
+ <reference key="NSMenu" ref="60735230"/>
+ <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="450876295"/>
+ <reference key="NSMixedImage" ref="414351669"/>
+ <string key="NSAction">_popUpItemAction:</string>
+ <reference key="NSTarget" ref="984501775"/>
+ </object>
<object class="NSMenuItem" id="1041161373">
<reference key="NSMenu" ref="60735230"/>
<string key="NSTitle">Shift Right</string>
@@ -3540,7 +3528,7 @@
</object>
<bool key="NSNoAutoenable">YES</bool>
</object>
- <int key="NSSelectedIndex">15</int>
+ <int key="NSSelectedIndex">18</int>
<bool key="NSPullDown">YES</bool>
<int key="NSPreferredEdge">1</int>
<bool key="NSUsesItemFromMenu">YES</bool>
@@ -4749,7 +4737,6 @@
</object>
</object>
<string key="NSFrameSize">{944, 550}</string>
- <reference key="NSSuperview"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1920, 1178}}</string>
<string key="NSMinSize">{780, 502}</string>
@@ -11360,7 +11347,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<string key="NSClassName">NSView</string>
</object>
<object class="NSCustomView" id="532635418">
- <reference key="NSNextResponder"/>
+ <nil key="NSNextResponder"/>
<int key="NSvFlags">4364</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -11369,7 +11356,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{20, 1}, {176, 19}}</string>
<reference key="NSSuperview" ref="532635418"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSSearchFieldCell" key="NSCell" id="1072338815">
<int key="NSCellFlags">343014976</int>
@@ -11431,12 +11417,10 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
</object>
</object>
<string key="NSFrameSize">{217, 20}</string>
- <reference key="NSSuperview"/>
- <reference key="NSWindow"/>
<string key="NSClassName">NSView</string>
</object>
<object class="NSCustomView" id="456635389">
- <reference key="NSNextResponder"/>
+ <nil key="NSNextResponder"/>
<int key="NSvFlags">4364</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -11445,7 +11429,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{20, 1}, {176, 19}}</string>
<reference key="NSSuperview" ref="456635389"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSSearchFieldCell" key="NSCell" id="292622292">
<int key="NSCellFlags">343014976</int>
@@ -11507,8 +11490,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
</object>
</object>
<string key="NSFrameSize">{217, 20}</string>
- <reference key="NSSuperview"/>
- <reference key="NSWindow"/>
<string key="NSClassName">NSView</string>
</object>
<object class="NSUserDefaultsController" id="461189245">
@@ -15283,22 +15264,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<int key="connectionID">6421</int>
</object>
<object class="IBConnectionRecord">
- <object class="IBBindingConnection" key="connection">
- <string key="label">value: values.QueryFavoriteReplacesContent</string>
- <reference key="source" ref="601952975"/>
- <reference key="destination" ref="461189245"/>
- <object class="NSNibBindingConnector" key="connector">
- <reference key="NSSource" ref="601952975"/>
- <reference key="NSDestination" ref="461189245"/>
- <string key="NSLabel">value: values.QueryFavoriteReplacesContent</string>
- <string key="NSBinding">value</string>
- <string key="NSKeyPath">values.QueryFavoriteReplacesContent</string>
- <int key="NSNibBindingConnectorVersion">2</int>
- </object>
- </object>
- <int key="connectionID">6428</int>
- </object>
- <object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">queryFavoritesSearchMenuItem</string>
<reference key="source" ref="601471102"/>
@@ -15347,22 +15312,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<int key="connectionID">6440</int>
</object>
<object class="IBConnectionRecord">
- <object class="IBBindingConnection" key="connection">
- <string key="label">value: values.QueryHistoryReplacesContent</string>
- <reference key="source" ref="96807437"/>
- <reference key="destination" ref="461189245"/>
- <object class="NSNibBindingConnector" key="connector">
- <reference key="NSSource" ref="96807437"/>
- <reference key="NSDestination" ref="461189245"/>
- <string key="NSLabel">value: values.QueryHistoryReplacesContent</string>
- <string key="NSBinding">value</string>
- <string key="NSKeyPath">values.QueryHistoryReplacesContent</string>
- <int key="NSNibBindingConnectorVersion">2</int>
- </object>
- </object>
- <int key="connectionID">6443</int>
- </object>
- <object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">queryHistorySearchMenuItem</string>
<reference key="source" ref="601471102"/>
@@ -15434,6 +15383,54 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
</object>
<int key="connectionID">6459</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBBindingConnection" key="connection">
+ <string key="label">value: values.QueryFavoriteReplacesContent</string>
+ <reference key="source" ref="594285746"/>
+ <reference key="destination" ref="461189245"/>
+ <object class="NSNibBindingConnector" key="connector">
+ <reference key="NSSource" ref="594285746"/>
+ <reference key="NSDestination" ref="461189245"/>
+ <string key="NSLabel">value: values.QueryFavoriteReplacesContent</string>
+ <string key="NSBinding">value</string>
+ <string key="NSKeyPath">values.QueryFavoriteReplacesContent</string>
+ <int key="NSNibBindingConnectorVersion">2</int>
+ </object>
+ </object>
+ <int key="connectionID">6464</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBBindingConnection" key="connection">
+ <string key="label">value: values.QueryHistoryReplacesContent</string>
+ <reference key="source" ref="128208712"/>
+ <reference key="destination" ref="461189245"/>
+ <object class="NSNibBindingConnector" key="connector">
+ <reference key="NSSource" ref="128208712"/>
+ <reference key="NSDestination" ref="461189245"/>
+ <string key="NSLabel">value: values.QueryHistoryReplacesContent</string>
+ <string key="NSBinding">value</string>
+ <string key="NSKeyPath">values.QueryHistoryReplacesContent</string>
+ <int key="NSNibBindingConnectorVersion">2</int>
+ </object>
+ </object>
+ <int key="connectionID">6465</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">nextKeyView</string>
+ <reference key="source" ref="86760255"/>
+ <reference key="destination" ref="388856443"/>
+ </object>
+ <int key="connectionID">6467</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">nextKeyView</string>
+ <reference key="source" ref="872178320"/>
+ <reference key="destination" ref="57646700"/>
+ </object>
+ <int key="connectionID">6468</int>
+ </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -18222,6 +18219,9 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<reference ref="414081589"/>
<reference ref="837073672"/>
<reference ref="241706230"/>
+ <reference ref="594285746"/>
+ <reference ref="635467451"/>
+ <reference ref="128208712"/>
</object>
<reference key="parent" ref="984501775"/>
</object>
@@ -18333,8 +18333,8 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<reference ref="5128219"/>
<reference ref="560786252"/>
<reference ref="17413925"/>
- <reference ref="601952975"/>
<reference ref="50932569"/>
+ <reference ref="336702336"/>
</object>
<reference key="parent" ref="416049103"/>
</object>
@@ -18368,8 +18368,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="13183167"/>
- <reference ref="96807437"/>
- <reference ref="744554218"/>
<reference ref="252023923"/>
</object>
<reference key="parent" ref="830957297"/>
@@ -21602,11 +21600,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<reference key="parent" ref="960790892"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">6423</int>
- <reference key="object" ref="601952975"/>
- <reference key="parent" ref="960790892"/>
- </object>
- <object class="IBObjectRecord">
<int key="objectID">6424</int>
<reference key="object" ref="50932569"/>
<reference key="parent" ref="960790892"/>
@@ -21636,16 +21629,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<reference key="parent" ref="57646700"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">6441</int>
- <reference key="object" ref="96807437"/>
- <reference key="parent" ref="766637184"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">6444</int>
- <reference key="object" ref="744554218"/>
- <reference key="parent" ref="766637184"/>
- </object>
- <object class="IBObjectRecord">
<int key="objectID">6445</int>
<reference key="object" ref="252023923"/>
<reference key="parent" ref="766637184"/>
@@ -21674,6 +21657,26 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<reference key="object" ref="292622292"/>
<reference key="parent" ref="388856443"/>
</object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6460</int>
+ <reference key="object" ref="635467451"/>
+ <reference key="parent" ref="60735230"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6461</int>
+ <reference key="object" ref="128208712"/>
+ <reference key="parent" ref="60735230"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6462</int>
+ <reference key="object" ref="594285746"/>
+ <reference key="parent" ref="60735230"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6466</int>
+ <reference key="object" ref="336702336"/>
+ <reference key="parent" ref="960790892"/>
+ </object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
@@ -21778,6 +21781,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<string>1178.IBEditorWindowLastContentRect</string>
<string>1178.IBPluginDependency</string>
<string>1178.ImportedFromIB2</string>
+ <string>1180.IBAttributePlaceholdersKey</string>
<string>1180.IBPluginDependency</string>
<string>1180.ImportedFromIB2</string>
<string>1181.IBPluginDependency</string>
@@ -22950,21 +22954,23 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<string>6413.IBPluginDependency</string>
<string>6414.IBPluginDependency</string>
<string>6422.IBPluginDependency</string>
- <string>6423.IBPluginDependency</string>
<string>6424.IBPluginDependency</string>
<string>6431.IBEditorWindowLastContentRect</string>
<string>6431.IBPluginDependency</string>
<string>6432.IBAttributePlaceholdersKey</string>
<string>6432.IBPluginDependency</string>
<string>6433.IBPluginDependency</string>
- <string>6441.IBPluginDependency</string>
- <string>6444.IBPluginDependency</string>
<string>6445.IBPluginDependency</string>
<string>6447.IBEditorWindowLastContentRect</string>
<string>6447.IBPluginDependency</string>
<string>6448.IBAttributePlaceholdersKey</string>
<string>6448.IBPluginDependency</string>
<string>6449.IBPluginDependency</string>
+ <string>6460.IBPluginDependency</string>
+ <string>6461.IBPluginDependency</string>
+ <string>6462.IBPluginDependency</string>
+ <string>6466.IBAttributePlaceholdersKey</string>
+ <string>6466.IBPluginDependency</string>
<string>654.IBPluginDependency</string>
<string>654.ImportedFromIB2</string>
<string>655.IBPluginDependency</string>
@@ -23284,7 +23290,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<object class="IBToolTipAttribute" key="NS.object.0">
<string key="name">ToolTip</string>
<reference key="object" ref="86760255"/>
- <string key="toolTip">Choose a query from your recent queries</string>
+ <string type="base64-UTF8" key="toolTip">Q2hvb3NlIGEgcXVlcnkgZnJvbSB5b3VyIHJlY2VudCBxdWVyaWVzICjijKXijJhIKQ</string>
</object>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -23293,9 +23299,17 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<reference ref="9"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
- <string>{{424, 709}, {215, 98}}</string>
+ <string>{{323, 485}, {215, 98}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
+ <object class="NSMutableDictionary">
+ <string key="NS.key.0">ToolTip</string>
+ <object class="IBToolTipAttribute" key="NS.object.0">
+ <string key="name">ToolTip</string>
+ <reference key="object" ref="5128219"/>
+ <string key="toolTip">Save current query, selection, or - if no selection or current query could be found - the entire content to Favorite.</string>
+ </object>
+ </object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -23305,12 +23319,13 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<object class="IBToolTipAttribute" key="NS.object.0">
<string key="name">ToolTip</string>
<reference key="object" ref="872178320"/>
- <string key="toolTip">Choose a favorite from the menu or save the current query to the favorites</string>
+ <string type="base64-UTF8" key="toolTip">Q2hvb3NlIGEgZmF2b3JpdGUgZnJvbSB0aGUgbWVudSBvciBzYXZlIHF1ZXJpZXMgdG8gdGhlIGZhdm9y
+aXRlcyAo4oyl4oyYRik</string>
</object>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
- <string>{{542, 743}, {215, 64}}</string>
+ <string>{{516, 546}, {215, 37}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -23969,9 +23984,9 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{167, 430}, {944, 550}}</string>
+ <string>{{66, 206}, {944, 550}}</string>
<boolean value="NO"/>
- <string>{{167, 430}, {944, 550}}</string>
+ <string>{{66, 206}, {944, 550}}</string>
<reference ref="9"/>
<reference ref="9"/>
<string>{{62, 352}, {845, 504}}</string>
@@ -24137,7 +24152,7 @@ aGUgYWN0aXZlIHNlbGVjdGlvbiAo4oyl4oyYUik</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{381, 414}, {236, 305}}</string>
+ <string>{{350, 236}, {259, 349}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -24794,8 +24809,7 @@ 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>{{409, 828}, {217, 20}}</string>
+ <string>{{409, 736}, {217, 20}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSMutableDictionary">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -24809,8 +24823,6 @@ 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>
<string>{{419, 772}, {217, 20}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSMutableDictionary">
@@ -24825,6 +24837,19 @@ 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>
+ <object class="NSMutableDictionary">
+ <string key="NS.key.0">ToolTip</string>
+ <object class="IBToolTipAttribute" key="NS.object.0">
+ <string key="name">ToolTip</string>
+ <reference key="object" ref="336702336"/>
+ <string type="base64-UTF8" key="toolTip">U2F2ZSBlZGl0b3IgY29udGVudCB0byBGYXZvcml0ZS4gUHJlc3Mg4oyYIHRvIHJlc3RyaWN0IGZvciBj
+dXJyZW50IHF1ZXJ5IG9yIHNlbGVjdGlvbi4</string>
+ </object>
+ </object>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
@@ -25020,7 +25045,7 @@ aGUgYWN0aXZlIHNlbGVjdGlvbiAo4oyl4oyYUik</string>
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">6459</int>
+ <int key="maxID">6468</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m
index 48d3eb96..17ca6d35 100644
--- a/Source/CustomQuery.m
+++ b/Source/CustomQuery.m
@@ -147,12 +147,28 @@
NSLocalizedString(@"Cannot save an empty query.", @"empty query informative message"));
return;
}
+
+ [NSApp beginSheet:queryFavoritesSheet
+ modalForWindow:tableWindow
+ modalDelegate:self
+ didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:)
+ contextInfo:@"addSelectionToNewQueryFavorite"];
+ }
+ if ([queryFavoritesButton indexOfSelectedItem] == 2) {
+ // This should never evaluate to true as we are now performing menu validation, meaning the 'Save Query to Favorites' menu item will
+ // only be enabled if the query text view has at least one character present.
+ if ([[textView string] isEqualToString:@""]) {
+ NSBeginAlertSheet(NSLocalizedString(@"Empty query", @"empty query message"), NSLocalizedString(@"OK", @"OK button"), nil, nil, tableWindow, self, nil, nil, nil,
+ NSLocalizedString(@"Cannot save an empty query.", @"empty query informative message"));
+ return;
+ }
+
[NSApp beginSheet:queryFavoritesSheet
modalForWindow:tableWindow
modalDelegate:self
didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:)
- contextInfo:@"addNewQueryFavorite"];
+ contextInfo:@"addAllToNewQueryFavorite"];
}
else if ([queryFavoritesButton indexOfSelectedItem] == 3) {
// Open query favorite manager
@@ -164,7 +180,11 @@
}
else if ([queryFavoritesButton indexOfSelectedItem] > 5) {
// Choose favorite
- if([prefs boolForKey:@"QueryFavoriteReplacesContent"])
+ BOOL replaceContent = [prefs boolForKey:@"QueryFavoriteReplacesContent"];
+
+ if([[NSApp currentEvent] modifierFlags] & (NSShiftKeyMask|NSControlKeyMask|NSAlternateKeyMask|NSCommandKeyMask))
+ replaceContent = !replaceContent;
+ if(replaceContent)
[textView setSelectedRange:NSMakeRange(0,[[textView string] length])];
[textView insertText:[[[prefs objectForKey:@"queryFavorites"] objectAtIndex:([queryFavoritesButton indexOfSelectedItem] - 6)] objectForKey:@"query"]];
@@ -177,9 +197,15 @@
- (IBAction)chooseQueryHistory:(id)sender
{
// Choose history item
- if ([queryHistoryButton indexOfSelectedItem] > 3) {
- if([prefs boolForKey:@"QueryHistoryReplacesContent"])
+ if ([queryHistoryButton indexOfSelectedItem] > 1) {
+;
+ BOOL replaceContent = [prefs boolForKey:@"QueryHistoryReplacesContent"];
+
+ if([[NSApp currentEvent] modifierFlags] & (NSShiftKeyMask|NSControlKeyMask|NSAlternateKeyMask|NSCommandKeyMask))
+ replaceContent = !replaceContent;
+ if(replaceContent)
[textView setSelectedRange:NSMakeRange(0,[[textView string] length])];
+
[textView insertText:[queryHistoryButton titleOfSelectedItem]];
}
}
@@ -202,7 +228,7 @@
// "Clear History" menu item - clear query history
if (sender == clearHistoryMenuItem) {
// Remove all history buttons beginning from the end
- while([queryHistoryButton numberOfItems] > 4)
+ while([queryHistoryButton numberOfItems] > 2)
[queryHistoryButton removeItemAtIndex:[queryHistoryButton numberOfItems]-1];
// [queryHistoryButton addItemWithTitle:NSLocalizedString(@"Query History…",@"Title of query history popup button")];
@@ -452,14 +478,14 @@
// if(!queriesSeparatedByDelimiter) { // TODO only add to history if no “delimiter” command was used
if(!tableReloadAfterEditing && [usedQuery length]) {
- [queryHistoryButton insertItemWithTitle:usedQuery atIndex:4];
+ [queryHistoryButton insertItemWithTitle:usedQuery atIndex:2];
int maxHistoryItems = [[prefs objectForKey:@"CustomQueryMaxHistoryItems"] intValue];
- while ( [queryHistoryButton numberOfItems] > maxHistoryItems + 4 )
+ while ( [queryHistoryButton numberOfItems] > maxHistoryItems + 2 )
[queryHistoryButton removeItemAtIndex:[queryHistoryButton numberOfItems]-1];
- for ( i = 4 ; i < [queryHistoryButton numberOfItems] ; i++ )
+ for ( i = 2 ; i < [queryHistoryButton numberOfItems] ; i++ )
[menuItems addObject:[queryHistoryButton itemTitleAtIndex:i]];
[prefs setObject:menuItems forKey:@"queryHistory"];
@@ -1831,11 +1857,9 @@
[saveQueryFavoriteButton setEnabled:[[queryFavoriteNameTextField stringValue] length]];
else if ([notification object] == queryFavoritesSearchField){
[self filterQueryFavorites:nil];
- [[saveQueryFavoriteButton menu] sizeToFit];
}
else if ([notification object] == queryHistorySearchField) {
[self filterQueryHistory:nil];
- [[queryHistoryButton menu] sizeToFit];
}
}
@@ -2408,25 +2432,30 @@
*/
- (void)sheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(NSString *)contextInfo
{
- if ([contextInfo isEqualToString:@"addNewQueryFavorite"]) {
+ if ([contextInfo isEqualToString:@"addAllToNewQueryFavorite"] || [contextInfo isEqualToString:@"addSelectionToNewQueryFavorite"]) {
if (returnCode == NSOKButton) {
// Add the new query favorite directly the user's preferences here instead of asking the manager to do it
// as it may not have been fully initialized yet.
NSMutableArray *favorites = [NSMutableArray arrayWithArray:[prefs objectForKey:@"queryFavorites"]];
-
+
// What should be saved
NSString *queryToBeAddded;
- // First check for a selection
- if([textView selectedRange].length)
- queryToBeAddded = [[textView string] substringWithRange:[textView selectedRange]];
- // then for a current query
- else if(currentQueryRange.length)
- queryToBeAddded = [[textView string] substringWithRange:currentQueryRange];
- // otherwise take the entire string
- else
+
+ if([contextInfo isEqualToString:@"addSelectionToNewQueryFavorite"]) {
+ // First check for a selection
+ if([textView selectedRange].length)
+ queryToBeAddded = [[textView string] substringWithRange:[textView selectedRange]];
+ // then for a current query
+ else if(currentQueryRange.length)
+ queryToBeAddded = [[textView string] substringWithRange:currentQueryRange];
+ // otherwise take the entire string
+ else
+ queryToBeAddded = [textView string];
+ } else {
queryToBeAddded = [textView string];
-
+ }
+
[favorites addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:[queryFavoriteNameTextField stringValue], queryToBeAddded, nil] forKeys:[NSArray arrayWithObjects:@"name", @"query", nil]]];
[prefs setObject:favorites forKey:@"queryFavorites"];
@@ -2454,6 +2483,10 @@
else
[menuItem setTitle:NSLocalizedString(@"Save All to Favorites",@"Save All to Favorites")];
}
+ // Control "Save All to Favorites" = tag is set to 1001
+ if ( [menuItem tag] == 1001 ) {
+ if ([[textView string] length] < 1) return NO;
+ }
return YES;
}
@@ -2513,7 +2546,7 @@
{
int i;
NSMenu *menu = [queryHistoryButton menu];
- for (i=4; i< [menu numberOfItems]; i++)
+ for (i=2; i< [menu numberOfItems]; i++)
[[menu itemAtIndex:i] setHidden:(![[[menu itemAtIndex:i] title] isMatchedByRegex:[NSString stringWithFormat:@"(?i).*%@.*", [queryHistorySearchField stringValue]]])];
}