diff options
-rw-r--r-- | Interfaces/English.lproj/Preferences.xib | 244 | ||||
-rw-r--r-- | README | 40 | ||||
-rw-r--r-- | Source/SPBundleEditorController.h | 5 | ||||
-rw-r--r-- | Source/SPBundleHTMLOutputController.m | 65 | ||||
-rw-r--r-- | Source/SPDatabaseDocument.m | 49 | ||||
-rw-r--r-- | Source/SPDatabaseViewController.m | 4 | ||||
-rw-r--r-- | Source/SPEditorPreferencePane.m | 57 | ||||
-rw-r--r-- | Source/SPTableContent.m | 34 | ||||
-rw-r--r-- | sequel-pro.xcodeproj/project.pbxproj | 2 |
9 files changed, 379 insertions, 121 deletions
diff --git a/Interfaces/English.lproj/Preferences.xib b/Interfaces/English.lproj/Preferences.xib index 97017f06..e3b85901 100644 --- a/Interfaces/English.lproj/Preferences.xib +++ b/Interfaces/English.lproj/Preferences.xib @@ -66,6 +66,44 @@ <object class="NSUserDefaultsController" id="151174232"> <bool key="NSSharedInstance">YES</bool> </object> + <object class="NSArrayController" id="937123943"> + <object class="NSMutableArray" key="NSDeclaredKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>name</string> + <string>fav</string> + <string>host</string> + <string>user</string> + <string>database</string> + <string>socket</string> + <string>port</string> + <string>useSSH</string> + <string>sshHost</string> + <string>sshUser</string> + <string>sshPort</string> + <object class="NSMutableString"> + <characters key="NS.bytes">selectedFavoritePassword</characters> + </object> + <string>DisplayTableViewVerticalGridlines</string> + <string>type</string> + <string>TableRowCountQueryLevel</string> + <string>sshKeyLocationEnabled</string> + <string>sshKeyLocation</string> + <string>useSSL</string> + <string>sslKeyFileLocation</string> + <string>sslKeyFileLocationEnabled</string> + <string>sslCertificateFileLocation</string> + <string>sslCertificateFileLocationEnabled</string> + <string>sslCACertFileLocation</string> + <string>sslCACertFileLocationEnabled</string> + <string>CustomQuerySoftIndentWidth</string> + </object> + <bool key="NSEditable">YES</bool> + <bool key="NSAutomaticallyPreparesContent">YES</bool> + <object class="_NSManagedProxy" key="_NSManagedProxy"/> + <bool key="NSSelectsInsertedObjects">YES</bool> + <bool key="NSFilterRestrictsInsertion">YES</bool> + <bool key="NSClearsFilterPredicateOnInsertion">YES</bool> + </object> <object class="NSWindowTemplate" id="1005"> <int key="NSWindowStyleMask">4107</int> <int key="NSWindowBacking">2</int> @@ -2496,7 +2534,7 @@ AQAAAAA</bytes> <string key="NSClassName">NSView</string> </object> <object class="NSCustomView" id="1033452264"> - <reference key="NSNextResponder"/> + <nil key="NSNextResponder"/> <int key="NSvFlags">268</int> <object class="NSMutableArray" key="NSSubviews"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -2505,7 +2543,6 @@ AQAAAAA</bytes> <int key="NSvFlags">268</int> <string key="NSFrame">{{437, 251}, {15, 22}}</string> <reference key="NSSuperview" ref="1033452264"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSStepperCell" key="NSCell" id="241334663"> <int key="NSCellFlags">68025888</int> @@ -2524,7 +2561,6 @@ AQAAAAA</bytes> <int key="NSvFlags">268</int> <string key="NSFrame">{{407, 253}, {23, 19}}</string> <reference key="NSSuperview" ref="1033452264"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="546511116"> <int key="NSCellFlags">-1804468671</int> @@ -2594,7 +2630,6 @@ AQAAAAA</bytes> <int key="NSvFlags">268</int> <string key="NSFrame">{{270, 254}, {131, 18}}</string> <reference key="NSSuperview" ref="1033452264"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="1729"> <int key="NSCellFlags">-2080244224</int> @@ -2617,7 +2652,6 @@ AQAAAAA</bytes> <int key="NSvFlags">268</int> <string key="NSFrame">{{124, 21}, {121, 14}}</string> <reference key="NSSuperview" ref="1033452264"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="983858855"> <int key="NSCellFlags">68288064</int> @@ -2634,7 +2668,6 @@ AQAAAAA</bytes> <int key="NSvFlags">268</int> <string key="NSFrame">{{49, 21}, {83, 14}}</string> <reference key="NSSuperview" ref="1033452264"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="133660147"> <int key="NSCellFlags">68288064</int> @@ -2661,7 +2694,6 @@ AQAAAAA</bytes> <int key="NSvFlags">256</int> <string key="NSFrameSize">{220, 249}</string> <reference key="NSSuperview" ref="25515031"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="_NSCornerView" key="NSCornerView"> <nil key="NSNextResponder"/> @@ -2744,8 +2776,6 @@ AQAAAAA</bytes> </object> <string key="NSFrame">{{1, 1}, {220, 249}}</string> <reference key="NSSuperview" ref="288292400"/> - <reference key="NSWindow"/> - <reference key="NSNextKeyView" ref="953919633"/> <reference key="NSDocView" ref="953919633"/> <reference key="NSBGColor" ref="887465699"/> <int key="NScvFlags">2</int> @@ -2755,7 +2785,6 @@ AQAAAAA</bytes> <int key="NSvFlags">-2147483392</int> <string key="NSFrame">{{-100, -100}, {15, 102}}</string> <reference key="NSSuperview" ref="288292400"/> - <reference key="NSWindow"/> <reference key="NSTarget" ref="288292400"/> <string key="NSAction">_doScroller:</string> <double key="NSPercent">0.99658703804016113</double> @@ -2765,7 +2794,6 @@ AQAAAAA</bytes> <int key="NSvFlags">-2147483392</int> <string key="NSFrame">{{-100, -100}, {223, 15}}</string> <reference key="NSSuperview" ref="288292400"/> - <reference key="NSWindow"/> <int key="NSsFlags">1</int> <reference key="NSTarget" ref="288292400"/> <string key="NSAction">_doScroller:</string> @@ -2774,8 +2802,6 @@ AQAAAAA</bytes> </object> <string key="NSFrame">{{20, 47}, {222, 251}}</string> <reference key="NSSuperview" ref="1033452264"/> - <reference key="NSWindow"/> - <reference key="NSNextKeyView" ref="25515031"/> <int key="NSsFlags">2</int> <reference key="NSVScroller" ref="662661535"/> <reference key="NSHScroller" ref="913479800"/> @@ -2787,7 +2813,6 @@ AQAAAAA</bytes> <int key="NSvFlags">268</int> <string key="NSFrame">{{20, 16}, {24, 24}}</string> <reference key="NSSuperview" ref="1033452264"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSPopUpButtonCell" key="NSCell" id="373813305"> <int key="NSCellFlags">71433792</int> @@ -2833,6 +2858,18 @@ AQAAAAA</bytes> <string key="NSAction">_popUpItemAction:</string> <reference key="NSTarget" ref="373813305"/> </object> + <object class="NSMenuItem" id="43471643"> + <reference key="NSMenu" ref="28667448"/> + <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"/> + <string key="NSAction">_popUpItemAction:</string> + <reference key="NSTarget" ref="373813305"/> + </object> <object class="NSMenuItem" id="191185083"> <reference key="NSMenu" ref="28667448"/> <string key="NSTitle">Load Theme</string> @@ -2900,7 +2937,6 @@ AQAAAAA</bytes> <int key="NSvFlags">268</int> <string key="NSFrame">{{407, 19}, {23, 19}}</string> <reference key="NSSuperview" ref="1033452264"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="248584789"> <int key="NSCellFlags">-1804468671</int> @@ -2973,7 +3009,6 @@ AQAAAAA</bytes> <int key="NSvFlags">268</int> <string key="NSFrame">{{269, 21}, {133, 17}}</string> <reference key="NSSuperview" ref="1033452264"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="273262177"> <int key="NSCellFlags">68288064</int> @@ -2990,7 +3025,6 @@ AQAAAAA</bytes> <int key="NSvFlags">268</int> <string key="NSFrame">{{437, 17}, {15, 22}}</string> <reference key="NSSuperview" ref="1033452264"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSStepperCell" key="NSCell" id="93125704"> <int key="NSCellFlags">68025888</int> @@ -3009,7 +3043,6 @@ AQAAAAA</bytes> <int key="NSvFlags">268</int> <string key="NSFrame">{{17, 322}, {182, 17}}</string> <reference key="NSSuperview" ref="1033452264"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="10706281"> <int key="NSCellFlags">68288064</int> @@ -3026,7 +3059,6 @@ AQAAAAA</bytes> <int key="NSvFlags">268</int> <string key="NSFrame">{{433, 313}, {133, 32}}</string> <reference key="NSSuperview" ref="1033452264"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="345790946"> <int key="NSCellFlags">67239424</int> @@ -3047,7 +3079,6 @@ AQAAAAA</bytes> <int key="NSvFlags">268</int> <string key="NSFrame">{{204, 320}, {207, 22}}</string> <reference key="NSSuperview" ref="1033452264"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="66452133"> <int key="NSCellFlags">-2076049856</int> @@ -3065,7 +3096,6 @@ AQAAAAA</bytes> <int key="NSvFlags">268</int> <string key="NSFrame">{{270, 282}, {292, 18}}</string> <reference key="NSSuperview" ref="1033452264"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="823431848"> <int key="NSCellFlags">-2080244224</int> @@ -3088,7 +3118,6 @@ AQAAAAA</bytes> <int key="NSvFlags">268</int> <string key="NSFrame">{{270, 227}, {292, 18}}</string> <reference key="NSSuperview" ref="1033452264"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="743257684"> <int key="NSCellFlags">-2080244224</int> @@ -3111,7 +3140,6 @@ AQAAAAA</bytes> <int key="NSvFlags">268</int> <string key="NSFrame">{{270, 169}, {292, 18}}</string> <reference key="NSSuperview" ref="1033452264"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="231642073"> <int key="NSCellFlags">67239424</int> @@ -3134,7 +3162,6 @@ AQAAAAA</bytes> <int key="NSvFlags">268</int> <string key="NSFrame">{{270, 198}, {292, 18}}</string> <reference key="NSSuperview" ref="1033452264"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="491730308"> <int key="NSCellFlags">-2080244224</int> @@ -3157,7 +3184,6 @@ AQAAAAA</bytes> <int key="NSvFlags">268</int> <string key="NSFrame">{{270, 122}, {292, 18}}</string> <reference key="NSSuperview" ref="1033452264"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="496801621"> <int key="NSCellFlags">-2080244224</int> @@ -3180,7 +3206,6 @@ AQAAAAA</bytes> <int key="NSvFlags">268</int> <string key="NSFrame">{{270, 45}, {292, 18}}</string> <reference key="NSSuperview" ref="1033452264"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="131748905"> <int key="NSCellFlags">67239424</int> @@ -3203,7 +3228,6 @@ AQAAAAA</bytes> <int key="NSvFlags">268</int> <string key="NSFrame">{{270, 94}, {292, 18}}</string> <reference key="NSSuperview" ref="1033452264"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="92164221"> <int key="NSCellFlags">67239424</int> @@ -3226,7 +3250,6 @@ AQAAAAA</bytes> <int key="NSvFlags">268</int> <string key="NSFrame">{{370, 69}, {29, 19}}</string> <reference key="NSSuperview" ref="1033452264"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="409964321"> <int key="NSCellFlags">-1538130368</int> @@ -3300,7 +3323,6 @@ AQAAAAA</bytes> <int key="NSvFlags">268</int> <string key="NSFrame">{{269, 71}, {96, 14}}</string> <reference key="NSSuperview" ref="1033452264"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="1060023867"> <int key="NSCellFlags">605158976</int> @@ -3317,7 +3339,6 @@ AQAAAAA</bytes> <int key="NSvFlags">268</int> <string key="NSFrame">{{405, 67}, {15, 22}}</string> <reference key="NSSuperview" ref="1033452264"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSStepperCell" key="NSCell" id="171005061"> <int key="NSCellFlags">604896800</int> @@ -3336,7 +3357,6 @@ AQAAAAA</bytes> <int key="NSvFlags">268</int> <string key="NSFrame">{{423, 71}, {140, 14}}</string> <reference key="NSSuperview" ref="1033452264"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="201150384"> <int key="NSCellFlags">605158976</int> @@ -3353,7 +3373,6 @@ AQAAAAA</bytes> <int key="NSvFlags">-2147483380</int> <string key="NSFrame">{{270, 0}, {292, 18}}</string> <reference key="NSSuperview" ref="1033452264"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="420702000"> <int key="NSCellFlags">-1543373312</int> @@ -3376,7 +3395,6 @@ AQAAAAA</bytes> <int key="NSvFlags">268</int> <string key="NSFrame">{{370, 144}, {29, 19}}</string> <reference key="NSSuperview" ref="1033452264"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="992523117"> <int key="NSCellFlags">-1538130368</int> @@ -3450,7 +3468,6 @@ AQAAAAA</bytes> <int key="NSvFlags">268</int> <string key="NSFrame">{{269, 146}, {96, 14}}</string> <reference key="NSSuperview" ref="1033452264"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="499174965"> <int key="NSCellFlags">605158976</int> @@ -3467,7 +3484,6 @@ AQAAAAA</bytes> <int key="NSvFlags">268</int> <string key="NSFrame">{{405, 142}, {15, 22}}</string> <reference key="NSSuperview" ref="1033452264"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSStepperCell" key="NSCell" id="266600395"> <int key="NSCellFlags">604896800</int> @@ -3486,7 +3502,6 @@ AQAAAAA</bytes> <int key="NSvFlags">268</int> <string key="NSFrame">{{423, 146}, {140, 14}}</string> <reference key="NSSuperview" ref="1033452264"/> - <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="516695546"> <int key="NSCellFlags">605158976</int> @@ -3503,7 +3518,6 @@ AQAAAAA</bytes> <int key="NSvFlags">12</int> <string key="NSFrame">{{204, 309}, {356, 5}}</string> <reference key="NSSuperview" ref="1033452264"/> - <reference key="NSWindow"/> <string key="NSOffsets">{0, 0}</string> <object class="NSTextFieldCell" key="NSTitleCell"> <int key="NSCellFlags">67239424</int> @@ -3523,10 +3537,48 @@ AQAAAAA</bytes> </object> </object> <string key="NSFrameSize">{580, 360}</string> - <reference key="NSSuperview"/> - <reference key="NSWindow"/> <string key="NSClassName">NSView</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</string> + <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</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="512106570"> + <reference key="NSMenu" ref="982657201"/> + <string key="NSTitle">Make Default</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"> @@ -3853,6 +3905,35 @@ AQAAAAA</bytes> </object> <object class="IBConnectionRecord"> <object class="IBBindingConnection" key="connection"> + <string key="label">contentArray: values.favorites</string> + <reference key="source" ref="937123943"/> + <reference key="destination" ref="151174232"/> + <object class="NSNibBindingConnector" key="connector"> + <reference key="NSSource" ref="937123943"/> + <reference key="NSDestination" ref="151174232"/> + <string key="NSLabel">contentArray: values.favorites</string> + <string key="NSBinding">contentArray</string> + <string key="NSKeyPath">values.favorites</string> + <object class="NSDictionary" key="NSOptions"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSArray" key="dict.sortedKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>NSDeletesObjectsOnRemove</string> + <string>NSHandlesContentAsCompoundValue</string> + </object> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + <boolean value="YES"/> + <boolean value="YES"/> + </object> + </object> + <int key="NSNibBindingConnectorVersion">2</int> + </object> + </object> + <int key="connectionID">782</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBBindingConnection" key="connection"> <string key="label">value: values.CustomQueryMaxHistoryItems</string> <reference key="source" ref="155059"/> <reference key="destination" ref="151174232"/> @@ -4492,6 +4573,14 @@ AQAAAAA</bytes> <int key="connectionID">1545</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 class="IBConnectionRecord"> <object class="IBBindingConnection" key="connection"> <string key="label">value: values.SUSendProfileInfo</string> <reference key="source" ref="467474047"/> @@ -4691,6 +4780,14 @@ AQAAAAA</bytes> </object> <object class="IBConnectionRecord"> <object class="IBOutletConnection" key="connection"> + <string key="label">favoritesController</string> + <reference key="source" ref="343720994"/> + <reference key="destination" ref="937123943"/> + </object> + <int key="connectionID">2078</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> <string key="label">defaultFavoritePopup</string> <reference key="source" ref="343720994"/> <reference key="destination" ref="331339372"/> @@ -5453,6 +5550,12 @@ AQAAAAA</bytes> <reference key="parent" ref="0"/> </object> <object class="IBObjectRecord"> + <int key="objectID">254</int> + <reference key="object" ref="937123943"/> + <reference key="parent" ref="0"/> + <string key="objectName">Favorites</string> + </object> + <object class="IBObjectRecord"> <int key="objectID">331</int> <reference key="object" ref="721264488"/> <reference key="parent" ref="0"/> @@ -6676,6 +6779,34 @@ AQAAAAA</bytes> <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"/> + <reference ref="512106570"/> + </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 class="IBObjectRecord"> <int key="objectID">1615</int> <reference key="object" ref="467474047"/> <object class="NSMutableArray" key="children"> @@ -6700,6 +6831,11 @@ AQAAAAA</bytes> <reference key="parent" ref="369742224"/> </object> <object class="IBObjectRecord"> + <int key="objectID">1640</int> + <reference key="object" ref="512106570"/> + <reference key="parent" ref="982657201"/> + </object> + <object class="IBObjectRecord"> <int key="objectID">1669</int> <reference key="object" ref="748242000"/> <object class="NSMutableArray" key="children"> @@ -6728,6 +6864,7 @@ AQAAAAA</bytes> <reference ref="164147578"/> <reference ref="304435366"/> <reference ref="62630352"/> + <reference ref="43471643"/> </object> <reference key="parent" ref="373813305"/> </object> @@ -7163,6 +7300,11 @@ AQAAAAA</bytes> <reference key="object" ref="242266609"/> <reference key="parent" ref="546511116"/> </object> + <object class="IBObjectRecord"> + <int key="objectID">2215</int> + <reference key="object" ref="43471643"/> + <reference key="parent" ref="28667448"/> + </object> </object> </object> <object class="NSMutableDictionary" key="flattenedProperties"> @@ -7301,11 +7443,17 @@ 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>1615.IBPluginDependency</string> <string>1615.ImportedFromIB2</string> <string>1616.IBPluginDependency</string> <string>1618.IBPluginDependency</string> <string>1620.IBPluginDependency</string> + <string>1640.IBPluginDependency</string> <string>1669.IBAttributePlaceholdersKey</string> <string>1669.IBPluginDependency</string> <string>1670.IBPluginDependency</string> @@ -7405,9 +7553,11 @@ AQAAAAA</bytes> <string>2203.IBNumberFormatterBehaviorMetadataKey</string> <string>2203.IBNumberFormatterLocalizesFormatMetadataKey</string> <string>2203.IBPluginDependency</string> + <string>2215.IBPluginDependency</string> <string>24.IBPluginDependency</string> <string>24.ImportedFromIB2</string> <string>25.IBPluginDependency</string> + <string>254.IBPluginDependency</string> <string>26.IBEditorWindowLastContentRect</string> <string>26.IBPluginDependency</string> <string>26.ImportedFromIB2</string> @@ -7695,11 +7845,17 @@ AQAAAAA</bytes> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>{{508, 537}, {142, 73}}</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> <integer value="1"/> <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"> @@ -7710,7 +7866,7 @@ AQAAAAA</bytes> </object> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>{{459, 246}, {222, 115}}</string> + <string>{{128, 250}, {222, 125}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <object class="NSMutableDictionary"> @@ -7750,7 +7906,7 @@ AQAAAAA</bytes> </object> </object> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>{{681, 304}, {64, 6}}</string> + <string>{{350, 308}, {64, 6}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>{{421, 141}, {227, 114}}</string> @@ -7844,8 +8000,10 @@ AQAAAAA</bytes> <boolean value="YES"/> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1"/> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>{{646, 14}, {276, 433}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1"/> @@ -8042,7 +8200,7 @@ AQAAAAA</bytes> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <boolean value="YES"/> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>{{311, 170}, {580, 360}}</string> + <string>{{119, 335}, {580, 360}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <object class="NSMutableArray"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -8095,7 +8253,7 @@ AQAAAAA</bytes> </object> </object> <nil key="sourceID"/> - <int key="maxID">2214</int> + <int key="maxID">2215</int> </object> <object class="IBClassDescriber" key="IBDocument.Classes"> <object class="NSMutableArray" key="referencedPartialClassDescriptions"> @@ -5,34 +5,36 @@ Sequel Pro uses two external frameworks which come with .ibplugins (Interface Bu Plugins); to build Sequel Pro, Interface Builder must have detected these plugins. The two frameworks are: + BWToolkit ShortcutRecorder -Each of these frameworks is included in the Sequel Pro source tree with its .ibplugin; +Each of these frameworks are included in the Sequel Pro source tree with its .ibplugin; the locations of these .ibplugins are: + ./Frameworks/BWToolkitFramework.framework/Versions/A/Resources/BWToolkit.ibplugin ./Frameworks/ShortcutRecorder.framework/Versions/A/Resources/ShortcutRecorder.ibplugin -By including these .ibplugins within the frameworks, Interface Builder should detect them automatically when you build. If you get build errors about "Unable to resolve plug-in -dependency for É", automatic detection has failed. The first thing to try is to quit Xcode -and Interface Builder, re-open Xcode, and try again; if this still fails, locate -the .ibplugins and double click on them to add them to Interface Builder. - -If Interface Builder complains that it's already installed then you might want -to replace the current version with the version in the project; to do this go to the -Interface Builder preferences, click on 'Plugins', and remove the BWToolkit plugin -using the [ - ] button below the list. +By including these .ibplugins within the frameworks, Interface Builder should detect +them automatically when you build. If you get build errors complaining "Unable to +resolve plug-in dependency for ...", automatic detection has failed. The first thing +to try is to quit Xcode and Interface Builder, re-open Xcode, and try again; if this +still fails, locate the .ibplugins and double click on them to add them to Interface Builder. -You will need to relaunch Interface Builder before you can re-add the plugin -from the location mentioned above. +If Interface Builder complains that they're already installed then you might want +to replace the current versions with the versions in the project; to do this go to the +Interface Builder preferences, click on 'Plugins', and remove the BWToolkit and/or +ShortcutRecorder plugin using the [ - ] button below the list. -Note, that Interface Builder always looks in the same location that the plugin -was originally installed from and does not keep track of it when moved. If -Interface Builder complains that it can't find it, either restore it to its -originally location or re-add it using the steps above. +You will need to relaunch Interface Builder before you can re-add the plugin from the +locations mentioned above. -As a last resort jump onto IRC and join #sequel-pro on irc.freenode.net and -any of the developers will be happy to help you out. +Note, that Interface Builder always looks in the same location that plugins are originally +installed from and does not keep track of them when they are moved. If Interface Builder +complains that it can't a plugin dependency, either restore it to its originally location +or re-add it using the steps above. -- Ben (aka avenjamin) +As a last resort jump onto IRC and join #sequel-pro on irc.freenode.net and any of the +developers will be more than happy to help you out. +- The Sequel Pro team diff --git a/Source/SPBundleEditorController.h b/Source/SPBundleEditorController.h index 1c3c0dab..5ea1658f 100644 --- a/Source/SPBundleEditorController.h +++ b/Source/SPBundleEditorController.h @@ -29,8 +29,8 @@ @class SRRecorderControl, BWSplitView; -@interface SPBundleEditorController : NSWindowController { - +@interface SPBundleEditorController : NSWindowController +{ IBOutlet SPBundleCommandTextView *commandTextView; IBOutlet SPOutlineView *commandsOutlineView; IBOutlet NSTextField *authorTextField; @@ -112,7 +112,6 @@ NSArray *shellVariableSuggestions; NSMutableArray *deletedDefaultBundles; - } - (IBAction)inputPopupButtonChanged:(id)sender; diff --git a/Source/SPBundleHTMLOutputController.m b/Source/SPBundleHTMLOutputController.m index 3c47964a..4b1567bb 100644 --- a/Source/SPBundleHTMLOutputController.m +++ b/Source/SPBundleHTMLOutputController.m @@ -24,6 +24,7 @@ #import "SPBundleHTMLOutputController.h" #import "SPAlertSheets.h" +#import "SPPrintAccessory.h" @class WebScriptCallFrame; @@ -178,7 +179,57 @@ - (IBAction)printDocument:(id)sender { - [[[[webView mainFrame] frameView] documentView] print:sender]; + + NSPrintInfo *printInfo = [NSPrintInfo sharedPrintInfo]; + + NSSize paperSize = [printInfo paperSize]; + NSRect printableRect = [printInfo imageablePageBounds]; + + // Calculate page margins + CGFloat marginL = printableRect.origin.x; + CGFloat marginR = paperSize.width - (printableRect.origin.x + printableRect.size.width); + CGFloat marginB = printableRect.origin.y; + CGFloat marginT = paperSize.height - (printableRect.origin.y + printableRect.size.height); + + // Make sure margins are symetric and positive + CGFloat marginLR = MAX(0, MAX(marginL, marginR)); + CGFloat marginTB = MAX(0, MAX(marginT, marginB)); + + // Set the margins + [printInfo setLeftMargin:marginLR]; + [printInfo setRightMargin:marginLR]; + [printInfo setTopMargin:marginTB]; + [printInfo setBottomMargin:marginTB]; + + [printInfo setHorizontalPagination:NSFitPagination]; + [printInfo setVerticalPagination:NSFitPagination]; + [printInfo setVerticallyCentered:NO]; + + NSPrintOperation *op = [NSPrintOperation printOperationWithView:[[[webView mainFrame] frameView] documentView] printInfo:printInfo]; + + // Perform the print operation on a background thread + [op setCanSpawnSeparateThread:YES]; + + // Add the ability to select the orientation to print panel + NSPrintPanel *printPanel = [op printPanel]; + + [printPanel setOptions:[printPanel options] + NSPrintPanelShowsOrientation + NSPrintPanelShowsScaling + NSPrintPanelShowsPaperSize]; + + [op setPrintPanel:printPanel]; + + SPPrintAccessory *printAccessory = [[SPPrintAccessory alloc] initWithNibName:@"PrintAccessory" bundle:nil]; + + [printAccessory setPrintView:webView]; + [printPanel addAccessoryController:printAccessory]; + + [[NSPageLayout pageLayout] addAccessoryController:printAccessory]; + [printAccessory release]; + + [op runOperationModalForWindow:[self window] + delegate:self + didRunSelector:nil + contextInfo:nil]; + } - (void)showSourceCode @@ -263,6 +314,7 @@ - (void)webView:(WebView *)webView decidePolicyForNavigationAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id<WebPolicyDecisionListener>)listener { + NSInteger navigationType = [[actionInformation objectForKey:WebActionNavigationTypeKey] integerValue]; // sequelpro:// handler @@ -270,9 +322,14 @@ [[NSApp delegate] handleEventWithURL:[request URL]]; [listener ignore]; } - // file://a_file_path opens the reveal the file in Finder - else if([[[request URL] scheme] isEqualToString:@"file"] && navigationType == WebNavigationTypeLinkClicked) { - [[NSWorkspace sharedWorkspace] selectFile:[[[request mainDocumentURL] absoluteString] substringFromIndex:6] inFileViewerRootedAtPath:nil]; + // sp-reveal-file://a_file_path reveals the file in Finder + else if([[[request URL] scheme] isEqualToString:@"sp-reveal-file"] && navigationType == WebNavigationTypeLinkClicked) { + [[NSWorkspace sharedWorkspace] selectFile:[[[request mainDocumentURL] absoluteString] substringFromIndex:16] inFileViewerRootedAtPath:nil]; + [listener ignore]; + } + // sp-open-file://a_file_path opens the file with the default + else if([[[request URL] scheme] isEqualToString:@"sp-open-file"] && navigationType == WebNavigationTypeLinkClicked) { + [[NSWorkspace sharedWorkspace] openFile:[[[request mainDocumentURL] absoluteString] substringFromIndex:14]]; [listener ignore]; } else { diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index e122205e..1d4b4fc6 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -835,12 +835,12 @@ if (selectedDatabase) [selectedDatabase release], selectedDatabase = nil; selectedDatabase = [[NSString alloc] initWithString:dbName]; [chooseDatabaseButton selectItemWithTitle:selectedDatabase]; - [[self onMainThread] updateWindowTitle:self]; + [self updateWindowTitle:self]; } } else { if (selectedDatabase) [selectedDatabase release], selectedDatabase = nil; [chooseDatabaseButton selectItemAtIndex:0]; - [[self onMainThread] updateWindowTitle:self]; + [self updateWindowTitle:self]; } } @@ -871,30 +871,31 @@ */ - (void)toggleConsole:(id)sender { - BOOL isConsoleVisible = [[[SPQueryController sharedQueryController] window] isVisible]; - // If the Console window is not visible data are not reloaded (for speed). - // Due to that update list if user opens the Console window. - if(!isConsoleVisible) { - [[SPQueryController sharedQueryController] updateEntries]; - } + // Toggle Console will show the Console window if it isn't visible or if it isn't + // the front most window and hide it if it is the front most window + if ([[[SPQueryController sharedQueryController] window] isVisible] + && [[[NSApp keyWindow] windowController] isKindOfClass:[SPQueryController class]]) + + [[[SPQueryController sharedQueryController] window] setIsVisible:NO]; + else + + [self showConsole:nil]; - // Show or hide the console - [[[SPQueryController sharedQueryController] window] setIsVisible:(!isConsoleVisible)]; } /** - * Brings the console to the fron + * Brings the console to the front */ - (void)showConsole:(id)sender { - BOOL isConsoleVisible = [[[SPQueryController sharedQueryController] window] isVisible]; - if (!isConsoleVisible) { - [self toggleConsole:sender]; - } else { - [[[SPQueryController sharedQueryController] window] makeKeyAndOrderFront:self]; - } + // If the Console window is not visible data are not reloaded (for speed). + // Due to that update list if user opens the Console window. + if(![[[SPQueryController sharedQueryController] window] isVisible]) + [[SPQueryController sharedQueryController] updateEntries]; + + [[[SPQueryController sharedQueryController] window] makeKeyAndOrderFront:self]; } @@ -3209,7 +3210,7 @@ // Show/hide console if ([menuItem action] == @selector(toggleConsole:)) { - [menuItem setTitle:([[[SPQueryController sharedQueryController] window] isVisible]) ? NSLocalizedString(@"Hide Console", @"hide console") : NSLocalizedString(@"Show Console", @"show console")]; + [menuItem setTitle:([[[SPQueryController sharedQueryController] window] isVisible] && [[[NSApp keyWindow] windowController] isKindOfClass:[SPQueryController class]]) ? NSLocalizedString(@"Hide Console", @"hide console") : NSLocalizedString(@"Show Console", @"show console")]; } // Clear console @@ -3305,6 +3306,10 @@ */ - (void) updateWindowTitle:(id)sender { + + // Ensure a call on the main thread + if (![NSThread isMainThread]) return [[self onMainThread] updateWindowTitle:sender]; + NSMutableString *tabTitle; NSMutableString *windowTitle; SPDatabaseDocument *frontTableDocument = [parentWindowController selectedTableDocument]; @@ -4543,7 +4548,7 @@ - (void)connectionControllerConnectAttemptFailed:(id)controller { // Reset the window title - [[self onMainThread] updateWindowTitle:self]; + [self updateWindowTitle:self]; } #pragma mark - @@ -5506,7 +5511,7 @@ [tablesListInstance setConnection:mySQLConnection]; [tableDumpInstance setConnection:mySQLConnection]; - [[self onMainThread] updateWindowTitle:self]; + [self updateWindowTitle:self]; } /** @@ -5545,7 +5550,7 @@ [tablesListInstance setConnection:mySQLConnection]; [tableDumpInstance setConnection:mySQLConnection]; - [[self onMainThread] updateWindowTitle:self]; + [self updateWindowTitle:self]; } /** @@ -5602,7 +5607,7 @@ [tableDumpInstance setConnection:mySQLConnection]; // Update the window title - [[self onMainThread] updateWindowTitle:self]; + [self updateWindowTitle:self]; // Add a history entry if (!historyStateChanging) { diff --git a/Source/SPDatabaseViewController.m b/Source/SPDatabaseViewController.m index e95b6b41..a7867c53 100644 --- a/Source/SPDatabaseViewController.m +++ b/Source/SPDatabaseViewController.m @@ -287,7 +287,7 @@ triggersLoaded = NO; // Update the window title - [[self onMainThread] updateWindowTitle:self]; + [self updateWindowTitle:self]; // Add a history entry [spHistoryControllerInstance updateHistoryEntries]; @@ -391,7 +391,7 @@ NSString *tableEncoding = nil; // Update the window title - [[self onMainThread] updateWindowTitle:self]; + [self updateWindowTitle:self]; // Reset table information caches [tableDataInstance resetAllData]; diff --git a/Source/SPEditorPreferencePane.m b/Source/SPEditorPreferencePane.m index 6176c742..50388e8a 100644 --- a/Source/SPEditorPreferencePane.m +++ b/Source/SPEditorPreferencePane.m @@ -29,6 +29,16 @@ #import "SPAlertSheets.h" #import "SPCategoryAdditions.h" +// Constants +static const NSString *SPImportColorScheme = @"ImportColorScheme"; +static const NSString *SPExportColorScheme = @"ExportColorScheme"; +static const NSString *SPSaveColorScheme = @"SaveColorScheme"; +static const NSString *SPDefaultColorSchemeName = @"Default"; +static const NSString *SPDefaultColorSchemeNameLC = @"default"; +static const NSString *SPCustomColorSchemeName = @"User-defined"; +static const NSString *SPCustomColorSchemeNameLC = @"user-defined"; +static const NSString *SPDefaultExportColourSchemeName = @"MyTheme"; + @interface SPEditorPreferencePane (PrivateAPI) - (BOOL)_checkForUnsavedTheme; @@ -38,7 +48,6 @@ @end - @implementation SPEditorPreferencePane #pragma mark - @@ -127,11 +136,11 @@ [panel setCanCreateDirectories:YES]; [panel beginSheetForDirectory:nil - file:[@"MyTheme" stringByAppendingPathExtension:SPColorThemeFileExtension] + file:[SPDefaultExportColourSchemeName stringByAppendingPathExtension:SPColorThemeFileExtension] modalForWindow:[[self view] window] modalDelegate:self didEndSelector:@selector(panelDidEnd:returnCode:contextInfo:) - contextInfo:@"exportColorScheme"]; + contextInfo:SPExportColorScheme]; } - (IBAction)importColorScheme:(id)sender @@ -151,7 +160,7 @@ modalForWindow:[[self view] window] modalDelegate:self didEndSelector:@selector(panelDidEnd:returnCode:contextInfo:) - contextInfo:@"importColorScheme"]; + contextInfo:SPImportColorScheme]; } @@ -178,7 +187,7 @@ modalForWindow:[[self view] window] modalDelegate:self didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:) - contextInfo:@"saveTheme"]; + contextInfo:SPSaveColorScheme]; } @@ -224,7 +233,7 @@ // Refresh current color theme setting name if ([[[prefs objectForKey:SPCustomQueryEditorThemeName] lowercaseString] isEqualToString:[[editThemeListItems objectAtIndex:[editThemeListTable selectedRow]] lowercaseString]]) { - [prefs setObject:@"User-defined" forKey:SPCustomQueryEditorThemeName]; + [prefs setObject:SPCustomColorSchemeName forKey:SPCustomQueryEditorThemeName]; } if (editThemeListItems) [editThemeListItems release], editThemeListItems = nil; @@ -271,7 +280,7 @@ [[NSColorPanel sharedColorPanel] close]; - [prefs setObject:@"Default" forKey:SPCustomQueryEditorThemeName]; + [prefs setObject:SPDefaultColorSchemeName forKey:SPCustomQueryEditorThemeName]; [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]; @@ -379,7 +388,7 @@ return; } - if ([[[prefs objectForKey:SPCustomQueryEditorThemeName] lowercaseString] isEqualToString:@"user-defined"]) { + if ([[[prefs objectForKey:SPCustomQueryEditorThemeName] lowercaseString] isEqualToString:SPCustomColorSchemeNameLC]) { [colorThemeName setHidden:YES]; [colorThemeNameLabel setHidden:YES]; @@ -388,7 +397,7 @@ NSString *currentThemeName = [[prefs objectForKey:SPCustomQueryEditorThemeName] lowercaseString]; - if ([currentThemeName isEqualToString:@"default"]) { + if ([currentThemeName isEqualToString:SPDefaultColorSchemeNameLC]) { [colorThemeName setHidden:NO]; [colorThemeNameLabel setHidden:NO]; @@ -412,7 +421,7 @@ return; } else { - [prefs setObject:@"User-defined" forKey:SPCustomQueryEditorThemeName]; + [prefs setObject:SPCustomColorSchemeName forKey:SPCustomQueryEditorThemeName]; [colorThemeName setHidden:YES]; [colorThemeNameLabel setHidden:YES]; @@ -456,7 +465,7 @@ [prefs setObject:[NSArchiver archivedDataWithRootObject:[sender color]] forKey:[editorColors objectAtIndex:colorRow]]; [colorSettingTableView reloadData]; - [prefs setObject:@"User-defined" forKey:SPCustomQueryEditorThemeName]; + [prefs setObject:SPCustomColorSchemeName forKey:SPCustomQueryEditorThemeName]; [self updateDisplayColorThemeName]; } @@ -487,7 +496,7 @@ [[sheet window] orderOut:nil]; } - if ([contextInfo isEqualToString:@"saveTheme"]) { + if ([contextInfo isEqualToString:SPSaveColorScheme]) { if (returnCode == NSOKButton) { NSFileManager *fm = [NSFileManager defaultManager]; @@ -510,15 +519,15 @@ - (void)panelDidEnd:(NSSavePanel *)panel returnCode:(NSInteger)returnCode contextInfo:(NSString *)contextInfo { - if ([contextInfo isEqualToString:@"exportColorScheme"]) { + if ([contextInfo isEqualToString:SPExportColorScheme]) { if (returnCode == NSOKButton) { [self _saveColorThemeAtPath:[panel filename]]; } } - else if ([contextInfo isEqualToString:@"importColorScheme"]) { + else if ([contextInfo isEqualToString:SPImportColorScheme]) { if (returnCode == NSOKButton) { if ([self _loadColorSchemeFromFile:[[panel filenames] objectAtIndex:0]]) { - [prefs setObject:@"User-defined" forKey:SPCustomQueryEditorThemeName]; + [prefs setObject:SPCustomColorSchemeName forKey:SPCustomQueryEditorThemeName]; [self updateDisplayColorThemeName]; } } @@ -560,7 +569,7 @@ NSString *newName = (NSString*)anObject; // Check for non-valid names - if (![newName length] || [[newName lowercaseString] isEqualToString:@"default"] || [[newName lowercaseString] isEqualToString:@"user-defined"]) { + if (![newName length] || [[newName lowercaseString] isEqualToString:SPDefaultColorSchemeNameLC] || [[newName lowercaseString] isEqualToString:SPCustomColorSchemeNameLC]) { NSBeep(); [editThemeListTable reloadData]; return; @@ -673,7 +682,7 @@ if (field == enterNameInputField) { NSString *name = [[enterNameInputField stringValue] lowercaseString]; - if (![name length] || [name isEqualToString:@"default"] || [name isEqualToString:@"user-defined"]) { + if (![name length] || [name isEqualToString:SPDefaultColorSchemeNameLC] || [name isEqualToString:SPCustomColorSchemeNameLC]) { [themeNameSaveButton setEnabled:NO]; } else { @@ -733,17 +742,21 @@ - (BOOL)_checkForUnsavedTheme { - if (![prefs objectForKey:SPCustomQueryEditorThemeName] || [[[prefs objectForKey:SPCustomQueryEditorThemeName] lowercaseString] isEqualToString:@"user-defined"]) { + if (![prefs objectForKey:SPCustomQueryEditorThemeName] || [[[prefs objectForKey:SPCustomQueryEditorThemeName] lowercaseString] isEqualToString:SPCustomColorSchemeNameLC]) { [[NSColorPanel sharedColorPanel] close]; SPBeginWaitingAlertSheet(@"title", - NSLocalizedString(@"Proceed", @"proceed button"), NSLocalizedString(@"Cancel", @"cancel button"), nil, - NSWarningAlertStyle, [[self view] window], self, + NSLocalizedString(@"Proceed", @"proceed button"), + NSLocalizedString(@"Cancel", @"cancel button"), + nil, + NSWarningAlertStyle, + [[self view] window], + self, @selector(checkForUnsavedThemeDidEndSheet:returnCode:contextInfo:), nil, - NSLocalizedString(@"Warning", @"warning"), - NSLocalizedString(@"Current color theme is unsaved. Do you want to proceed without saving it?", @"Current color theme is unsaved. Do you want to proceed without saving it message"), + NSLocalizedString(@"Unsaved Theme", @"unsaved theme message"), + NSLocalizedString(@"The current color theme is unsaved. Do you want to proceed without saving it?", @"unsaved theme informative message"), checkForUnsavedThemeSheetStatus ); diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m index b136d90a..7acc0187 100644 --- a/Source/SPTableContent.m +++ b/Source/SPTableContent.m @@ -244,14 +244,14 @@ // Scroll the viewport to the saved location selectionViewportToRestore.size = [tableContentView visibleRect].size; - [tableContentView scrollRectToVisible:selectionViewportToRestore]; + [[tableContentView onMainThread] scrollRectToVisible:selectionViewportToRestore]; } // Restore selection indexes if appropriate if (selectionIndexToRestore) { BOOL previousTableRowsSelectable = tableRowsSelectable; tableRowsSelectable = YES; - [tableContentView selectRowIndexes:selectionIndexToRestore byExtendingSelection:NO]; + [[tableContentView onMainThread] selectRowIndexes:selectionIndexToRestore byExtendingSelection:NO]; tableRowsSelectable = previousTableRowsSelectable; } @@ -758,7 +758,7 @@ [self updateCountText]; // Update pagination - [self updatePaginationState]; + [[self onMainThread] updatePaginationState]; // Retrieve and cache the column definitions for editing views if (cqColumnDefinition) [cqColumnDefinition release]; @@ -784,7 +784,7 @@ } else { // Trigger a full reload if required if (fullTableReloadRequired) [self reloadTable:self]; - [filterTableWindow setTitle:NSLocalizedString(@"Filter", @"filter label")]; + [[filterTableWindow onMainThread] setTitle:NSLocalizedString(@"Filter", @"filter label")]; } } @@ -1467,6 +1467,7 @@ /** * Update the state of the pagination buttons and text. + * This function is not thread-safe and should be called on the main thread. */ - (void) updatePaginationState { @@ -2062,6 +2063,28 @@ [tempRow addObject:NSLocalizedString(@"(not loaded)", @"value shown for hidden blob and text fields")]; else if([o isKindOfClass:[NSString class]]) [tempRow addObject:[o description]]; + else if([o isKindOfClass:[MCPGeometryData class]]) { + SPGeometryDataView *v = [[SPGeometryDataView alloc] initWithCoordinates:[o coordinates]]; + NSImage *image = [v thumbnailImage]; + NSString *imageStr = @""; + if(image) { + NSString *maxSizeValue = @"WIDTH"; + NSInteger imageWidth = [image size].width; + NSInteger imageHeight = [image size].height; + if(imageHeight > imageWidth) { + maxSizeValue = @"HEIGHT"; + imageWidth = imageHeight; + } + if (imageWidth > 100) imageWidth = 100; + imageStr = [NSString stringWithFormat: + @"<BR><IMG %@='%ld' SRC=\"data:image/auto;base64,%@\">", + maxSizeValue, + (long)imageWidth, + [[image TIFFRepresentationUsingCompression:NSTIFFCompressionJPEG factor:0.01] base64EncodingWithLineLength:0]]; + } + [v release]; + [tempRow addObject:[NSString stringWithFormat:@"%@%@", [o wktString], imageStr]]; + } else { NSImage *image = [[NSImage alloc] initWithData:o]; if (image) { @@ -2476,8 +2499,7 @@ for (i = 0; i < [rowFieldsToSave count]; i++) { if (i) [queryString appendString:@", "]; [queryString appendFormat:@"%@ = %@", - [NSArrayObjectAtIndex(rowFieldsToSave, i) backtickQuotedString], - NSArrayObjectAtIndex(rowValuesToSave, i)]; + [NSArrayObjectAtIndex(rowFieldsToSave, i) backtickQuotedString], NSArrayObjectAtIndex(rowValuesToSave, i)]; } [queryString appendFormat:@" WHERE %@", [self argumentForRow:-2]]; } diff --git a/sequel-pro.xcodeproj/project.pbxproj b/sequel-pro.xcodeproj/project.pbxproj index 48fe7c2a..fdd5ef86 100644 --- a/sequel-pro.xcodeproj/project.pbxproj +++ b/sequel-pro.xcodeproj/project.pbxproj @@ -650,6 +650,7 @@ 1789343A0F30C1DD0097539A /* SPStringAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPStringAdditions.h; sourceTree = "<group>"; }; 1789343B0F30C1DD0097539A /* SPStringAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPStringAdditions.m; sourceTree = "<group>"; }; 178934980F30CDA10097539A /* trim-application.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "trim-application.sh"; sourceTree = "<group>"; }; + 1791346512F75CC1000B27C1 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; }; 1792C13110AD752100ABE758 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Interfaces/English.lproj/DatabaseServerVariables.xib; sourceTree = "<group>"; }; 1792C13510AD75C800ABE758 /* SPServerVariablesController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPServerVariablesController.h; sourceTree = "<group>"; }; 1792C13610AD75C800ABE758 /* SPServerVariablesController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPServerVariablesController.m; sourceTree = "<group>"; }; @@ -2294,6 +2295,7 @@ 2A37F4AAFDCFA73011CA2CEA /* sequel-pro */ = { isa = PBXGroup; children = ( + 1791346512F75CC1000B27C1 /* README */, 17E641420EF01E8A001BC333 /* Source */, 380F4EF20FC0B67A00B0BFD7 /* Unit Tests */, 17E642050EF020A3001BC333 /* Interfaces */, |