aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2009-08-11 13:59:58 +0000
committerBibiko <bibiko@eva.mpg.de>2009-08-11 13:59:58 +0000
commit07082135254e88cbfd421aa41f12522582b10d89 (patch)
tree646e38024c453a0146ef59b33bae339f90c4749d
parent32df64e8f588f6a16f2ad9c821c6db149c3bdb03 (diff)
downloadsequelpro-07082135254e88cbfd421aa41f12522582b10d89.tar.gz
sequelpro-07082135254e88cbfd421aa41f12522582b10d89.tar.bz2
sequelpro-07082135254e88cbfd421aa41f12522582b10d89.zip
• in Table Content the button status of "edit spreadsheet or sheet-like" will be saved in the Prefs
• font settings in the Field Editor Sheet will be saved in the Prefs • improved max text length checking while using other InputManager (eg Japanese etc.) - still a bit under construction Note: each Beep() wil be replaced by a tooltip soon.
-rw-r--r--Interfaces/English.lproj/DBView.xib65
-rw-r--r--Interfaces/English.lproj/FieldEditorSheet.xib27
-rw-r--r--Resources/PreferenceDefaults.plist2
-rw-r--r--Source/SPEditSheetTextView.h1
-rw-r--r--Source/SPEditSheetTextView.m17
-rw-r--r--Source/SPFieldEditorController.m71
6 files changed, 110 insertions, 73 deletions
diff --git a/Interfaces/English.lproj/DBView.xib b/Interfaces/English.lproj/DBView.xib
index 1db91c7e..7b8afb3a 100644
--- a/Interfaces/English.lproj/DBView.xib
+++ b/Interfaces/English.lproj/DBView.xib
@@ -8,7 +8,6 @@
<string key="IBDocument.HIToolboxVersion">353.00</string>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="839"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -186,7 +185,6 @@
</object>
<string key="NSFrameSize">{212, 26}</string>
<reference key="NSSuperview" ref="199860064"/>
- <reference key="NSNextKeyView" ref="643201879"/>
<reference key="NSDocView" ref="643201879"/>
<object class="NSColor" key="NSBGColor" id="529261656">
<int key="NSColorSpace">6</int>
@@ -222,7 +220,6 @@
</object>
<string key="NSFrameSize">{212, 26}</string>
<reference key="NSSuperview" ref="801427893"/>
- <reference key="NSNextKeyView" ref="588922296"/>
<int key="NSsFlags">0</int>
<reference key="NSVScroller" ref="540853896"/>
<reference key="NSHScroller" ref="566705316"/>
@@ -337,7 +334,6 @@
</object>
<string key="NSFrameSize">{212, 354}</string>
<reference key="NSSuperview" ref="233472824"/>
- <reference key="NSNextKeyView" ref="251040077"/>
<reference key="NSDocView" ref="251040077"/>
<object class="NSColor" key="NSBGColor" id="1024678221">
<int key="NSColorSpace">6</int>
@@ -369,7 +365,6 @@
</object>
<string key="NSFrameSize">{212, 354}</string>
<reference key="NSSuperview" ref="1017775084"/>
- <reference key="NSNextKeyView" ref="73685676"/>
<int key="NSsFlags">528</int>
<reference key="NSVScroller" ref="693168867"/>
<reference key="NSHScroller" ref="656188692"/>
@@ -494,7 +489,6 @@
</object>
<string key="NSFrameSize">{212, 145}</string>
<reference key="NSSuperview" ref="298226231"/>
- <reference key="NSNextKeyView" ref="347093764"/>
<reference key="NSDocView" ref="347093764"/>
<reference key="NSBGColor" ref="1024678221"/>
<int key="NScvFlags">6</int>
@@ -521,7 +515,6 @@
</object>
<string key="NSFrameSize">{212, 145}</string>
<reference key="NSSuperview" ref="192579410"/>
- <reference key="NSNextKeyView" ref="685057119"/>
<int key="NSsFlags">512</int>
<reference key="NSVScroller" ref="245346414"/>
<reference key="NSHScroller" ref="353686052"/>
@@ -2052,7 +2045,7 @@
<object class="NSTabViewItem" id="624106058">
<string key="NSIdentifier">content</string>
<object class="NSView" key="NSView" id="1013108064">
- <reference key="NSNextResponder" ref="714795046"/>
+ <nil key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -2242,8 +2235,8 @@
<bool key="NS.raise.underflow">YES</bool>
<bool key="NS.raise.dividebyzero">YES</bool>
</object>
- <string key="NS.decimal">.</string>
- <string key="NS.thousand">,</string>
+ <string key="NS.decimal">,</string>
+ <string key="NS.thousand">.</string>
<bool key="NS.hasthousands">NO</bool>
<bool key="NS.localized">YES</bool>
<bool key="NS.allowsfloats">NO</bool>
@@ -2690,7 +2683,6 @@
</object>
</object>
<string key="NSFrame">{{10, 7}, {700, 544}}</string>
- <reference key="NSSuperview" ref="714795046"/>
</object>
<string key="NSLabel">Content</string>
<reference key="NSColor" ref="62854682"/>
@@ -2699,7 +2691,7 @@
<object class="NSTabViewItem" id="105987292">
<string key="NSIdentifier">customQuery</string>
<object class="NSView" key="NSView" id="746504912">
- <nil key="NSNextResponder"/>
+ <reference key="NSNextResponder" ref="714795046"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -2786,7 +2778,6 @@
</object>
<string key="NSFrame">{{1, 1}, {688, 155}}</string>
<reference key="NSSuperview" ref="71560786"/>
- <reference key="NSNextKeyView" ref="1055190999"/>
<reference key="NSDocView" ref="1055190999"/>
<reference key="NSBGColor" ref="449903125"/>
<object class="NSCursor" key="NSCursor" id="32917531">
@@ -2818,7 +2809,6 @@
</object>
<string key="NSFrameSize">{690, 157}</string>
<reference key="NSSuperview" ref="873437769"/>
- <reference key="NSNextKeyView" ref="1072692119"/>
<int key="NSsFlags">530</int>
<reference key="NSVScroller" ref="413233170"/>
<reference key="NSHScroller" ref="783638826"/>
@@ -2905,7 +2895,6 @@
</object>
<string key="NSFrame">{{1, 17}, {688, 228}}</string>
<reference key="NSSuperview" ref="678281118"/>
- <reference key="NSNextKeyView" ref="581095761"/>
<reference key="NSDocView" ref="581095761"/>
<reference key="NSBGColor" ref="1024678221"/>
<int key="NScvFlags">4</int>
@@ -2938,7 +2927,6 @@
</object>
<string key="NSFrame">{{1, 0}, {688, 17}}</string>
<reference key="NSSuperview" ref="678281118"/>
- <reference key="NSNextKeyView" ref="1038415606"/>
<reference key="NSDocView" ref="1038415606"/>
<reference key="NSBGColor" ref="1024678221"/>
<int key="NScvFlags">4</int>
@@ -2947,7 +2935,6 @@
</object>
<string key="NSFrameSize">{690, 246}</string>
<reference key="NSSuperview" ref="345834048"/>
- <reference key="NSNextKeyView" ref="90844306"/>
<int key="NSsFlags">562</int>
<reference key="NSVScroller" ref="472831765"/>
<reference key="NSHScroller" ref="851610321"/>
@@ -3101,7 +3088,7 @@
<reference key="NSControlView" ref="363916571"/>
<int key="NSButtonFlags">-2042609409</int>
<int key="NSButtonFlags2">35</int>
- <object class="NSCustomResource" key="NSNormalImage">
+ <object class="NSCustomResource" key="NSNormalImage" id="103563712">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">button_action</string>
</object>
@@ -3116,10 +3103,7 @@
<string key="NSKeyEquiv"/>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
- <object class="NSCustomResource" key="NSImage">
- <string key="NSClassName">NSImage</string>
- <string key="NSResourceName">button_action</string>
- </object>
+ <reference key="NSImage" ref="103563712"/>
<string key="NSAction">_popUpItemAction:</string>
<reference key="NSTarget" ref="984501775"/>
</object>
@@ -3491,6 +3475,7 @@
</object>
</object>
<string key="NSFrame">{{10, 7}, {700, 544}}</string>
+ <reference key="NSSuperview" ref="714795046"/>
</object>
<string key="NSLabel">Custom Query</string>
<reference key="NSColor" ref="62854682"/>
@@ -4530,14 +4515,14 @@
<reference key="NSTabView" ref="714795046"/>
</object>
</object>
- <reference key="NSSelectedTabViewItem" ref="624106058"/>
+ <reference key="NSSelectedTabViewItem" ref="105987292"/>
<reference key="NSFont" ref="26"/>
<int key="NSTvFlags">134217731</int>
<bool key="NSAllowTruncatedLabels">YES</bool>
<bool key="NSDrawsBackground">YES</bool>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="1013108064"/>
+ <reference ref="746504912"/>
</object>
</object>
</object>
@@ -7331,7 +7316,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string>
<string key="NSWindowContentMinSize">{350, 200}</string>
<object class="NSView" key="NSWindowView" id="226131408">
- <reference key="NSNextResponder"/>
+ <nil key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -7436,7 +7421,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
</object>
<string key="NSFrame">{{1, 17}, {399, 251}}</string>
<reference key="NSSuperview" ref="294857516"/>
- <reference key="NSNextKeyView" ref="460727716"/>
<reference key="NSDocView" ref="460727716"/>
<reference key="NSBGColor" ref="1024678221"/>
<int key="NScvFlags">4</int>
@@ -7470,7 +7454,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
</object>
<string key="NSFrame">{{1, 0}, {399, 17}}</string>
<reference key="NSSuperview" ref="294857516"/>
- <reference key="NSNextKeyView" ref="74674217"/>
<reference key="NSDocView" ref="74674217"/>
<reference key="NSBGColor" ref="1024678221"/>
<int key="NScvFlags">4</int>
@@ -7479,7 +7462,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
</object>
<string key="NSFrame">{{-1, 39}, {412, 269}}</string>
<reference key="NSSuperview" ref="226131408"/>
- <reference key="NSNextKeyView" ref="841219743"/>
<int key="NSsFlags">18</int>
<reference key="NSVScroller" ref="297298990"/>
<reference key="NSHScroller" ref="857738313"/>
@@ -7626,7 +7608,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
</object>
</object>
<string key="NSFrameSize">{411, 341}</string>
- <reference key="NSSuperview"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
<string key="NSMinSize">{350, 222}</string>
@@ -11272,6 +11253,10 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<string key="NSClassName">NSView</string>
</object>
<object class="NSUserDefaultsController" id="461189245">
+ <object class="NSMutableArray" key="NSDeclaredKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>EditInSheetEnabled</string>
+ </object>
<bool key="NSSharedInstance">YES</bool>
</object>
<object class="NSCustomObject" id="601471102">
@@ -14922,6 +14907,22 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
</object>
<int key="connectionID">6349</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBBindingConnection" key="connection">
+ <string key="label">value: values.EditInSheetEnabled</string>
+ <reference key="source" ref="393139604"/>
+ <reference key="destination" ref="461189245"/>
+ <object class="NSNibBindingConnector" key="connector">
+ <reference key="NSSource" ref="393139604"/>
+ <reference key="NSDestination" ref="461189245"/>
+ <string key="NSLabel">value: values.EditInSheetEnabled</string>
+ <string key="NSBinding">value</string>
+ <string key="NSKeyPath">values.EditInSheetEnabled</string>
+ <int key="NSNibBindingConnectorVersion">2</int>
+ </object>
+ </object>
+ <int key="connectionID">6351</int>
+ </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -23356,9 +23357,9 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{366, 250}, {944, 550}}</string>
+ <string>{{219, 267}, {944, 550}}</string>
<boolean value="NO"/>
- <string>{{366, 250}, {944, 550}}</string>
+ <string>{{219, 267}, {944, 550}}</string>
<reference ref="9"/>
<reference ref="9"/>
<string>{{62, 352}, {845, 504}}</string>
@@ -24354,7 +24355,7 @@ Y2hhbmdlIHRoZSBvcmRlcg</string>
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">6349</int>
+ <int key="maxID">6351</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
diff --git a/Interfaces/English.lproj/FieldEditorSheet.xib b/Interfaces/English.lproj/FieldEditorSheet.xib
index c4192a3e..19d70fa8 100644
--- a/Interfaces/English.lproj/FieldEditorSheet.xib
+++ b/Interfaces/English.lproj/FieldEditorSheet.xib
@@ -45,7 +45,7 @@
</object>
<string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string>
<object class="NSView" key="NSWindowView" id="559857537">
- <reference key="NSNextResponder"/>
+ <nil key="NSNextResponder"/>
<int key="NSvFlags">4370</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -54,7 +54,6 @@
<int key="NSvFlags">34</int>
<string key="NSFrame">{{0, 48}, {667, 5}}</string>
<reference key="NSSuperview" ref="559857537"/>
- <reference key="NSWindow"/>
<string key="NSOffsets">{0, 0}</string>
<object class="NSTextFieldCell" key="NSTitleCell">
<int key="NSCellFlags">67239424</int>
@@ -89,7 +88,6 @@
<int key="NSvFlags">257</int>
<string key="NSFrame">{{581, 10}, {66, 25}}</string>
<reference key="NSSuperview" ref="559857537"/>
- <reference key="NSWindow"/>
<int key="NSTag">1</int>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="630700737">
@@ -121,7 +119,6 @@
<int key="NSvFlags">257</int>
<string key="NSFrame">{{507, 10}, {66, 25}}</string>
<reference key="NSSuperview" ref="559857537"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="617021739">
<int key="NSCellFlags">67239424</int>
@@ -147,7 +144,6 @@
<int key="NSvFlags">256</int>
<string key="NSFrame">{{94, 10}, {66, 25}}</string>
<reference key="NSSuperview" ref="559857537"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="1054617135">
<int key="NSCellFlags">67239424</int>
@@ -169,7 +165,6 @@
<int key="NSvFlags">256</int>
<string key="NSFrame">{{20, 10}, {66, 25}}</string>
<reference key="NSSuperview" ref="559857537"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="369856023">
<int key="NSCellFlags">67239424</int>
@@ -191,7 +186,6 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{328, 10}, {48, 25}}</string>
<reference key="NSSuperview" ref="559857537"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSPopUpButtonCell" key="NSCell" id="583599991">
<int key="NSCellFlags">71433792</int>
@@ -340,7 +334,6 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{183, 13}, {137, 19}}</string>
<reference key="NSSuperview" ref="559857537"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSSegmentedCell" key="NSCell" id="772630454">
<int key="NSCellFlags">-2080244224</int>
@@ -406,7 +399,6 @@
</object>
<string key="NSFrameSize">{667, 14}</string>
<reference key="NSSuperview" ref="1068411389"/>
- <reference key="NSWindow"/>
<object class="NSTextContainer" key="NSTextContainer" id="222392072">
<object class="NSLayoutManager" key="NSLayoutManager">
<object class="NSTextStorage" key="NSTextStorage">
@@ -471,7 +463,6 @@
</object>
<string key="NSFrameSize">{667, 370}</string>
<reference key="NSSuperview" ref="983787914"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="459839028"/>
<reference key="NSDocView" ref="459839028"/>
<reference key="NSBGColor" ref="940290613"/>
@@ -486,7 +477,6 @@
<int key="NSvFlags">-2147483392</int>
<string key="NSFrame">{{220, 1}, {11, 141}}</string>
<reference key="NSSuperview" ref="983787914"/>
- <reference key="NSWindow"/>
<int key="NSsFlags">256</int>
<reference key="NSTarget" ref="983787914"/>
<string key="NSAction">_doScroller:</string>
@@ -497,7 +487,6 @@
<int key="NSvFlags">256</int>
<string key="NSFrame">{{-100, -100}, {87, 18}}</string>
<reference key="NSSuperview" ref="983787914"/>
- <reference key="NSWindow"/>
<int key="NSsFlags">257</int>
<reference key="NSTarget" ref="983787914"/>
<string key="NSAction">_doScroller:</string>
@@ -507,7 +496,6 @@
</object>
<string key="NSFrame">{{0, 51}, {667, 370}}</string>
<reference key="NSSuperview" ref="559857537"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="1068411389"/>
<int key="NSsFlags">528</int>
<reference key="NSVScroller" ref="977735067"/>
@@ -531,7 +519,6 @@
</object>
<string key="NSFrame">{{0, 51}, {667, 370}}</string>
<reference key="NSSuperview" ref="559857537"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSImageCell" key="NSCell" id="521189288">
<int key="NSCellFlags">270663168</int>
@@ -581,7 +568,6 @@
</object>
<string key="NSFrameSize">{667, 14}</string>
<reference key="NSSuperview" ref="967441740"/>
- <reference key="NSWindow"/>
<object class="NSTextContainer" key="NSTextContainer" id="872196016">
<object class="NSLayoutManager" key="NSLayoutManager">
<object class="NSTextStorage" key="NSTextStorage">
@@ -602,7 +588,7 @@
<int key="NSTCFlags">1</int>
</object>
<object class="NSTextViewSharedData" key="NSSharedData">
- <int key="NSFlags">4067</int>
+ <int key="NSFlags">4083</int>
<reference key="NSBackgroundColor" ref="940290613"/>
<reference key="NSInsertionColor" ref="1021276550"/>
<object class="NSDictionary" key="NSSelectedAttributes">
@@ -650,7 +636,6 @@
</object>
<string key="NSFrameSize">{667, 370}</string>
<reference key="NSSuperview" ref="604699677"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="702566211"/>
<reference key="NSDocView" ref="702566211"/>
<reference key="NSBGColor" ref="940290613"/>
@@ -662,7 +647,6 @@
<int key="NSvFlags">-2147483392</int>
<string key="NSFrame">{{639, 2}, {11, 359}}</string>
<reference key="NSSuperview" ref="604699677"/>
- <reference key="NSWindow"/>
<int key="NSsFlags">256</int>
<reference key="NSTarget" ref="604699677"/>
<string key="NSAction">_doScroller:</string>
@@ -673,7 +657,6 @@
<int key="NSvFlags">256</int>
<string key="NSFrame">{{-100, -100}, {87, 18}}</string>
<reference key="NSSuperview" ref="604699677"/>
- <reference key="NSWindow"/>
<int key="NSsFlags">257</int>
<reference key="NSTarget" ref="604699677"/>
<string key="NSAction">_doScroller:</string>
@@ -683,7 +666,6 @@
</object>
<string key="NSFrame">{{0, 51}, {667, 370}}</string>
<reference key="NSSuperview" ref="559857537"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="967441740"/>
<int key="NSsFlags">528</int>
<reference key="NSVScroller" ref="699979333"/>
@@ -696,7 +678,6 @@
<object class="NSPSMatrix" key="NSDrawMatrix"/>
<string key="NSFrame">{{325, 232}, {32, 32}}</string>
<reference key="NSSuperview" ref="559857537"/>
- <reference key="NSWindow"/>
<int key="NSpiFlags">28682</int>
<double key="NSMinValue">1.600000e+01</double>
<double key="NSMaxValue">1.000000e+02</double>
@@ -706,7 +687,6 @@
<int key="NSvFlags">10</int>
<string key="NSFrame">{{0, 419}, {667, 5}}</string>
<reference key="NSSuperview" ref="559857537"/>
- <reference key="NSWindow"/>
<string key="NSOffsets">{0, 0}</string>
<object class="NSTextFieldCell" key="NSTitleCell">
<int key="NSCellFlags">67239424</int>
@@ -729,7 +709,6 @@
<int key="NSvFlags">257</int>
<string key="NSFrame">{{284, 36}, {362, 11}}</string>
<reference key="NSSuperview" ref="559857537"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="581551870">
<int key="NSCellFlags">67239488</int>
@@ -757,8 +736,6 @@
</object>
</object>
<string key="NSFrameSize">{667, 428}</string>
- <reference key="NSSuperview"/>
- <reference key="NSWindow"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1280, 778}}</string>
<string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string>
diff --git a/Resources/PreferenceDefaults.plist b/Resources/PreferenceDefaults.plist
index 72e975b3..f56b7432 100644
--- a/Resources/PreferenceDefaults.plist
+++ b/Resources/PreferenceDefaults.plist
@@ -38,6 +38,8 @@
<integer>60</integer>
<key>DisplayTableViewVerticalGridlines</key>
<false/>
+ <key>EditInSheetEnabled</key>
+ <false/>
<key>CustomQueryEditorFont</key>
<data>BAtzdHJlYW10eXBlZIHoA4QBQISEhAZOU0ZvbnQehIQITlNPYmplY3QAhYQBaRiEBVsyNGNdBgAAAA4AAAD//k0AbwBuAGEAYwBvAAAAhAFmCoQBYwCYAZgAmACG</data>
<key>CustomQueryEditorBackgroundColor</key>
diff --git a/Source/SPEditSheetTextView.h b/Source/SPEditSheetTextView.h
index 1c6ee563..7c225a78 100644
--- a/Source/SPEditSheetTextView.h
+++ b/Source/SPEditSheetTextView.h
@@ -28,5 +28,6 @@
- (unsigned int)characterIndexOfPoint:(NSPoint)aPoint;
- (void)insertFileContentOfFile:(NSString *)aPath;
+- (void)saveChangedFontInUserDefaults;
@end
diff --git a/Source/SPEditSheetTextView.m b/Source/SPEditSheetTextView.m
index 7f7e0d6c..83b691c9 100644
--- a/Source/SPEditSheetTextView.m
+++ b/Source/SPEditSheetTextView.m
@@ -24,6 +24,7 @@
#import "SPEditSheetTextView.h"
#import "SPTextViewAdditions.h"
+#import "SPFieldEditorController.h"
@implementation SPEditSheetTextView
@@ -51,11 +52,13 @@
if([charactersIgnMod isEqualToString:@"+"]) // increase text size by 1; ⌘+ and numpad +
{
[self makeTextSizeLarger];
+ [self saveChangedFontInUserDefaults];
return;
}
if([charactersIgnMod isEqualToString:@"-"]) // decrease text size by 1; ⌘- and numpad -
{
[self makeTextSizeSmaller];
+ [self saveChangedFontInUserDefaults];
return;
}
}
@@ -246,5 +249,19 @@
NSLog(@"%@ ‘%@’.", NSLocalizedString(@"Couldn't read the file content of", @"Couldn't read the file content of"), aPath);
}
+// Store the font in the prefs for selected delegates only
+- (void)saveChangedFontInUserDefaults
+{
+ if([[[[self delegate] class] description] isEqualToString:@"SPFieldEditorController"])
+ [[NSUserDefaults standardUserDefaults] setObject:[NSArchiver archivedDataWithRootObject:[self font]] forKey:@"FieldEditorSheetFont"];
+}
+
+// Action receiver for a font change in the font panel
+- (void)changeFont:(id)sender
+{
+ NSFont *nf = [[NSFontPanel sharedFontPanel] panelConvertFont:[self font]];
+ [self setFont:nf];
+ [self saveChangedFontInUserDefaults];
+}
@end
diff --git a/Source/SPFieldEditorController.m b/Source/SPFieldEditorController.m
index e5fd0550..40088a2b 100644
--- a/Source/SPFieldEditorController.m
+++ b/Source/SPFieldEditorController.m
@@ -30,28 +30,34 @@
#import "QLPreviewPanel.h"
#import "SPDataCellFormatter.h"
#import "RegexKitLite.h"
+#import "SPDataCellFormatter.h"
@implementation SPFieldEditorController
-- (id) init
+- (id)init
{
if ((self = [super initWithWindowNibName:@"FieldEditorSheet"])) {
// force the nib to be loaded
(void) [self window];
counter = 0;
maxTextLength = 0;
+
+ prefs = [NSUserDefaults standardUserDefaults];
// Used for max text length recognition if last typed char is a non-space char
editTextViewWasChanged = NO;
// Allow the user to enter cmd+return to close the edit sheet in addition to fn+return
[editSheetOkButton setKeyEquivalentModifierMask:NSCommandKeyMask];
+
+ // [editTextView setFormatter:[[SPDataCellFormatter new] autorelease]];
+
}
return self;
}
-- (void) dealloc
+- (void)dealloc
{
if ( sheetEditData ) [sheetEditData release];
[super dealloc];
@@ -65,13 +71,17 @@
- (id)editWithObject:(id)data fieldName:(NSString*)fieldName usingEncoding:(NSStringEncoding)anEncoding
isObjectBlob:(BOOL)isFieldBlob isEditable:(BOOL)isEditable withWindow:(NSWindow *)tableWindow
{
- prefs = [NSUserDefaults standardUserDefaults];
- if ( [prefs boolForKey:@"UseMonospacedFonts"] ) {
- [editTextView setFont:[NSFont fontWithName:@"Monaco" size:[NSFont smallSystemFontSize]]];
- } else {
- [editTextView setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]];
- }
+ if ( ![prefs objectForKey:@"FieldEditorSheetFont"] )
+ if ( [prefs boolForKey:@"UseMonospacedFonts"] ) {
+ [editTextView setFont:[NSFont fontWithName:@"Monaco" size:[NSFont smallSystemFontSize]]];
+ } else {
+ [editTextView setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]];
+ // [prefs setObject:[NSArchiver archivedDataWithRootObject:[editTextView font]] forKey:@"FieldEditorSheetFont"];
+ }
+ else
+ [editTextView setFont:[NSUnarchiver unarchiveObjectWithData:[prefs dataForKey:@"FieldEditorSheetFont"]]];
+
[hexTextView setFont:[NSFont fontWithName:@"Monaco" size:[NSFont smallSystemFontSize]]];
[editSheetFieldName setStringValue:[NSString stringWithFormat:@"%@: %@", NSLocalizedString(@"Field", @"Field"), fieldName]];
@@ -210,7 +220,18 @@
- (IBAction)closeEditSheet:(id)sender
{
+
+ // Validate the sheet data before saving them.
+ // - for max text length select the part which won't be saved
+ if(sender == editSheetOkButton)
+ if (maxTextLength > 0 && [[editTextView textStorage] length] > maxTextLength) {
+ [editTextView setSelectedRange:NSMakeRange(maxTextLength, [[editTextView textStorage] length] - maxTextLength)];
+ NSBeep();
+ return;
+ }
+
[NSApp stopModalWithCode:[sender tag]];
+
}
- (IBAction)openEditSheet:(id)sender
@@ -614,7 +635,7 @@
- (BOOL)textView:(NSTextView *)textView shouldChangeTextInRange:(NSRange)r replacementString:(NSString *)replacementString
{
if(textView == editTextView && maxTextLength > 0) {
-
+
int newLength;
// Auxilary to ensure that eg textViewDidChangeSelection:
@@ -629,11 +650,28 @@
// The exact change isn't known. Disallow the change to be safe.
if (r.location==NSNotFound) return NO;
+ // Length checking while using the Input Manager (eg for Japanese)
+ if ([textView hasMarkedText] && maxTextLength > 0 && r.location < maxTextLength)
+ // User tries to insert a new char but max text length was already reached - return NO
+ if( !r.length && [[textView textStorage] length] >= maxTextLength ) {
+ NSBeep();
+ [textView unmarkText];
+ return NO;
+ }
+ // otherwise allow it if insertion point is valid for eg
+ // a VARCHAR(3) field filled with two Chinese chars and one inserts the
+ // third char by typing its pronounciation "wo" - 2 Chinese chars plus "wo" would give
+ // 4 which is larger than max length.
+ // TODO this doesn't solve the problem of inserting more than one char. For now
+ // that part which won't be saved will be hilited if user pressed the OK button.
+ else if (r.location < maxTextLength)
+ return YES;
+
// Calculate the length of the text after the change.
newLength=[[textView textStorage] length]+[replacementString length]-r.length;
- // If it's too long, disallow the change.
- // If the user pastes something into insert it partially to maxTextLength.
+ // If it's too long, disallow the change but try
+ // to insert a text chunk partially to maxTextLength.
if (newLength>maxTextLength) {
if(maxTextLength-[[textView textStorage] length] < [replacementString length]) {
@@ -659,7 +697,7 @@
// Do nothing if user really didn't changed text (e.g. for font size changing return)
if(!editTextViewWasChanged && (editSheetWillBeInitialized || ([[[notification object] textStorage] changeInLength]==0)))
return;
-
+
// clear the image and hex (since i doubt someone can "type" a gif)
[editImage setImage:nil];
[hexTextView setString:@""];
@@ -668,7 +706,7 @@
if ( sheetEditData != nil ) {
[sheetEditData release];
}
-
+
// set edit data to text
sheetEditData = [[NSString stringWithString:[editTextView string]] retain];
@@ -685,9 +723,10 @@
if ( [aTextView methodForSelector:aSelector] == [aTextView methodForSelector:@selector(insertNewline:)] &&
[[[NSApp currentEvent] characters] isEqualToString:@"\003"] )
{
- [NSApp stopModalWithCode:1];
- return YES;
- }
+ // [NSApp stopModalWithCode:1];
+ // return YES;
+ [self closeEditSheet:editSheetOkButton];
+ }
else
return NO;
}
1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294