aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAbhi Beckert <abhi@abhibeckert.com>2014-09-06 14:21:51 +1000
committerAbhi Beckert <abhi@abhibeckert.com>2014-09-06 14:21:51 +1000
commit29be07630c2a965d01bb61fa2cc9d9f14dd4a8b5 (patch)
tree4bb0d46f01edd077262dc17bc631b61cf1ef1abb
parent310fb079c75d551bf2a129b69c897905ca83e061 (diff)
parentc49bbd2c8e35b39a8c7262f2671c3ad3c8bb2cea (diff)
downloadsequelpro-29be07630c2a965d01bb61fa2cc9d9f14dd4a8b5.tar.gz
sequelpro-29be07630c2a965d01bb61fa2cc9d9f14dd4a8b5.tar.bz2
sequelpro-29be07630c2a965d01bb61fa2cc9d9f14dd4a8b5.zip
Merge pull request #1981 from abhibeckert/master
Resolve #1974: Allow un-mapping of Ctrl-H
-rw-r--r--Interfaces/English.lproj/MainMenu.xib224
-rw-r--r--Source/SPTextView.m17
2 files changed, 216 insertions, 25 deletions
diff --git a/Interfaces/English.lproj/MainMenu.xib b/Interfaces/English.lproj/MainMenu.xib
index b8d43db7..f8d24d80 100644
--- a/Interfaces/English.lproj/MainMenu.xib
+++ b/Interfaces/English.lproj/MainMenu.xib
@@ -2,13 +2,13 @@
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1060</int>
- <string key="IBDocument.SystemVersion">13B3116</string>
- <string key="IBDocument.InterfaceBuilderVersion">4514</string>
- <string key="IBDocument.AppKitVersion">1265</string>
- <string key="IBDocument.HIToolboxVersion">696.00</string>
+ <string key="IBDocument.SystemVersion">13E28</string>
+ <string key="IBDocument.InterfaceBuilderVersion">5056</string>
+ <string key="IBDocument.AppKitVersion">1265.21</string>
+ <string key="IBDocument.HIToolboxVersion">698.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string key="NS.object.0">4514</string>
+ <string key="NS.object.0">5056</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>NSCustomObject</string>
@@ -2013,6 +2013,15 @@
<reference key="NSOnImage" ref="325032718"/>
<reference key="NSMixedImage" ref="674471825"/>
</object>
+ <object class="NSMenuItem" id="221903071">
+ <reference key="NSMenu" ref="781540470"/>
+ <string key="NSTitle">MySQL Help for Word</string>
+ <string key="NSKeyEquiv">h</string>
+ <int key="NSKeyEquivModMask">262144</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="325032718"/>
+ <reference key="NSMixedImage" ref="674471825"/>
+ </object>
<object class="NSMenuItem" id="218935897">
<reference key="NSMenu" ref="781540470"/>
<bool key="NSIsDisabled">YES</bool>
@@ -3134,6 +3143,14 @@
<string key="id">1021</string>
</object>
<object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">showMySQLHelpForCurrentWord:</string>
+ <reference key="source" ref="1005713010"/>
+ <reference key="destination" ref="221903071"/>
+ </object>
+ <string key="id">BUY-hF-nKy</string>
+ </object>
+ <object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="524643114"/>
@@ -4587,6 +4604,7 @@
<reference ref="218935897"/>
<reference ref="1017474458"/>
<reference ref="360554980"/>
+ <reference ref="221903071"/>
</array>
<reference key="parent" ref="775950865"/>
</object>
@@ -4710,6 +4728,11 @@
<reference key="object" ref="474000615"/>
<reference key="parent" ref="0"/>
</object>
+ <object class="IBObjectRecord">
+ <string key="id">nXE-rI-RyI</string>
+ <reference key="object" ref="221903071"/>
+ <reference key="parent" ref="781540470"/>
+ </object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
@@ -5339,6 +5362,7 @@
</object>
<string key="998.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="998.showNotes"/>
+ <string key="nXE-rI-RyI.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
@@ -5348,6 +5372,47 @@
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
+ <string key="className">NSDocument</string>
+ <dictionary class="NSMutableDictionary" key="actions">
+ <string key="printDocument:">id</string>
+ <string key="revertDocumentToSaved:">id</string>
+ <string key="runPageLayout:">id</string>
+ <string key="saveDocument:">id</string>
+ <string key="saveDocumentAs:">id</string>
+ <string key="saveDocumentTo:">id</string>
+ </dictionary>
+ <dictionary class="NSMutableDictionary" key="actionInfosByName">
+ <object class="IBActionInfo" key="printDocument:">
+ <string key="name">printDocument:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo" key="revertDocumentToSaved:">
+ <string key="name">revertDocumentToSaved:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo" key="runPageLayout:">
+ <string key="name">runPageLayout:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo" key="saveDocument:">
+ <string key="name">saveDocument:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo" key="saveDocumentAs:">
+ <string key="name">saveDocumentAs:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo" key="saveDocumentTo:">
+ <string key="name">saveDocumentTo:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </dictionary>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/NSDocument.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
<string key="className">NSTextView</string>
<dictionary class="NSMutableDictionary" key="actions">
<string key="doDecomposedStringWithCanonicalMapping:">id</string>
@@ -5576,6 +5641,30 @@
<object class="IBPartialClassDescription">
<string key="className">SPBundleCommandTextView</string>
<string key="superclassName">NSTextView</string>
+ <dictionary class="NSMutableDictionary" key="actions">
+ <string key="cut:">id</string>
+ <string key="paste:">id</string>
+ <string key="redo:">id</string>
+ <string key="undo:">id</string>
+ </dictionary>
+ <dictionary class="NSMutableDictionary" key="actionInfosByName">
+ <object class="IBActionInfo" key="cut:">
+ <string key="name">cut:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo" key="paste:">
+ <string key="name">paste:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo" key="redo:">
+ <string key="name">redo:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo" key="undo:">
+ <string key="name">undo:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </dictionary>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">commandScrollView</string>
<string key="NS.object.0">NSScrollView</string>
@@ -5612,6 +5701,7 @@
<string key="saveBundle:">id</string>
<string key="scopeButtonChanged:">id</string>
<string key="showHelp:">id</string>
+ <string key="showWindow:">id</string>
<string key="triggerButtonChanged:">id</string>
<string key="undeleteDefaultBundles:">id</string>
<string key="withBlobButtonChanged:">id</string>
@@ -5681,6 +5771,10 @@
<string key="name">showHelp:</string>
<string key="candidateClassName">id</string>
</object>
+ <object class="IBActionInfo" key="showWindow:">
+ <string key="name">showWindow:</string>
+ <string key="candidateClassName">id</string>
+ </object>
<object class="IBActionInfo" key="triggerButtonChanged:">
<string key="name">triggerButtonChanged:</string>
<string key="candidateClassName">id</string>
@@ -5930,7 +6024,7 @@
<string key="addFavoriteUsingCurrentDetails:">id</string>
<string key="addGroup:">id</string>
<string key="cancelConnection:">id</string>
- <string key="chooseKeyLocation:">id</string>
+ <string key="chooseKeyLocation:">NSButton</string>
<string key="duplicateFavorite:">id</string>
<string key="exportFavorites:">id</string>
<string key="importFavorites:">id</string>
@@ -5965,7 +6059,7 @@
</object>
<object class="IBActionInfo" key="chooseKeyLocation:">
<string key="name">chooseKeyLocation:</string>
- <string key="candidateClassName">id</string>
+ <string key="candidateClassName">NSButton</string>
</object>
<object class="IBActionInfo" key="duplicateFavorite:">
<string key="name">duplicateFavorite:</string>
@@ -6052,6 +6146,7 @@
<string key="socketUserField">NSTextField</string>
<string key="sshColorField">SPColorSelectorView</string>
<string key="sshConnectionFormContainer">NSView</string>
+ <string key="sshConnectionSSLDetailsContainer">NSView</string>
<string key="sshKeyLocationHelp">NSView</string>
<string key="sshNameField">NSTextField</string>
<string key="sshPasswordField">NSSecureTextField</string>
@@ -6062,6 +6157,9 @@
<string key="sslCACertLocationHelp">NSView</string>
<string key="sslCertificateLocationHelp">NSView</string>
<string key="sslKeyFileLocationHelp">NSView</string>
+ <string key="sslOverSSHCACertButton">NSButton</string>
+ <string key="sslOverSSHCertificateButton">NSButton</string>
+ <string key="sslOverSSHKeyFileButton">NSButton</string>
<string key="standardColorField">SPColorSelectorView</string>
<string key="standardConnectionFormContainer">NSView</string>
<string key="standardConnectionSSLDetailsContainer">NSView</string>
@@ -6183,6 +6281,10 @@
<string key="name">sshConnectionFormContainer</string>
<string key="candidateClassName">NSView</string>
</object>
+ <object class="IBToOneOutletInfo" key="sshConnectionSSLDetailsContainer">
+ <string key="name">sshConnectionSSLDetailsContainer</string>
+ <string key="candidateClassName">NSView</string>
+ </object>
<object class="IBToOneOutletInfo" key="sshKeyLocationHelp">
<string key="name">sshKeyLocationHelp</string>
<string key="candidateClassName">NSView</string>
@@ -6223,6 +6325,18 @@
<string key="name">sslKeyFileLocationHelp</string>
<string key="candidateClassName">NSView</string>
</object>
+ <object class="IBToOneOutletInfo" key="sslOverSSHCACertButton">
+ <string key="name">sslOverSSHCACertButton</string>
+ <string key="candidateClassName">NSButton</string>
+ </object>
+ <object class="IBToOneOutletInfo" key="sslOverSSHCertificateButton">
+ <string key="name">sslOverSSHCertificateButton</string>
+ <string key="candidateClassName">NSButton</string>
+ </object>
+ <object class="IBToOneOutletInfo" key="sslOverSSHKeyFileButton">
+ <string key="name">sslOverSSHKeyFileButton</string>
+ <string key="candidateClassName">NSButton</string>
+ </object>
<object class="IBToOneOutletInfo" key="standardColorField">
<string key="name">standardColorField</string>
<string key="candidateClassName">SPColorSelectorView</string>
@@ -6316,9 +6430,11 @@
<string key="runSecondaryQueryAction:">id</string>
<string key="runSelectedQueries:">id</string>
<string key="saveQueryHistory:">id</string>
+ <string key="searchInDocForWebViewSelection:">id</string>
<string key="showCompletionList:">id</string>
<string key="showHelpForCurrentWord:">id</string>
<string key="showHelpForSearchString:">id</string>
+ <string key="showHelpForWebViewSelection:">id</string>
<string key="switchDefaultQueryAction:">id</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="actionInfosByName">
@@ -6402,6 +6518,10 @@
<string key="name">saveQueryHistory:</string>
<string key="candidateClassName">id</string>
</object>
+ <object class="IBActionInfo" key="searchInDocForWebViewSelection:">
+ <string key="name">searchInDocForWebViewSelection:</string>
+ <string key="candidateClassName">id</string>
+ </object>
<object class="IBActionInfo" key="showCompletionList:">
<string key="name">showCompletionList:</string>
<string key="candidateClassName">id</string>
@@ -6414,6 +6534,10 @@
<string key="name">showHelpForSearchString:</string>
<string key="candidateClassName">id</string>
</object>
+ <object class="IBActionInfo" key="showHelpForWebViewSelection:">
+ <string key="name">showHelpForWebViewSelection:</string>
+ <string key="candidateClassName">id</string>
+ </object>
<object class="IBActionInfo" key="switchDefaultQueryAction:">
<string key="name">switchDefaultQueryAction:</string>
<string key="candidateClassName">id</string>
@@ -6725,6 +6849,7 @@
<string key="checksumTable:">id</string>
<string key="chooseDatabase:">id</string>
<string key="chooseEncoding:">id</string>
+ <string key="closeErrorConnectionSheet:">id</string>
<string key="closePanelSheet:">id</string>
<string key="closePasswordSheet:">id</string>
<string key="closeSheet:">id</string>
@@ -6742,6 +6867,7 @@
<string key="openCurrentConnectionInNewWindow:">id</string>
<string key="openDatabaseInNewTab:">id</string>
<string key="optimizeTable:">id</string>
+ <string key="printDocument:">id</string>
<string key="refreshTables:">id</string>
<string key="removeDatabase:">id</string>
<string key="renameDatabase:">id</string>
@@ -6806,6 +6932,10 @@
<string key="name">chooseEncoding:</string>
<string key="candidateClassName">id</string>
</object>
+ <object class="IBActionInfo" key="closeErrorConnectionSheet:">
+ <string key="name">closeErrorConnectionSheet:</string>
+ <string key="candidateClassName">id</string>
+ </object>
<object class="IBActionInfo" key="closePanelSheet:">
<string key="name">closePanelSheet:</string>
<string key="candidateClassName">id</string>
@@ -6874,6 +7004,10 @@
<string key="name">optimizeTable:</string>
<string key="candidateClassName">id</string>
</object>
+ <object class="IBActionInfo" key="printDocument:">
+ <string key="name">printDocument:</string>
+ <string key="candidateClassName">id</string>
+ </object>
<object class="IBActionInfo" key="refreshTables:">
<string key="name">refreshTables:</string>
<string key="candidateClassName">id</string>
@@ -7320,6 +7454,30 @@
<object class="IBPartialClassDescription">
<string key="className">SPEditSheetTextView</string>
<string key="superclassName">NSTextView</string>
+ <dictionary class="NSMutableDictionary" key="actions">
+ <string key="cut:">id</string>
+ <string key="paste:">id</string>
+ <string key="redo:">id</string>
+ <string key="undo:">id</string>
+ </dictionary>
+ <dictionary class="NSMutableDictionary" key="actionInfosByName">
+ <object class="IBActionInfo" key="cut:">
+ <string key="name">cut:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo" key="paste:">
+ <string key="name">paste:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo" key="redo:">
+ <string key="name">redo:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo" key="undo:">
+ <string key="name">undo:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/SPEditSheetTextView.h</string>
@@ -8201,6 +8359,7 @@
<string key="copy:">id</string>
<string key="saveConsoleAs:">id</string>
<string key="toggleShowConnections:">id</string>
+ <string key="toggleShowDatabases:">id</string>
<string key="toggleShowHelpStatements:">id</string>
<string key="toggleShowSelectShowStatements:">id</string>
<string key="toggleShowTimeStamps:">id</string>
@@ -8222,6 +8381,10 @@
<string key="name">toggleShowConnections:</string>
<string key="candidateClassName">id</string>
</object>
+ <object class="IBActionInfo" key="toggleShowDatabases:">
+ <string key="name">toggleShowDatabases:</string>
+ <string key="candidateClassName">id</string>
+ </object>
<object class="IBActionInfo" key="toggleShowHelpStatements:">
<string key="name">toggleShowHelpStatements:</string>
<string key="candidateClassName">id</string>
@@ -8240,6 +8403,7 @@
<string key="consoleSearchField">NSSearchField</string>
<string key="consoleTableView">NSTableView</string>
<string key="includeConnectionButton">NSButton</string>
+ <string key="includeDatabaseButton">NSButton</string>
<string key="includeTimeStampsButton">NSButton</string>
<string key="loggingDisabledTextField">NSTextField</string>
<string key="progressIndicator">NSProgressIndicator</string>
@@ -8263,6 +8427,10 @@
<string key="name">includeConnectionButton</string>
<string key="candidateClassName">NSButton</string>
</object>
+ <object class="IBToOneOutletInfo" key="includeDatabaseButton">
+ <string key="name">includeDatabaseButton</string>
+ <string key="candidateClassName">NSButton</string>
+ </object>
<object class="IBToOneOutletInfo" key="includeTimeStampsButton">
<string key="name">includeTimeStampsButton</string>
<string key="candidateClassName">NSButton</string>
@@ -9103,6 +9271,7 @@
<string key="openTableInNewTab:">id</string>
<string key="removeTable:">id</string>
<string key="renameTable:">id</string>
+ <string key="tableEncodingButtonChanged:">id</string>
<string key="togglePaneCollapse:">id</string>
<string key="truncateTable:">id</string>
<string key="updateFilter:">id</string>
@@ -9133,6 +9302,10 @@
<string key="name">renameTable:</string>
<string key="candidateClassName">id</string>
</object>
+ <object class="IBActionInfo" key="tableEncodingButtonChanged:">
+ <string key="name">tableEncodingButtonChanged:</string>
+ <string key="candidateClassName">id</string>
+ </object>
<object class="IBActionInfo" key="togglePaneCollapse:">
<string key="name">togglePaneCollapse:</string>
<string key="candidateClassName">id</string>
@@ -9407,17 +9580,20 @@
<object class="IBPartialClassDescription">
<string key="className">SPTextView</string>
<string key="superclassName">NSTextView</string>
- <object class="NSMutableDictionary" key="actions">
- <string key="NS.key.0">showMySQLHelpForCurrentWord:</string>
- <string key="NS.object.0">id</string>
- </object>
- <object class="NSMutableDictionary" key="actionInfosByName">
- <string key="NS.key.0">showMySQLHelpForCurrentWord:</string>
- <object class="IBActionInfo" key="NS.object.0">
+ <dictionary class="NSMutableDictionary" key="actions">
+ <string key="printDocument:">id</string>
+ <string key="showMySQLHelpForCurrentWord:">id</string>
+ </dictionary>
+ <dictionary class="NSMutableDictionary" key="actionInfosByName">
+ <object class="IBActionInfo" key="printDocument:">
+ <string key="name">printDocument:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo" key="showMySQLHelpForCurrentWord:">
<string key="name">showMySQLHelpForCurrentWord:</string>
<string key="candidateClassName">id</string>
</object>
- </object>
+ </dictionary>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="customQueryInstance">SPCustomQuery</string>
<string key="scrollView">NSScrollView</string>
@@ -9552,6 +9728,24 @@
<string key="minorKey">./Classes/SUUpdater.h</string>
</object>
</object>
+ <object class="IBPartialClassDescription">
+ <string key="className">WebView</string>
+ <object class="NSMutableDictionary" key="actions">
+ <string key="NS.key.0">reloadFromOrigin:</string>
+ <string key="NS.object.0">id</string>
+ </object>
+ <object class="NSMutableDictionary" key="actionInfosByName">
+ <string key="NS.key.0">reloadFromOrigin:</string>
+ <object class="IBActionInfo" key="NS.object.0">
+ <string key="name">reloadFromOrigin:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/WebView.h</string>
+ </object>
+ </object>
</array>
</object>
<int key="IBDocument.localizationMode">0</int>
diff --git a/Source/SPTextView.m b/Source/SPTextView.m
index a608a6d0..8edbb6d0 100644
--- a/Source/SPTextView.m
+++ b/Source/SPTextView.m
@@ -2235,16 +2235,7 @@ static inline NSPoint SPPointOnLine(NSPoint a, NSPoint b, CGFloat t) { return NS
}
#endif
}
-
-#ifndef SP_CODA
- // Note: switch(insertedCharacter) {} does not work instead use charactersIgnoringModifiers
- if([charactersIgnMod isEqualToString:@"h"]) // ^H show MySQL Help
- if(curFlags==(NSControlKeyMask))
- {
- [self showMySQLHelpForCurrentWord:self];
- return;
- }
-#endif
+
if([charactersIgnMod isEqualToString:@"y"]) // ^Y select current query
if(curFlags==(NSControlKeyMask))
{
@@ -3211,6 +3202,12 @@ static inline NSPoint SPPointOnLine(NSPoint a, NSPoint b, CGFloat t) { return NS
// Enable or disable the search in the MySQL help menu item depending on whether there is a
// selection and whether it is a reasonable length.
if ([menuItem action] == @selector(showMySQLHelpForCurrentWord:)) {
+ if ([self selectedRange].length > 0) {
+ [menuItem setTitle:NSLocalizedString(@"MySQL Help for Selection", @"MySQL Help for Selection")];
+ } else {
+ [menuItem setTitle: NSLocalizedString(@"MySQL Help for Word", @"MySQL Help for Word")];
+ }
+
NSUInteger stringSize = [self getRangeForCurrentWord].length;
return (stringSize || stringSize > 64);
}