aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2011-01-20 02:34:28 +0000
committerrowanbeentje <rowan@beent.je>2011-01-20 02:34:28 +0000
commit4ef4c1f288938e8f281dbd238d853926941b570c (patch)
treebeb93a6d25880d51dcac9391dca5049910a80d98
parentfa8cf4d15f95b0d3db90311c252b2398e9e51345 (diff)
downloadsequelpro-4ef4c1f288938e8f281dbd238d853926941b570c.tar.gz
sequelpro-4ef4c1f288938e8f281dbd238d853926941b570c.tar.bz2
sequelpro-4ef4c1f288938e8f281dbd238d853926941b570c.zip
- When saving user changes to the database, catch errors and display them in a single sheet for review. This fixes a number of isGroupRow crashes on any error.
- Track a host row's original host to allow host edits - Update localisable strings
-rw-r--r--Interfaces/English.lproj/UserManagerView.xib545
-rw-r--r--Models/SPUserManager.xcdatamodel/elementsbin132168 -> 135130 bytes
-rw-r--r--Models/SPUserManager.xcdatamodel/layoutbin9663 -> 9663 bytes
-rw-r--r--Resources/English.lproj/DBView.stringsbin100436 -> 100462 bytes
-rw-r--r--Resources/English.lproj/Localizable.stringsbin211178 -> 212828 bytes
-rw-r--r--Resources/English.lproj/UserManagerView.stringsbin14802 -> 16228 bytes
-rw-r--r--Source/SPUserManager.h7
-rw-r--r--Source/SPUserManager.m74
8 files changed, 595 insertions, 31 deletions
diff --git a/Interfaces/English.lproj/UserManagerView.xib b/Interfaces/English.lproj/UserManagerView.xib
index 795c247c..fbde0774 100644
--- a/Interfaces/English.lproj/UserManagerView.xib
+++ b/Interfaces/English.lproj/UserManagerView.xib
@@ -2,10 +2,10 @@
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">1050</int>
- <string key="IBDocument.SystemVersion">10F569</string>
- <string key="IBDocument.InterfaceBuilderVersion">804</string>
- <string key="IBDocument.AppKitVersion">1038.29</string>
- <string key="IBDocument.HIToolboxVersion">461.00</string>
+ <string key="IBDocument.SystemVersion">10J567</string>
+ <string key="IBDocument.InterfaceBuilderVersion">788</string>
+ <string key="IBDocument.AppKitVersion">1038.35</string>
+ <string key="IBDocument.HIToolboxVersion">462.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
@@ -15,18 +15,19 @@
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
- <string>804</string>
+ <string>788</string>
<string>1.2.5</string>
</object>
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="593"/>
+ <integer value="43"/>
+ <integer value="984"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
- <string>com.brandonwalkin.BWToolkit</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.brandonwalkin.BWToolkit</string>
</object>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -56,7 +57,7 @@
<string key="NSWindowTitle">User Managment</string>
<string key="NSWindowClass">NSWindow</string>
<nil key="NSViewClass"/>
- <string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string>
+ <string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string>
<string key="NSWindowContentMinSize">{752, 506}</string>
<object class="NSView" key="NSWindowView" id="846307432">
<reference key="NSNextResponder"/>
@@ -148,7 +149,7 @@
<string key="NSColorName">controlBackgroundColor</string>
<object class="NSColor" key="NSColor" id="246134814">
<int key="NSColorSpace">3</int>
- <bytes key="NSWhite">MC42NjY2NjY2ODY1AA</bytes>
+ <bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
</object>
</object>
<object class="NSColor" key="NSTextColor" id="315534074">
@@ -2224,7 +2225,7 @@
</object>
<string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string>
<string key="NSMinSize">{752, 528}</string>
- <string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string>
+ <string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string>
</object>
<object class="NSTreeController" id="889422316">
<object class="NSMutableArray" key="NSDeclaredKeys">
@@ -2430,6 +2431,201 @@
</object>
</object>
</object>
+ <object class="NSWindowTemplate" id="574715766">
+ <int key="NSWindowStyleMask">9</int>
+ <int key="NSWindowBacking">2</int>
+ <string key="NSWindowRect">{{157, 20}, {480, 441}}</string>
+ <int key="NSWTFlags">1954022400</int>
+ <string key="NSWindowTitle">Errors Sheet</string>
+ <string key="NSWindowClass">NSWindow</string>
+ <nil key="NSViewClass"/>
+ <object class="NSView" key="NSWindowView" id="340939829">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">256</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSTextField" id="521208280">
+ <reference key="NSNextResponder" ref="340939829"/>
+ <int key="NSvFlags">268</int>
+ <string key="NSFrame">{{17, 327}, {446, 94}}</string>
+ <reference key="NSSuperview" ref="340939829"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="758533948">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">272891904</int>
+ <string type="base64-UTF8" key="NSContents">RXJyb3JzIG9jY3VycmVkIHdoZW4gYXBwbHlpbmcgeW91ciBjaGFuZ2VzIHRvIHRoZSBzZXJ2ZXIuCgpT
+b21lIGNoYW5nZXMgbWF5IGhhdmUgYWxyZWFkeSBiZWVuIGFwcGxpZWQ7IHBsZWFzZSByZXZpZXcgdGhl
+IGVycm9ycyBiZWxvdyBiZWZvcmUgcHJvY2VlZGluZy4</string>
+ <object class="NSFont" key="NSSupport">
+ <string key="NSName">LucidaGrande</string>
+ <double key="NSSize">13</double>
+ <int key="NSfFlags">16</int>
+ </object>
+ <reference key="NSControlView" ref="521208280"/>
+ <reference key="NSBackgroundColor" ref="409859189"/>
+ <reference key="NSTextColor" ref="315534074"/>
+ </object>
+ </object>
+ <object class="NSScrollView" id="798811064">
+ <reference key="NSNextResponder" ref="340939829"/>
+ <int key="NSvFlags">274</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSClipView" id="306241942">
+ <reference key="NSNextResponder" ref="798811064"/>
+ <int key="NSvFlags">2304</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSTextView" id="234756526">
+ <reference key="NSNextResponder" ref="306241942"/>
+ <int key="NSvFlags">2322</int>
+ <string key="NSFrameSize">{438, 25}</string>
+ <reference key="NSSuperview" ref="306241942"/>
+ <object class="NSTextContainer" key="NSTextContainer" id="181756437">
+ <object class="NSLayoutManager" key="NSLayoutManager">
+ <object class="NSTextStorage" key="NSTextStorage">
+ <object class="NSMutableString" key="NSString">
+ <characters key="NS.bytes"/>
+ </object>
+ <nil key="NSDelegate"/>
+ </object>
+ <object class="NSMutableArray" key="NSTextContainers">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="181756437"/>
+ </object>
+ <int key="NSLMFlags">134</int>
+ <nil key="NSDelegate"/>
+ </object>
+ <reference key="NSTextView" ref="234756526"/>
+ <double key="NSWidth">438</double>
+ <int key="NSTCFlags">1</int>
+ </object>
+ <object class="NSTextViewSharedData" key="NSSharedData">
+ <int key="NSFlags">11237</int>
+ <int key="NSTextCheckingTypes">0</int>
+ <nil key="NSMarkedAttributes"/>
+ <reference key="NSBackgroundColor" ref="888720323"/>
+ <object class="NSDictionary" key="NSSelectedAttributes">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>NSBackgroundColor</string>
+ <string>NSColor</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSColor">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">selectedTextBackgroundColor</string>
+ <reference key="NSColor" ref="246134814"/>
+ </object>
+ <object class="NSColor">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">selectedTextColor</string>
+ <reference key="NSColor" ref="194396468"/>
+ </object>
+ </object>
+ </object>
+ <reference key="NSInsertionColor" ref="194396468"/>
+ <object class="NSDictionary" key="NSLinkAttributes">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>NSColor</string>
+ <string>NSCursor</string>
+ <string>NSUnderline</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSColor">
+ <int key="NSColorSpace">1</int>
+ <bytes key="NSRGB">MCAwIDEAA</bytes>
+ </object>
+ <object class="NSCursor">
+ <string key="NSHotSpot">{8, -8}</string>
+ <int key="NSCursorType">13</int>
+ </object>
+ <integer value="1"/>
+ </object>
+ </object>
+ <nil key="NSDefaultParagraphStyle"/>
+ </object>
+ <int key="NSTVFlags">6</int>
+ <string key="NSMaxSize">{463, 1e+07}</string>
+ <string key="NSMinize">{223, 25}</string>
+ <nil key="NSDelegate"/>
+ </object>
+ </object>
+ <string key="NSFrame">{{1, 1}, {438, 257}}</string>
+ <reference key="NSSuperview" ref="798811064"/>
+ <reference key="NSNextKeyView" ref="234756526"/>
+ <reference key="NSDocView" ref="234756526"/>
+ <reference key="NSBGColor" ref="888720323"/>
+ <object class="NSCursor" key="NSCursor">
+ <string key="NSHotSpot">{4, -5}</string>
+ <int key="NSCursorType">1</int>
+ </object>
+ <int key="NScvFlags">4</int>
+ </object>
+ <object class="NSScroller" id="403581926">
+ <reference key="NSNextResponder" ref="798811064"/>
+ <int key="NSvFlags">-2147483392</int>
+ <string key="NSFrame">{{424, 1}, {15, 257}}</string>
+ <reference key="NSSuperview" ref="798811064"/>
+ <reference key="NSTarget" ref="798811064"/>
+ <string key="NSAction">_doScroller:</string>
+ <double key="NSCurValue">1</double>
+ <double key="NSPercent">0.85256409645080566</double>
+ </object>
+ <object class="NSScroller" id="584287791">
+ <reference key="NSNextResponder" ref="798811064"/>
+ <int key="NSvFlags">-2147483392</int>
+ <string key="NSFrame">{{-100, -100}, {87, 18}}</string>
+ <reference key="NSSuperview" ref="798811064"/>
+ <int key="NSsFlags">1</int>
+ <reference key="NSTarget" ref="798811064"/>
+ <string key="NSAction">_doScroller:</string>
+ <double key="NSCurValue">1</double>
+ <double key="NSPercent">0.94565218687057495</double>
+ </object>
+ </object>
+ <string key="NSFrame">{{20, 60}, {440, 259}}</string>
+ <reference key="NSSuperview" ref="340939829"/>
+ <reference key="NSNextKeyView" ref="306241942"/>
+ <int key="NSsFlags">562</int>
+ <reference key="NSVScroller" ref="403581926"/>
+ <reference key="NSHScroller" ref="584287791"/>
+ <reference key="NSContentView" ref="306241942"/>
+ </object>
+ <object class="NSButton" id="942389557">
+ <reference key="NSNextResponder" ref="340939829"/>
+ <int key="NSvFlags">268</int>
+ <string key="NSFrame">{{314, 12}, {152, 32}}</string>
+ <reference key="NSSuperview" ref="340939829"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="521888647">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">134217728</int>
+ <string key="NSContents">OK</string>
+ <reference key="NSSupport" ref="746597359"/>
+ <reference key="NSControlView" ref="942389557"/>
+ <int key="NSButtonFlags">-2038284033</int>
+ <int key="NSButtonFlags2">129</int>
+ <string key="NSAlternateContents"/>
+ <string type="base64-UTF8" key="NSKeyEquivalent">DQ</string>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ </object>
+ <string key="NSFrameSize">{480, 441}</string>
+ <reference key="NSSuperview"/>
+ </object>
+ <string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
+ <string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string>
+ </object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
<object class="NSMutableArray" key="connectionRecords">
@@ -4145,6 +4341,30 @@
</object>
<int key="connectionID">982</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">errorsSheet</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="574715766"/>
+ </object>
+ <int key="connectionID">993</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">errorsTextView</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="234756526"/>
+ </object>
+ <int key="connectionID">994</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">closeErrorsSheet:</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="942389557"/>
+ </object>
+ <int key="connectionID">998</int>
+ </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -5411,6 +5631,80 @@
<reference key="object" ref="765293659"/>
<reference key="parent" ref="473921129"/>
</object>
+ <object class="IBObjectRecord">
+ <int key="objectID">983</int>
+ <reference key="object" ref="574715766"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="340939829"/>
+ </object>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">984</int>
+ <reference key="object" ref="340939829"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="521208280"/>
+ <reference ref="798811064"/>
+ <reference ref="942389557"/>
+ </object>
+ <reference key="parent" ref="574715766"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">985</int>
+ <reference key="object" ref="521208280"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="758533948"/>
+ </object>
+ <reference key="parent" ref="340939829"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">986</int>
+ <reference key="object" ref="758533948"/>
+ <reference key="parent" ref="521208280"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">987</int>
+ <reference key="object" ref="798811064"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="403581926"/>
+ <reference ref="584287791"/>
+ <reference ref="234756526"/>
+ </object>
+ <reference key="parent" ref="340939829"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">988</int>
+ <reference key="object" ref="403581926"/>
+ <reference key="parent" ref="798811064"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">989</int>
+ <reference key="object" ref="584287791"/>
+ <reference key="parent" ref="798811064"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">990</int>
+ <reference key="object" ref="234756526"/>
+ <reference key="parent" ref="798811064"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">995</int>
+ <reference key="object" ref="942389557"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="521888647"/>
+ </object>
+ <reference key="parent" ref="340939829"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">996</int>
+ <reference key="object" ref="521888647"/>
+ <reference key="parent" ref="942389557"/>
+ </object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
@@ -5594,6 +5888,19 @@
<string>973.IBNumberFormatterBehaviorMetadataKey</string>
<string>973.IBNumberFormatterLocalizesFormatMetadataKey</string>
<string>973.IBPluginDependency</string>
+ <string>983.IBEditorWindowLastContentRect</string>
+ <string>983.IBPluginDependency</string>
+ <string>983.IBWindowTemplateEditedContentRect</string>
+ <string>983.NSWindowTemplate.visibleAtLaunch</string>
+ <string>984.IBPluginDependency</string>
+ <string>985.IBPluginDependency</string>
+ <string>986.IBPluginDependency</string>
+ <string>987.IBPluginDependency</string>
+ <string>988.IBPluginDependency</string>
+ <string>989.IBPluginDependency</string>
+ <string>990.IBPluginDependency</string>
+ <string>995.IBPluginDependency</string>
+ <string>996.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -5617,9 +5924,9 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{315, 326}, {815, 506}}</string>
+ <string>{{187, 326}, {815, 506}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{315, 326}, {815, 506}}</string>
+ <string>{{187, 326}, {815, 506}}</string>
<boolean value="NO"/>
<boolean value="YES"/>
<string>{752, 506}</string>
@@ -5795,6 +6102,19 @@
<integer value="1040"/>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{{348, 393}, {480, 441}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{{348, 393}, {480, 441}}</string>
+ <boolean value="NO"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
@@ -5813,7 +6133,7 @@
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">982</int>
+ <int key="maxID">998</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -5833,10 +6153,10 @@
</object>
</object>
<object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
+ <string key="className">NSMenu</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
- <string key="minorKey">Frameworks/MCPKit/MCPFoundationKit/MCPConnection.h</string>
+ <string key="minorKey">Source/SPMenuAdditions.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
@@ -5921,6 +6241,143 @@
</object>
</object>
<object class="IBPartialClassDescription">
+ <string key="className">NSTextView</string>
+ <object class="NSMutableDictionary" key="actions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>doDecomposedStringWithCanonicalMapping:</string>
+ <string>doDecomposedStringWithCompatibilityMapping:</string>
+ <string>doPrecomposedStringWithCanonicalMapping:</string>
+ <string>doPrecomposedStringWithCompatibilityMapping:</string>
+ <string>doRemoveDiacritics:</string>
+ <string>doSelectionLowerCase:</string>
+ <string>doSelectionTitleCase:</string>
+ <string>doSelectionUpperCase:</string>
+ <string>doTranspose:</string>
+ <string>executeBundleItemForInputField:</string>
+ <string>insertNULLvalue:</string>
+ <string>moveSelectionLineDown:</string>
+ <string>moveSelectionLineUp:</string>
+ <string>selectCurrentLine:</string>
+ <string>selectCurrentWord:</string>
+ <string>selectEnclosingBrackets:</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="actionInfosByName">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>doDecomposedStringWithCanonicalMapping:</string>
+ <string>doDecomposedStringWithCompatibilityMapping:</string>
+ <string>doPrecomposedStringWithCanonicalMapping:</string>
+ <string>doPrecomposedStringWithCompatibilityMapping:</string>
+ <string>doRemoveDiacritics:</string>
+ <string>doSelectionLowerCase:</string>
+ <string>doSelectionTitleCase:</string>
+ <string>doSelectionUpperCase:</string>
+ <string>doTranspose:</string>
+ <string>executeBundleItemForInputField:</string>
+ <string>insertNULLvalue:</string>
+ <string>moveSelectionLineDown:</string>
+ <string>moveSelectionLineUp:</string>
+ <string>selectCurrentLine:</string>
+ <string>selectCurrentWord:</string>
+ <string>selectEnclosingBrackets:</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBActionInfo">
+ <string key="name">doDecomposedStringWithCanonicalMapping:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">doDecomposedStringWithCompatibilityMapping:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">doPrecomposedStringWithCanonicalMapping:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">doPrecomposedStringWithCompatibilityMapping:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">doRemoveDiacritics:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">doSelectionLowerCase:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">doSelectionTitleCase:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">doSelectionUpperCase:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">doTranspose:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">executeBundleItemForInputField:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">insertNULLvalue:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">moveSelectionLineDown:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">moveSelectionLineUp:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">selectCurrentLine:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">selectCurrentWord:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">selectEnclosingBrackets:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">Source/SPTextViewAdditions.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
<string key="className">NSWindow</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
@@ -5946,6 +6403,7 @@
<string>addSchemaPriv:</string>
<string>addUser:</string>
<string>checkAllPrivileges:</string>
+ <string>closeErrorsSheet:</string>
<string>doApply:</string>
<string>doCancel:</string>
<string>refresh:</string>
@@ -5967,6 +6425,7 @@
<string>id</string>
<string>id</string>
<string>id</string>
+ <string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
@@ -5977,6 +6436,7 @@
<string>addSchemaPriv:</string>
<string>addUser:</string>
<string>checkAllPrivileges:</string>
+ <string>closeErrorsSheet:</string>
<string>doApply:</string>
<string>doCancel:</string>
<string>refresh:</string>
@@ -6004,6 +6464,10 @@
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
+ <string key="name">closeErrorsSheet:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
<string key="name">doApply:</string>
<string key="candidateClassName">id</string>
</object>
@@ -6040,6 +6504,8 @@
<string>addSchemaPrivButton</string>
<string>availableController</string>
<string>availableTableView</string>
+ <string>errorsSheet</string>
+ <string>errorsTextView</string>
<string>grantedController</string>
<string>grantedTableView</string>
<string>maxConnectionsTextField</string>
@@ -6060,6 +6526,8 @@
<string>NSButton</string>
<string>NSArrayController</string>
<string>NSTableView</string>
+ <string>NSWindow</string>
+ <string>NSTextView</string>
<string>NSArrayController</string>
<string>NSTableView</string>
<string>NSTextField</string>
@@ -6083,6 +6551,8 @@
<string>addSchemaPrivButton</string>
<string>availableController</string>
<string>availableTableView</string>
+ <string>errorsSheet</string>
+ <string>errorsTextView</string>
<string>grantedController</string>
<string>grantedTableView</string>
<string>maxConnectionsTextField</string>
@@ -6113,6 +6583,14 @@
<string key="candidateClassName">NSTableView</string>
</object>
<object class="IBToOneOutletInfo">
+ <string key="name">errorsSheet</string>
+ <string key="candidateClassName">NSWindow</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">errorsTextView</string>
+ <string key="candidateClassName">NSTextView</string>
+ </object>
+ <object class="IBToOneOutletInfo">
<string key="name">grantedController</string>
<string key="candidateClassName">NSArrayController</string>
</object>
@@ -6680,6 +7158,27 @@
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">ShortcutRecorder.framework/Headers/SRRecorderCell.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">ShortcutRecorder.framework/Headers/SRRecorderControl.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">ShortcutRecorder.framework/Headers/SRValidator.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Sparkle.framework/Headers/SUAppcast.h</string>
</object>
</object>
@@ -6879,6 +7378,14 @@
<reference key="sourceIdentifier" ref="739519750"/>
</object>
<object class="IBPartialClassDescription">
+ <string key="className">NSText</string>
+ <string key="superclassName">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSText.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
<string key="className">NSTextField</string>
<string key="superclassName">NSControl</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
@@ -6895,6 +7402,14 @@
</object>
</object>
<object class="IBPartialClassDescription">
+ <string key="className">NSTextView</string>
+ <string key="superclassName">NSText</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSTextView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
<string key="className">NSTreeController</string>
<string key="superclassName">NSObjectController</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
diff --git a/Models/SPUserManager.xcdatamodel/elements b/Models/SPUserManager.xcdatamodel/elements
index d9f1e943..01aa994f 100644
--- a/Models/SPUserManager.xcdatamodel/elements
+++ b/Models/SPUserManager.xcdatamodel/elements
Binary files differ
diff --git a/Models/SPUserManager.xcdatamodel/layout b/Models/SPUserManager.xcdatamodel/layout
index 7e8fd9cf..d177ace3 100644
--- a/Models/SPUserManager.xcdatamodel/layout
+++ b/Models/SPUserManager.xcdatamodel/layout
Binary files differ
diff --git a/Resources/English.lproj/DBView.strings b/Resources/English.lproj/DBView.strings
index f7096605..35f47990 100644
--- a/Resources/English.lproj/DBView.strings
+++ b/Resources/English.lproj/DBView.strings
Binary files differ
diff --git a/Resources/English.lproj/Localizable.strings b/Resources/English.lproj/Localizable.strings
index 345a08ee..101f45e3 100644
--- a/Resources/English.lproj/Localizable.strings
+++ b/Resources/English.lproj/Localizable.strings
Binary files differ
diff --git a/Resources/English.lproj/UserManagerView.strings b/Resources/English.lproj/UserManagerView.strings
index bf8bad55..9f31028f 100644
--- a/Resources/English.lproj/UserManagerView.strings
+++ b/Resources/English.lproj/UserManagerView.strings
Binary files differ
diff --git a/Source/SPUserManager.h b/Source/SPUserManager.h
index c4eff098..8bb4e4d2 100644
--- a/Source/SPUserManager.h
+++ b/Source/SPUserManager.h
@@ -59,6 +59,9 @@
IBOutlet NSTextField *userNameTextField;
+ IBOutlet NSWindow *errorsSheet;
+ IBOutlet NSTextView *errorsTextView;
+
IBOutlet BWAnchoredButtonBar *splitViewButtonBar;
NSMutableArray *schemas;
@@ -67,6 +70,9 @@
NSArray *treeSortDescriptors;
NSSortDescriptor *treeSortDescriptor;
+
+ BOOL isSaving;
+ NSMutableString *errorsString;
}
@property (nonatomic, retain) MCPConnection *mySqlConnection;
@@ -93,6 +99,7 @@
- (IBAction)doApply:(id)sender;
- (IBAction)checkAllPrivileges:(id)sender;
- (IBAction)uncheckAllPrivileges:(id)sender;
+- (IBAction)closeErrorsSheet:(id)sender;
// Schema Privieges
- (IBAction)addSchemaPriv:(id)sender;
diff --git a/Source/SPUserManager.m b/Source/SPUserManager.m
index 87b01cdc..9118d8a9 100644
--- a/Source/SPUserManager.m
+++ b/Source/SPUserManager.m
@@ -91,6 +91,7 @@ static const NSString *SPTableViewNameColumnID = @"NameColumn";
schemas = [[NSMutableArray alloc] init];
availablePrivs = [[NSMutableArray alloc] init];
grantedSchemaPrivs = [[NSMutableArray alloc] init];
+ isSaving = NO;
}
return self;
@@ -367,6 +368,10 @@ static const NSString *SPTableViewNameColumnID = @"NameColumn";
{
// Assumes that the child has already been initialized with values from the
// global user table.
+
+ // Set an originalhost key on the child to allow the tracking of edits
+ [child setPrimitiveValue:[child valueForKey:@"host"] forKey:@"originalhost"];
+
// Select rows from the db table that contains schema privs for each user/host
NSString *queryString = [NSString stringWithFormat:@"SELECT * from mysql.db d WHERE d.user = %@ and d.host = %@",
[[[child parent] valueForKey:@"user"] tickQuotedString], [[child valueForKey:@"host"] tickQuotedString]];
@@ -601,21 +606,29 @@ static const NSString *SPTableViewNameColumnID = @"NameColumn";
- (IBAction)doApply:(id)sender
{
NSError *error = nil;
+ errorsString = [[NSMutableString alloc] init];
//Change the first responder to end editing in any field
[[self window] makeFirstResponder:self];
+ isSaving = YES;
[[self managedObjectContext] save:&error];
-
- if (error != nil) {
- [[NSApplication sharedApplication] presentError:error];
- }
- else {
- // Close sheet
- [self.mySqlConnection queryString:@"FLUSH PRIVILEGES"];
- [NSApp endSheet:[self window] returnCode:0];
- [[self window] orderOut:self];
+ isSaving = NO;
+ if (error != nil) [errorsString appendString:[error localizedDescription]];
+
+ [self.mySqlConnection queryString:@"FLUSH PRIVILEGES"];
+
+ // Display any errors
+ if ([errorsString length]) {
+ [errorsTextView setString:errorsString];
+ [NSApp beginSheet:errorsSheet modalForWindow:[NSApp keyWindow] modalDelegate:nil didEndSelector:NULL contextInfo:nil];
+ [errorsString release];
+ return;
}
+
+ // Otherwise, close the sheet
+ [NSApp endSheet:[self window] returnCode:0];
+ [[self window] orderOut:self];
}
/**
@@ -955,12 +968,25 @@ static const NSString *SPTableViewNameColumnID = @"NameColumn";
}
}
+/**
+ * Closes the supplied sheet, before closing the master window.
+ */
+- (IBAction)closeErrorsSheet:(id)sender
+{
+ [NSApp endSheet:[sender window] returnCode:[sender tag]];
+ [[sender window] orderOut:self];
+
+ // Close the window
+ [NSApp endSheet:[self window] returnCode:0];
+ [[self window] orderOut:self];
+}
+
#pragma mark -
#pragma mark Notifications
/**
* This notification is called when the managedObjectContext save happens.
- * This takes the inserted, updated, and deleted arrays and applys them to
+ * This takes the inserted, updated, and deleted arrays and applies them to
* the database.
*/
- (void)contextDidSave:(NSNotification *)notification
@@ -1016,7 +1042,7 @@ static const NSString *SPTableViewNameColumnID = @"NameColumn";
NSString *renameUserStatement = [NSString stringWithFormat:
@"RENAME USER %@@%@ TO %@@%@",
[[user valueForKey:@"originaluser"] tickQuotedString],
- [[child host] tickQuotedString],
+ [([child valueForKey:@"originalhost"]?[child valueForKey:@"originalhost"]:[child host]) tickQuotedString],
[[user valueForKey:@"user"] tickQuotedString],
[[child host] tickQuotedString]];
@@ -1041,6 +1067,19 @@ static const NSString *SPTableViewNameColumnID = @"NameColumn";
}
}
else {
+
+ // If the hostname has changed, remane the detail before editing details.
+ if (![[user valueForKey:@"host"] isEqualToString:[user valueForKey:@"originalhost"]]) {
+ NSString *renameUserStatement = [NSString stringWithFormat:
+ @"RENAME USER %@@%@ TO %@@%@",
+ [[[user parent] valueForKey:@"originaluser"] tickQuotedString],
+ [[user valueForKey:@"originalhost"] tickQuotedString],
+ [[[user parent] valueForKey:@"user"] tickQuotedString],
+ [[user valueForKey:@"host"] tickQuotedString]];
+
+ [self.mySqlConnection queryString:renameUserStatement];
+ }
+
if ([serverSupport supportsUserMaxVars]) [self updateResourcesForUser:user];
[self grantPrivilegesToUser:user];
@@ -1387,11 +1426,14 @@ static const NSString *SPTableViewNameColumnID = @"NameColumn";
- (BOOL)_checkAndDisplayMySqlError
{
if ([self.mySqlConnection queryErrored]) {
-
- SPBeginAlertSheet(NSLocalizedString(@"An error occurred", @"mysql error occurred message"),
- NSLocalizedString(@"OK", @"OK button"), nil, nil, [self window], self, nil, nil,
- [NSString stringWithFormat:NSLocalizedString(@"An error occurred whilst trying to perform the operation.\n\nMySQL said: %@", @"mysql error occurred informative message"), [self.mySqlConnection getLastErrorMessage]]);
-
+ if (isSaving) {
+ [errorsString appendFormat:@"%@\n", [self.mySqlConnection getLastErrorMessage]];
+ } else {
+ SPBeginAlertSheet(NSLocalizedString(@"An error occurred", @"mysql error occurred message"),
+ NSLocalizedString(@"OK", @"OK button"), nil, nil, [self window], self, nil, nil,
+ [NSString stringWithFormat:NSLocalizedString(@"An error occurred whilst trying to perform the operation.\n\nMySQL said: %@", @"mysql error occurred informative message"), [self.mySqlConnection getLastErrorMessage]]);
+ }
+
return NO;
}