diff options
author | stuconnolly <stuart02@gmail.com> | 2012-04-30 14:05:03 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2012-04-30 14:05:03 +0000 |
commit | 61f734103aad78bbdedb48dac55b0081380a295c (patch) | |
tree | 63ca73d6e028ba13c03de3b5e418edc119da83c1 | |
parent | 76d1d9d7fe2046bcf9281f95c5a7b541d49e6a0b (diff) | |
download | sequelpro-61f734103aad78bbdedb48dac55b0081380a295c.tar.gz sequelpro-61f734103aad78bbdedb48dac55b0081380a295c.tar.bz2 sequelpro-61f734103aad78bbdedb48dac55b0081380a295c.zip |
Add index sheet improvements:
- FULLTEXT index type should only be available for MyISAM tables
- Index prefix lengths are ignored when specified for FULLTEXT indexes so don't require one (fixes issue #1306)
-rw-r--r-- | Interfaces/English.lproj/IndexesView.xib | 206 | ||||
-rw-r--r-- | Source/SPIndexesController.h | 1 | ||||
-rw-r--r-- | Source/SPIndexesController.m | 83 |
3 files changed, 165 insertions, 125 deletions
diff --git a/Interfaces/English.lproj/IndexesView.xib b/Interfaces/English.lproj/IndexesView.xib index fc4963bb..2efa5785 100644 --- a/Interfaces/English.lproj/IndexesView.xib +++ b/Interfaces/English.lproj/IndexesView.xib @@ -2,9 +2,9 @@ <archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10"> <data> <int key="IBDocument.SystemTarget">1050</int> - <string key="IBDocument.SystemVersion">10J869</string> + <string key="IBDocument.SystemVersion">10K549</string> <string key="IBDocument.InterfaceBuilderVersion">851</string> - <string key="IBDocument.AppKitVersion">1038.35</string> + <string key="IBDocument.AppKitVersion">1038.36</string> <string key="IBDocument.HIToolboxVersion">461.00</string> <object class="NSMutableDictionary" key="IBDocument.PluginVersions"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -21,7 +21,7 @@ </object> <object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> <bool key="EncodedWithXMLCoder">YES</bool> - <integer value="55"/> + <integer value="14"/> </object> <object class="NSArray" key="IBDocument.PluginDependencies"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -84,23 +84,23 @@ </object> <int key="NSPeriodicDelay">400</int> <int key="NSPeriodicInterval">75</int> - <object class="NSMenuItem" key="NSMenuItem" id="71932948"> + <object class="NSMenuItem" key="NSMenuItem" id="453090810"> <reference key="NSMenu" ref="71441725"/> - <string key="NSTitle">FULLTEXT</string> + <string key="NSTitle">UNIQUE</string> <string key="NSKeyEquiv"/> <int key="NSKeyEquivModMask">1048576</int> <int key="NSMnemonicLoc">2147483647</int> <int key="NSState">1</int> - <object class="NSCustomResource" key="NSOnImage" id="600203078"> + <object class="NSCustomResource" key="NSOnImage" id="206997792"> <string key="NSClassName">NSImage</string> <string key="NSResourceName">NSMenuCheckmark</string> </object> - <object class="NSCustomResource" key="NSMixedImage" id="752378347"> + <object class="NSCustomResource" key="NSMixedImage" id="551729884"> <string key="NSClassName">NSImage</string> <string key="NSResourceName">NSMenuMixedState</string> </object> <string key="NSAction">_popUpItemAction:</string> - <int key="NSTag">3</int> + <int key="NSTag">2</int> <reference key="NSTarget" ref="431781347"/> </object> <bool key="NSMenuItemRespectAlignment">YES</bool> @@ -116,8 +116,8 @@ <string key="NSKeyEquiv"/> <int key="NSKeyEquivModMask">1048576</int> <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="600203078"/> - <reference key="NSMixedImage" ref="752378347"/> + <reference key="NSOnImage" ref="206997792"/> + <reference key="NSMixedImage" ref="551729884"/> <string key="NSAction">_popUpItemAction:</string> <reference key="NSTarget" ref="431781347"/> </object> @@ -127,28 +127,16 @@ <string key="NSKeyEquiv"/> <int key="NSKeyEquivModMask">1048576</int> <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="600203078"/> - <reference key="NSMixedImage" ref="752378347"/> + <reference key="NSOnImage" ref="206997792"/> + <reference key="NSMixedImage" ref="551729884"/> <string key="NSAction">_popUpItemAction:</string> <int key="NSTag">1</int> <reference key="NSTarget" ref="431781347"/> </object> - <object class="NSMenuItem" id="453090810"> - <reference key="NSMenu" ref="71441725"/> - <string key="NSTitle">UNIQUE</string> - <string key="NSKeyEquiv"/> - <int key="NSKeyEquivModMask">1048576</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="600203078"/> - <reference key="NSMixedImage" ref="752378347"/> - <string key="NSAction">_popUpItemAction:</string> - <int key="NSTag">2</int> - <reference key="NSTarget" ref="431781347"/> - </object> - <reference ref="71932948"/> + <reference ref="453090810"/> </object> </object> - <int key="NSSelectedIndex">3</int> + <int key="NSSelectedIndex">2</int> <int key="NSPreferredEdge">3</int> <bool key="NSUsesItemFromMenu">YES</bool> <bool key="NSAltersState">YES</bool> @@ -593,8 +581,8 @@ <int key="NSKeyEquivModMask">1048576</int> <int key="NSMnemonicLoc">2147483647</int> <int key="NSState">1</int> - <reference key="NSOnImage" ref="600203078"/> - <reference key="NSMixedImage" ref="752378347"/> + <reference key="NSOnImage" ref="206997792"/> + <reference key="NSMixedImage" ref="551729884"/> <string key="NSAction">_popUpItemAction:</string> <reference key="NSTarget" ref="747441327"/> </object> @@ -611,8 +599,8 @@ <string key="NSTitle"/> <string key="NSKeyEquiv"/> <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="600203078"/> - <reference key="NSMixedImage" ref="752378347"/> + <reference key="NSOnImage" ref="206997792"/> + <reference key="NSMixedImage" ref="551729884"/> <string key="NSAction">_popUpItemAction:</string> <reference key="NSTarget" ref="747441327"/> </object> @@ -622,8 +610,8 @@ <string key="NSKeyEquiv"/> <int key="NSKeyEquivModMask">1048576</int> <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="600203078"/> - <reference key="NSMixedImage" ref="752378347"/> + <reference key="NSOnImage" ref="206997792"/> + <reference key="NSMixedImage" ref="551729884"/> <string key="NSAction">_popUpItemAction:</string> <reference key="NSTarget" ref="747441327"/> </object> @@ -633,8 +621,8 @@ <string key="NSKeyEquiv"/> <int key="NSKeyEquivModMask">1048576</int> <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="600203078"/> - <reference key="NSMixedImage" ref="752378347"/> + <reference key="NSOnImage" ref="206997792"/> + <reference key="NSMixedImage" ref="551729884"/> <string key="NSAction">_popUpItemAction:</string> <reference key="NSTarget" ref="747441327"/> </object> @@ -966,8 +954,8 @@ <string key="NSTitle">Remove Field</string> <string key="NSKeyEquiv"/> <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="600203078"/> - <reference key="NSMixedImage" ref="752378347"/> + <reference key="NSOnImage" ref="206997792"/> + <reference key="NSMixedImage" ref="551729884"/> </object> </object> </object> @@ -1339,7 +1327,6 @@ <object class="NSMutableArray" key="children"> <bool key="EncodedWithXMLCoder">YES</bool> <reference ref="453090810"/> - <reference ref="71932948"/> <reference ref="262306657"/> <reference ref="828450159"/> </object> @@ -1351,11 +1338,6 @@ <reference key="parent" ref="71441725"/> </object> <object class="IBObjectRecord"> - <int key="objectID">18</int> - <reference key="object" ref="71932948"/> - <reference key="parent" ref="71441725"/> - </object> - <object class="IBObjectRecord"> <int key="objectID">19</int> <reference key="object" ref="1000744513"/> <reference key="parent" ref="978293712"/> @@ -1747,8 +1729,6 @@ <string>16.ImportedFromIB2</string> <string>17.IBPluginDependency</string> <string>17.ImportedFromIB2</string> - <string>18.IBPluginDependency</string> - <string>18.ImportedFromIB2</string> <string>19.IBPluginDependency</string> <string>23.IBPluginDependency</string> <string>24.IBPluginDependency</string> @@ -1870,9 +1850,7 @@ <integer value="1041"/> <boolean value="YES"/> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>{{683, 655}, {167, 71}}</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <integer value="1"/> + <string>{{536, 557}, {167, 54}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1"/> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> @@ -1989,13 +1967,6 @@ <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBProjectSource</string> - <string key="minorKey">Frameworks/MCPKit/MCPFoundationKit/MCPNull.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> - <string key="className">NSObject</string> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBProjectSource</string> <string key="minorKey">Frameworks/PSMTabBar/PSMTabBarCell.h</string> </object> </object> @@ -2052,6 +2023,13 @@ <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBProjectSource</string> + <string key="minorKey">Source/SPObjectAdditions.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> <string key="minorKey">Source/SPQueryFavoriteManager.h</string> </object> </object> @@ -2323,7 +2301,7 @@ <string>id</string> <string>id</string> <string>id</string> - <string>id</string> + <string>NSButton</string> </object> </object> <object class="NSMutableDictionary" key="actionInfosByName"> @@ -2446,7 +2424,7 @@ </object> <object class="IBActionInfo"> <string key="name">toggleQueryInfoPaneCollapse:</string> - <string key="candidateClassName">id</string> + <string key="candidateClassName">NSButton</string> </object> </object> </object> @@ -3242,7 +3220,6 @@ <string>statusTableAccessoryView</string> <string>statusTableCopyChecksum</string> <string>statusTableView</string> - <string>statusValues</string> <string>tableContentInstance</string> <string>tableDataInstance</string> <string>tableDumpInstance</string> @@ -3271,7 +3248,7 @@ <string>NSWindow</string> <string>NSSplitView</string> <string>id</string> - <string>id</string> + <string>NSButton</string> <string>id</string> <string>NSTextField</string> <string>NSTextView</string> @@ -3316,7 +3293,6 @@ <string>id</string> <string>id</string> <string>id</string> - <string>id</string> <string>SPTableContent</string> <string>SPTableData</string> <string>id</string> @@ -3393,7 +3369,6 @@ <string>statusTableAccessoryView</string> <string>statusTableCopyChecksum</string> <string>statusTableView</string> - <string>statusValues</string> <string>tableContentInstance</string> <string>tableDataInstance</string> <string>tableDumpInstance</string> @@ -3439,7 +3414,7 @@ </object> <object class="IBToOneOutletInfo"> <string key="name">copyDatabaseDataButton</string> - <string key="candidateClassName">id</string> + <string key="candidateClassName">NSButton</string> </object> <object class="IBToOneOutletInfo"> <string key="name">copyDatabaseMessageField</string> @@ -3618,10 +3593,6 @@ <string key="candidateClassName">id</string> </object> <object class="IBToOneOutletInfo"> - <string key="name">statusValues</string> - <string key="candidateClassName">id</string> - </object> - <object class="IBToOneOutletInfo"> <string key="name">tableContentInstance</string> <string key="candidateClassName">SPTableContent</string> </object> @@ -4096,13 +4067,14 @@ <bool key="EncodedWithXMLCoder">YES</bool> <string>addRow:</string> <string>closeSheet:</string> - <string>copyRow:</string> + <string>duplicateRow:</string> <string>filterTable:</string> <string>navigatePaginationFromButton:</string> <string>reloadTable:</string> <string>removeRow:</string> <string>setCompareTypes:</string> <string>setDefaultOperator:</string> + <string>showDefaultOperaterHelp:</string> <string>showFilterTable:</string> <string>swapFilterTable:</string> <string>tableFilterClear:</string> @@ -4131,6 +4103,7 @@ <string>id</string> <string>id</string> <string>id</string> + <string>NSButton</string> </object> </object> <object class="NSMutableDictionary" key="actionInfosByName"> @@ -4139,13 +4112,14 @@ <bool key="EncodedWithXMLCoder">YES</bool> <string>addRow:</string> <string>closeSheet:</string> - <string>copyRow:</string> + <string>duplicateRow:</string> <string>filterTable:</string> <string>navigatePaginationFromButton:</string> <string>reloadTable:</string> <string>removeRow:</string> <string>setCompareTypes:</string> <string>setDefaultOperator:</string> + <string>showDefaultOperaterHelp:</string> <string>showFilterTable:</string> <string>swapFilterTable:</string> <string>tableFilterClear:</string> @@ -4166,7 +4140,7 @@ <string key="candidateClassName">id</string> </object> <object class="IBActionInfo"> - <string key="name">copyRow:</string> + <string key="name">duplicateRow:</string> <string key="candidateClassName">id</string> </object> <object class="IBActionInfo"> @@ -4194,6 +4168,10 @@ <string key="candidateClassName">id</string> </object> <object class="IBActionInfo"> + <string key="name">showDefaultOperaterHelp:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo"> <string key="name">showFilterTable:</string> <string key="candidateClassName">id</string> </object> @@ -4223,7 +4201,7 @@ </object> <object class="IBActionInfo"> <string key="name">togglePagination:</string> - <string key="candidateClassName">id</string> + <string key="candidateClassName">NSButton</string> </object> </object> </object> @@ -4235,10 +4213,9 @@ <string>argumentField</string> <string>betweenTextField</string> <string>compareField</string> - <string>contentFilterManager</string> <string>contentViewPane</string> - <string>copyButton</string> <string>countText</string> + <string>duplicateButton</string> <string>fieldField</string> <string>filterButton</string> <string>filterTableClearButton</string> @@ -4280,7 +4257,6 @@ <string>id</string> <string>id</string> <string>id</string> - <string>id</string> <string>NSView</string> <string>id</string> <string>id</string> @@ -4301,7 +4277,7 @@ <string>id</string> <string>id</string> <string>id</string> - <string>id</string> + <string>NSButton</string> <string>NSButton</string> <string>NSButton</string> <string>NSTextField</string> @@ -4328,10 +4304,9 @@ <string>argumentField</string> <string>betweenTextField</string> <string>compareField</string> - <string>contentFilterManager</string> <string>contentViewPane</string> - <string>copyButton</string> <string>countText</string> + <string>duplicateButton</string> <string>fieldField</string> <string>filterButton</string> <string>filterTableClearButton</string> @@ -4386,19 +4361,15 @@ <string key="candidateClassName">id</string> </object> <object class="IBToOneOutletInfo"> - <string key="name">contentFilterManager</string> - <string key="candidateClassName">id</string> - </object> - <object class="IBToOneOutletInfo"> <string key="name">contentViewPane</string> <string key="candidateClassName">NSView</string> </object> <object class="IBToOneOutletInfo"> - <string key="name">copyButton</string> + <string key="name">countText</string> <string key="candidateClassName">id</string> </object> <object class="IBToOneOutletInfo"> - <string key="name">countText</string> + <string key="name">duplicateButton</string> <string key="candidateClassName">id</string> </object> <object class="IBToOneOutletInfo"> @@ -4471,7 +4442,7 @@ </object> <object class="IBToOneOutletInfo"> <string key="name">multipleLineEditingButton</string> - <string key="candidateClassName">id</string> + <string key="candidateClassName">NSButton</string> </object> <object class="IBToOneOutletInfo"> <string key="name">paginationButton</string> @@ -4545,6 +4516,20 @@ </object> </object> <object class="IBPartialClassDescription"> + <string key="className">SPTableContent</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">Source/SPTableContentDataSource.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">SPTableContent</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">Source/SPTableContentDelegate.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> <string key="className">SPTableData</string> <string key="superclassName">NSObject</string> <object class="NSMutableDictionary" key="outlets"> @@ -4675,7 +4660,7 @@ <bool key="EncodedWithXMLCoder">YES</bool> <string>addField:</string> <string>closeSheet:</string> - <string>copyField:</string> + <string>duplicateField:</string> <string>reloadTable:</string> <string>removeField:</string> <string>resetAutoIncrement:</string> @@ -4692,7 +4677,7 @@ <string>id</string> <string>id</string> <string>id</string> - <string>id</string> + <string>NSMenuItem</string> <string>id</string> </object> </object> @@ -4702,7 +4687,7 @@ <bool key="EncodedWithXMLCoder">YES</bool> <string>addField:</string> <string>closeSheet:</string> - <string>copyField:</string> + <string>duplicateField:</string> <string>reloadTable:</string> <string>removeField:</string> <string>resetAutoIncrement:</string> @@ -4721,7 +4706,7 @@ <string key="candidateClassName">id</string> </object> <object class="IBActionInfo"> - <string key="name">copyField:</string> + <string key="name">duplicateField:</string> <string key="candidateClassName">id</string> </object> <object class="IBActionInfo"> @@ -4742,7 +4727,7 @@ </object> <object class="IBActionInfo"> <string key="name">toggleColumnView:</string> - <string key="candidateClassName">id</string> + <string key="candidateClassName">NSMenuItem</string> </object> <object class="IBActionInfo"> <string key="name">unhideIndexesView:</string> @@ -4757,8 +4742,8 @@ <string>addFieldButton</string> <string>addIndexButton</string> <string>chooseKeyButton</string> - <string>copyFieldButton</string> <string>databaseDataInstance</string> + <string>duplicateFieldButton</string> <string>editTableButton</string> <string>encodingPopupCell</string> <string>extendedTableInfoInstance</string> @@ -4787,9 +4772,9 @@ <string>id</string> <string>id</string> <string>id</string> - <string>id</string> <string>SPDatabaseData</string> <string>id</string> + <string>id</string> <string>NSPopUpButtonCell</string> <string>id</string> <string>SPIndexesController</string> @@ -4820,8 +4805,8 @@ <string>addFieldButton</string> <string>addIndexButton</string> <string>chooseKeyButton</string> - <string>copyFieldButton</string> <string>databaseDataInstance</string> + <string>duplicateFieldButton</string> <string>editTableButton</string> <string>encodingPopupCell</string> <string>extendedTableInfoInstance</string> @@ -4860,14 +4845,14 @@ <string key="candidateClassName">id</string> </object> <object class="IBToOneOutletInfo"> - <string key="name">copyFieldButton</string> - <string key="candidateClassName">id</string> - </object> - <object class="IBToOneOutletInfo"> <string key="name">databaseDataInstance</string> <string key="candidateClassName">SPDatabaseData</string> </object> <object class="IBToOneOutletInfo"> + <string key="name">duplicateFieldButton</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBToOneOutletInfo"> <string key="name">editTableButton</string> <string key="candidateClassName">id</string> </object> @@ -5073,6 +5058,8 @@ <object class="NSArray" key="dict.sortedKeys"> <bool key="EncodedWithXMLCoder">YES</bool> <string>addTableButton</string> + <string>copyCreateSyntaxContextMenuItem</string> + <string>copyCreateSyntaxMenuItem</string> <string>copyTableButton</string> <string>copyTableContentSwitch</string> <string>copyTableMessageField</string> @@ -5116,6 +5103,7 @@ <string>tablesListView</string> <string>toolbarActionsButton</string> <string>toolbarAddButton</string> + <string>toolbarDeleteButton</string> <string>toolbarReloadButton</string> <string>truncateTableButton</string> <string>truncateTableContextMenuItem</string> @@ -5123,13 +5111,15 @@ <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> <string>id</string> + <string>NSMenuItem</string> + <string>NSMenuItem</string> <string>id</string> <string>NSButton</string> <string>id</string> <string>id</string> <string>id</string> <string>id</string> - <string>id</string> + <string>SPDatabaseData</string> <string>NSMenuItem</string> <string>NSMenuItem</string> <string>id</string> @@ -5149,7 +5139,7 @@ <string>NSMenuItem</string> <string>NSMenuItem</string> <string>SPHistoryController</string> - <string>id</string> + <string>SPTableContent</string> <string>id</string> <string>SPDatabaseDocument</string> <string>id</string> @@ -5160,7 +5150,7 @@ <string>NSSplitView</string> <string>id</string> <string>id</string> - <string>id</string> + <string>SPTableStructure</string> <string>id</string> <string>id</string> <string>SPTableView</string> @@ -5168,6 +5158,7 @@ <string>id</string> <string>id</string> <string>id</string> + <string>id</string> <string>NSMenuItem</string> </object> </object> @@ -5176,6 +5167,8 @@ <object class="NSArray" key="dict.sortedKeys"> <bool key="EncodedWithXMLCoder">YES</bool> <string>addTableButton</string> + <string>copyCreateSyntaxContextMenuItem</string> + <string>copyCreateSyntaxMenuItem</string> <string>copyTableButton</string> <string>copyTableContentSwitch</string> <string>copyTableMessageField</string> @@ -5219,6 +5212,7 @@ <string>tablesListView</string> <string>toolbarActionsButton</string> <string>toolbarAddButton</string> + <string>toolbarDeleteButton</string> <string>toolbarReloadButton</string> <string>truncateTableButton</string> <string>truncateTableContextMenuItem</string> @@ -5230,6 +5224,14 @@ <string key="candidateClassName">id</string> </object> <object class="IBToOneOutletInfo"> + <string key="name">copyCreateSyntaxContextMenuItem</string> + <string key="candidateClassName">NSMenuItem</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">copyCreateSyntaxMenuItem</string> + <string key="candidateClassName">NSMenuItem</string> + </object> + <object class="IBToOneOutletInfo"> <string key="name">copyTableButton</string> <string key="candidateClassName">id</string> </object> @@ -5255,7 +5257,7 @@ </object> <object class="IBToOneOutletInfo"> <string key="name">databaseDataInstance</string> - <string key="candidateClassName">id</string> + <string key="candidateClassName">SPDatabaseData</string> </object> <object class="IBToOneOutletInfo"> <string key="name">duplicateTableContextMenuItem</string> @@ -5335,7 +5337,7 @@ </object> <object class="IBToOneOutletInfo"> <string key="name">tableContentInstance</string> - <string key="candidateClassName">id</string> + <string key="candidateClassName">SPTableContent</string> </object> <object class="IBToOneOutletInfo"> <string key="name">tableDataInstance</string> @@ -5379,7 +5381,7 @@ </object> <object class="IBToOneOutletInfo"> <string key="name">tableSourceInstance</string> - <string key="candidateClassName">id</string> + <string key="candidateClassName">SPTableStructure</string> </object> <object class="IBToOneOutletInfo"> <string key="name">tableTriggersInstance</string> @@ -5402,6 +5404,10 @@ <string key="candidateClassName">id</string> </object> <object class="IBToOneOutletInfo"> + <string key="name">toolbarDeleteButton</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBToOneOutletInfo"> <string key="name">toolbarReloadButton</string> <string key="candidateClassName">id</string> </object> diff --git a/Source/SPIndexesController.h b/Source/SPIndexesController.h index e014a4a7..8c79f4af 100644 --- a/Source/SPIndexesController.h +++ b/Source/SPIndexesController.h @@ -68,6 +68,7 @@ #endif BOOL _mainNibLoaded; + BOOL isMyISAMTale; NSString *table; NSMutableArray *fields, *indexes, *indexedFields; diff --git a/Source/SPIndexesController.m b/Source/SPIndexesController.m index c3ef394e..39abaf81 100644 --- a/Source/SPIndexesController.m +++ b/Source/SPIndexesController.m @@ -44,6 +44,7 @@ static const NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize"; @interface SPIndexesController (PrivateAPI) +- (void)_addAdditionalIndexTypes; - (void)_reloadIndexedColumnsTableData; - (void)_addIndexUsingDetails:(NSDictionary *)indexDetails; @@ -115,7 +116,6 @@ static const NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize"; */ - (void)awakeFromNib { - // As this controller also loads its own nib, it may call awakeFromNib multiple times; perform setup only once. if (_mainNibLoaded) return; _mainNibLoaded = YES; @@ -162,6 +162,8 @@ static const NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize"; // Check whether a save of the current field row is required. if (![tableStructure saveRowOnDeselect]) return; + isMyISAMTale = [[[tableData statusValues] objectForKey:@"Engine"] isEqualToString:@"MyISAM"]; + // Reset visibility of the primary key item [[[indexTypePopUpButton menu] itemWithTag:SPPrimaryKeyMenuTag] setHidden:NO]; @@ -170,19 +172,7 @@ static const NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize"; [indexNameTextField setEnabled:NO]; [indexNameTextField setStringValue:@"PRIMARY"]; - // Remove any existing SPATIAL menu item - if ([indexTypePopUpButton indexOfItemWithTag:SPSpatialMenuTag] != -1) - [indexTypePopUpButton removeItemAtIndex:[indexTypePopUpButton indexOfItemWithTag:SPSpatialMenuTag]]; - - // If the table is of type MyISAM and Spatial extension support is available, (re-)add the SPATIAL type - NSString *engine = [[tableData statusValues] objectForKey:@"Engine"]; - - if ([engine isEqualToString:@"MyISAM"] && [[dbDocument serverSupport] supportsSpatialExtensions]) { - NSMenuItem *spatialMenuItem = [[[NSMenuItem alloc] init] autorelease]; - [spatialMenuItem setTitle:NSLocalizedString(@"SPATIAL", @"Spatial index menu item title")]; - [spatialMenuItem setTag:SPSpatialMenuTag]; - [[indexTypePopUpButton menu] addItem:spatialMenuItem]; - } + [self _addAdditionalIndexTypes]; // Check to see whether a primary key already exists for the table, and if so select INDEX instead for (NSDictionary *field in fields) @@ -242,7 +232,7 @@ static const NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize"; #ifndef SP_REFACTOR // MyISAM and InnoDB tables only support BTREE storage types so disable the storage type popup button // as it's the default anyway. - [indexStorageTypePopUpButton setEnabled:(!([engine isEqualToString:@"MyISAM"] || [engine isEqualToString:@"InnoDB"]))]; + [indexStorageTypePopUpButton setEnabled:(!(isMyISAMTale || [[[tableData statusValues] objectForKey:@"Engine"] isEqualToString:@"InnoDB"]))]; // The ability to specify an index's key block size was added in MySQL 5.1.10 so disable the textfield // if it's not supported. @@ -298,7 +288,7 @@ static const NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize"; defaultButton:NSLocalizedString(@"Delete", @"delete button") alternateButton:NSLocalizedString(@"Cancel", @"cancel button") otherButton:nil - informativeTextWithFormat:(hasForeignKey) ? [NSString stringWithFormat:NSLocalizedString(@"The foreign key relationship '%@' has a dependency on this index. This relationship must be removed before the index can be deleted.\n\nAre you sure you want to continue to delete the relationship and the index? This action cannot be undone.", @"delete index and foreign key informative message"), constraintName] : [NSString stringWithFormat:NSLocalizedString(@"Are you sure you want to delete the index '%@'? This action cannot be undone.", @"delete index informative message"), keyName]]; + informativeTextWithFormat:hasForeignKey ? [NSString stringWithFormat:NSLocalizedString(@"The foreign key relationship '%@' has a dependency on this index. This relationship must be removed before the index can be deleted.\n\nAre you sure you want to continue to delete the relationship and the index? This action cannot be undone.", @"delete index and foreign key informative message"), constraintName] : [NSString stringWithFormat:NSLocalizedString(@"Are you sure you want to delete the index '%@'? This action cannot be undone.", @"delete index informative message"), keyName]]; [alert setAlertStyle:NSCriticalAlertStyle]; @@ -337,9 +327,12 @@ static const NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize"; NSString *engine = [[tableData statusValues] objectForKey:@"Engine"]; // Specifiying an index storage type (i.e. HASH or BTREE) is not permitted with SPATIAL indexes - [indexStorageTypePopUpButton setEnabled:(indexType != SPSpatialMenuTag) && !([engine isEqualToString:@"MyISAM"] || [engine isEqualToString:@"InnoDB"])]; + [indexStorageTypePopUpButton setEnabled:(indexType != SPSpatialMenuTag) && !(isMyISAMTale || [engine isEqualToString:@"InnoDB"])]; #endif } + + [indexSizeTableColumn setHidden:[[indexTypePopUpButton selectedItem] tag] == SPFullTextMenuTag]; + [indexesTableView reloadData]; } /** @@ -423,11 +416,14 @@ static const NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize"; // When hiding the advanced options, the size column would normally be hidden as well // - unless any of the ndexes fields have a required key size. BOOL hideSizesColumn = !showAdvancedView; + if (hideSizesColumn) { - for (NSDictionary *aField in indexedFields) { + for (NSDictionary *aField in indexedFields) + { if ([requiresLength containsObject:[[aField objectForKey:@"type"] uppercaseString]]) hideSizesColumn = NO; } } + [indexSizeTableColumn setHidden:hideSizesColumn]; [self _resizeWindowForAdvancedOptionsViewByHeightDelta:(showAdvancedView) ? ([indexAdvancedOptionsView frame].size.height + 10) : 0]; @@ -493,8 +489,10 @@ static const NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize"; if ([[tableColumn identifier] isEqualToString:@"Size"]) { // If the field is of type TEXT or BLOB then a index prefix length is required so change the default - // placeholder of 'optional' to 'required'. - [cell setPlaceholderString:([requiresLength containsObject:[[[indexedFields objectAtIndex:rowIndex] objectForKey:@"type"] uppercaseString]]) ? NSLocalizedString(@"required", @"required placeholder string") : NSLocalizedString(@"optional", @"optional placeholder string")]; + // placeholder of 'optional' to 'required', BUT only if the index type is not FULLTEXT. + BOOL isFullTextType = [[indexTypePopUpButton selectedItem] tag] == SPFullTextMenuTag; + + [cell setPlaceholderString:([requiresLength containsObject:[[[indexedFields objectAtIndex:rowIndex] objectForKey:@"type"] uppercaseString]] && !isFullTextType) ? NSLocalizedString(@"required", @"required placeholder string") : NSLocalizedString(@"optional", @"optional placeholder string")]; } } @@ -609,7 +607,9 @@ static const NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize"; [indexDetails setObject:indexedFields forKey:SPNewIndexIndexedColumns]; [indexDetails setObject:[indexNameTextField stringValue] forKey:SPNewIndexIndexName]; - switch ([[indexTypePopUpButton selectedItem] tag]) { + + switch ([[indexTypePopUpButton selectedItem] tag]) + { case SPPrimaryKeyMenuTag: [indexDetails setObject:@"PRIMARY KEY" forKey:SPNewIndexIndexType]; break; @@ -735,6 +735,39 @@ static const NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize"; #pragma mark Private API methods /** + * Adds any additional index types depending on the table type. + */ +- (void)_addAdditionalIndexTypes +{ + if ([indexTypePopUpButton indexOfItemWithTag:SPSpatialMenuTag] > -1) { + [indexTypePopUpButton removeItemAtIndex:[indexTypePopUpButton indexOfItemWithTag:SPSpatialMenuTag]]; + } + + if ([indexTypePopUpButton indexOfItemWithTag:SPFullTextMenuTag] > -1) { + [indexTypePopUpButton removeItemAtIndex:[indexTypePopUpButton indexOfItemWithTag:SPFullTextMenuTag]]; + } + + // FULLTEXT and SPATIAL index types are only available using the MyISAM engine + if (isMyISAMTale) { + if ([[dbDocument serverSupport] supportsSpatialExtensions]) { + NSMenuItem *spatialMenuItem = [[[NSMenuItem alloc] init] autorelease]; + + [spatialMenuItem setTitle:NSLocalizedString(@"SPATIAL", @"spatial index menu item title")]; + [spatialMenuItem setTag:SPSpatialMenuTag]; + + [[indexTypePopUpButton menu] addItem:spatialMenuItem]; + } + + NSMenuItem *fullTextMenuItem = [[[NSMenuItem alloc] init] autorelease]; + + [fullTextMenuItem setTitle:NSLocalizedString(@"FULLTEXT", @"full text index menu item title")]; + [fullTextMenuItem setTag:SPFullTextMenuTag]; + + [[indexTypePopUpButton menu] addItem:fullTextMenuItem]; + } +} + +/** * Reloads the indexed columns table view data and displays the size column if required. */ - (void)_reloadIndexedColumnsTableData @@ -802,11 +835,13 @@ static const NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize"; if ((![columnName length]) || (![columnType length])) continue; + BOOL isFullTextType = [indexType isEqualToString:@"FULLTEXT"]; + // If this field type requires a length and one hasn't been specified (interface validation // should ensure this doesn't happen), then skip it. - if ([requiresLength containsObject:[columnType uppercaseString]] && (![(NSString *)[column objectForKey:@"Size"] length])) continue; + if ([requiresLength containsObject:[columnType uppercaseString]] && (![(NSString *)[column objectForKey:@"Size"] length]) && !isFullTextType) continue; - if ([column objectForKey:@"Size"] && [supportsLength containsObject:columnType]) { + if ([column objectForKey:@"Size"] && [supportsLength containsObject:columnType] && !isFullTextType) { [tempIndexedColumns addObject:[NSString stringWithFormat:@"%@ (%@)", [columnName backtickQuotedString], [column objectForKey:@"Size"]]]; } @@ -1041,7 +1076,6 @@ static const NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize"; [super dealloc]; } - #ifdef SP_REFACTOR - (void)setDatabaseDocument:(SPDatabaseDocument*)db { @@ -1049,5 +1083,4 @@ static const NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize"; } #endif - @end |