From 7e923280a2cc74d4e24d9e5049962ad28d06cbe1 Mon Sep 17 00:00:00 2001 From: avenjamin Date: Fri, 22 May 2009 13:39:18 +0000 Subject: - Few Changes to Query Editor Preference - Cleaned up a few preference keys - Added Caret Color to Query Editor Prefs - disabled for now. --- Interfaces/English.lproj/DBView.xib | 197 +++-- Interfaces/English.lproj/Preferences.xib | 1259 +++++++++++++++++------------- Resources/PreferenceDefaults.plist | 10 +- Source/CMTextView.m | 26 +- Source/CustomQuery.m | 238 +++--- 5 files changed, 973 insertions(+), 757 deletions(-) diff --git a/Interfaces/English.lproj/DBView.xib b/Interfaces/English.lproj/DBView.xib index 18983c6b..50e1bcde 100644 --- a/Interfaces/English.lproj/DBView.xib +++ b/Interfaces/English.lproj/DBView.xib @@ -8,7 +8,7 @@ 353.00 YES - + YES @@ -46,7 +46,7 @@ {3.40282e+38, 3.40282e+38} {780, 480} - + 256 YES @@ -387,7 +387,10 @@ 1048576 2147483647 - + + NSImage + button_action + _popUpItemAction: @@ -2536,7 +2539,7 @@ customQuery - + 256 YES @@ -2563,6 +2566,29 @@ 6418 + + YES + + YES + Apple HTML pasteboard type + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple PNG pasteboard type + Apple URL pasteboard type + CorePasteboardFlavorType 0x6D6F6F76 + CorePasteboardFlavorType 0x75726C20 + NSColor pasteboard type + NSFilenamesPboardType + NSStringPboardType + NeXT Encapsulated PostScript v1.2 pasteboard type + NeXT RTFD pasteboard type + NeXT Rich Text Format v1.0 pasteboard type + NeXT TIFF v4.0 pasteboard type + NeXT font pasteboard type + NeXT ruler pasteboard type + WebURLsWithTitlesPboardType + + {688, 14} @@ -2938,10 +2964,7 @@ -2042609409 35 - - NSImage - button_action - + 400 @@ -2953,7 +2976,7 @@ 1048576 2147483647 - + _popUpItemAction: @@ -3120,7 +3143,7 @@ - Auto-pair Characters + Auto Pair Characters 2147483647 1 @@ -3132,7 +3155,7 @@ - Auto-uppercase Keywords + Auto Uppercase Keywords 2147483647 @@ -3142,7 +3165,7 @@ - Update Help while typing + Update Help while Typing 2147483647 @@ -3153,7 +3176,7 @@ YES - 13 + 14 YES 1 YES @@ -3303,6 +3326,7 @@ {{10, 7}, {700, 544}} + Custom Query @@ -3677,7 +3701,7 @@ relations - + 256 YES @@ -4080,21 +4104,20 @@ {{10, 7}, {700, 544}} - Relations - + 134217731 YES YES YES - + @@ -4110,6 +4133,7 @@ {944, 550} + {{0, 0}, {1440, 878}} {780, 502} @@ -8275,7 +8299,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {600, 142} {269, 142} - + 256 YES @@ -8748,7 +8772,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {269, 142} - {{0, 0}, {1680, 1028}} {269, 164} @@ -11681,6 +11704,10 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 NSView + + YES + CustomQueryAutoPairCharacters + YES @@ -14610,54 +14637,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 5533 - - - value: values.CustomQueryAutoindent - - - - - - value: values.CustomQueryAutoindent - value - values.CustomQueryAutoindent - 2 - - - 5535 - - - - value: values.CustomQueryAutopair - - - - - - value: values.CustomQueryAutopair - value - values.CustomQueryAutopair - 2 - - - 5536 - - - - value: values.CustomQueryAutouppercaseKeywords - - - - - - value: values.CustomQueryAutouppercaseKeywords - value - values.CustomQueryAutouppercaseKeywords - 2 - - - 5537 - autohelpMenuItem @@ -14674,22 +14653,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 5540 - - - value: values.CustomQueryAutohelp - - - - - - value: values.CustomQueryAutohelp - value - values.CustomQueryAutohelp - 2 - - - 5541 - addRow: @@ -15042,6 +15005,70 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 5743 + + + value: values.CustomQueryAutoIndent + + + + + + value: values.CustomQueryAutoIndent + value + values.CustomQueryAutoIndent + 2 + + + 5744 + + + + value: values.CustomQueryAutoUppercaseKeywords + + + + + + value: values.CustomQueryAutoUppercaseKeywords + value + values.CustomQueryAutoUppercaseKeywords + 2 + + + 5746 + + + + value: values.CustomQueryUpdateAutoHelp + + + + + + value: values.CustomQueryUpdateAutoHelp + value + values.CustomQueryUpdateAutoHelp + 2 + + + 5747 + + + + value: values.CustomQueryAutoPairCharacters + + + + + + value: values.CustomQueryAutoPairCharacters + value + values.CustomQueryAutoPairCharacters + 2 + + + 5748 + @@ -24172,7 +24199,7 @@ aGUgYWN0aXZlIHNlbGVjdGlvbiAo4oyl4oyYUik com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{739, 296}, {236, 271}} + {{295, 478}, {236, 271}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -24769,7 +24796,7 @@ Y2hhbmdlIHRoZSBvcmRlcg - 5743 + 5748 diff --git a/Interfaces/English.lproj/Preferences.xib b/Interfaces/English.lproj/Preferences.xib index 4c150993..42278fa3 100644 --- a/Interfaces/English.lproj/Preferences.xib +++ b/Interfaces/English.lproj/Preferences.xib @@ -8,8 +8,7 @@ 353.00 YES - - + YES @@ -54,7 +53,7 @@ {3.40282e+38, 3.40282e+38} - + 268 YES @@ -687,8 +686,8 @@ YES YES - , - . + . + , NO YES NO @@ -722,11 +721,10 @@ {500, 234} - NSView - + 268 YES @@ -923,8 +921,8 @@ YES YES - , - . + . + , NO YES NO @@ -1104,7 +1102,6 @@ {500, 259} - NSView @@ -2084,8 +2081,8 @@ AQAAAAA YES YES - , - . + . + , NO YES YES @@ -2140,7 +2137,7 @@ AQAAAAA NSView - + 268 YES @@ -2154,7 +2151,7 @@ AQAAAAA NSColor pasteboard type - {{154, 269}, {44, 23}} + {{154, 173}, {44, 23}} YES YES @@ -2173,7 +2170,7 @@ AQAAAAA NSColor pasteboard type - {{154, 210}, {44, 23}} + {{154, 202}, {44, 23}} YES YES @@ -2192,7 +2189,7 @@ AQAAAAA NSColor pasteboard type - {{154, 148}, {44, 23}} + {{154, 115}, {44, 23}} YES YES @@ -2211,7 +2208,7 @@ AQAAAAA NSColor pasteboard type - {{154, 119}, {44, 23}} + {{154, 86}, {44, 23}} YES YES @@ -2230,7 +2227,7 @@ AQAAAAA NSColor pasteboard type - {{154, 57}, {44, 23}} + {{154, 260}, {44, 23}} YES YES @@ -2249,7 +2246,7 @@ AQAAAAA NSColor pasteboard type - {{154, 239}, {44, 23}} + {{154, 144}, {44, 23}} YES YES @@ -2268,7 +2265,7 @@ AQAAAAA NSColor pasteboard type - {{154, 179}, {44, 23}} + {{154, 57}, {44, 23}} YES YES @@ -2287,7 +2284,7 @@ AQAAAAA NSColor pasteboard type - {{154, 88}, {44, 23}} + {{154, 289}, {44, 23}} YES YES @@ -2296,146 +2293,164 @@ AQAAAAA MC4wNTgxMzA0OTkgMC4wNTU1NDE4OTkgMQA - + 268 - {{58, 272}, {91, 17}} + + YES + + YES + NSColor pasteboard type + + + {{154, 231}, {44, 23}} + + YES + + 1 + MC4wNTgxMzA0OTkgMC4wNTU1NDE4OTkgMQA + + + + + 268 + {{86, 176}, {63, 17}} YES - + 68288064 71304192 - SQL Keyword: + Keyword: - + - + 268 - {{59, 242}, {90, 17}} + {{88, 147}, {61, 17}} YES - + 68288064 71304192 Numeric: - + - + 268 - {{58, 213}, {90, 17}} + {{79, 205}, {70, 17}} YES - + 68288064 71304192 Comment: - + - + 268 - {{59, 182}, {90, 17}} + {{89, 60}, {60, 17}} YES - + 68288064 71304192 Variable: - + - + 268 - {{59, 151}, {90, 17}} + {{102, 118}, {47, 17}} YES - + 68288064 71304192 Quote: - + - + 268 - {{59, 91}, {90, 17}} + {{112, 292}, {37, 17}} YES - + 68288064 71304192 Text: - + - + 268 - {{40, 122}, {109, 17}} + {{46, 89}, {103, 17}} YES - + 68288064 71304192 Backtick Quote: - + - + 268 - {{40, 60}, {109, 17}} + {{66, 263}, {83, 17}} YES - + 68288064 71304192 Background: - + - + 268 - {{230, 60}, {42, 17}} + {{113, 331}, {36, 17}} YES - + 68288064 71304192 Font: - + @@ -2460,18 +2475,71 @@ AQAAAAA 25 - + + + 268 + {{396, 321}, {90, 32}} + + YES + + 67239424 + 134217728 + U2VsZWN04oCmA + + + -2038284033 + 129 + + + 200 + 25 + + + 268 - {{252, 271}, {130, 18}} + {{154, 329}, {240, 19}} YES - + + -2076049856 + 4327424 + + + + YES + + + + + + + 268 + {{107, 234}, {42, 17}} + + YES + + 605158976 + 71304192 + Caret: + + + + + + + + + 268 + {{257, 291}, {126, 18}} + + YES + -2080244224 0 - Indent New Lines + Indent new lines - + 1211912703 130 @@ -2482,18 +2550,18 @@ AQAAAAA 25 - + 268 - {{252, 241}, {156, 18}} + {{257, 262}, {150, 18}} YES - + -2080244224 0 - Auto-pair Characters + Auto pair characters - + 1211912703 130 @@ -2504,18 +2572,18 @@ AQAAAAA 25 - + 268 - {{252, 181}, {181, 18}} + {{257, 204}, {179, 18}} YES - - -2080244224 + + 67239424 0 - Update Help while typing + Update help while typing - + 1211912703 130 @@ -2526,18 +2594,18 @@ AQAAAAA 25 - + 268 - {{252, 212}, {202, 18}} + {{257, 233}, {185, 18}} YES - + -2080244224 0 - Auto-uppercase Keywords + Auto uppercase keywords - + 1211912703 130 @@ -2548,18 +2616,18 @@ AQAAAAA 25 - + -2147483380 - {{252, 121}, {197, 18}} + {{257, 146}, {197, 18}} YES - + -1543373312 0 Balanced brace highlighting - + 1211912703 130 @@ -2570,43 +2638,49 @@ AQAAAAA 25 - + 268 - {{287, 149}, {27, 19}} + {{357, 179}, {29, 19}} YES - - -2075001280 + + -1538130368 -2076048384 0.1 - - LucidaGrande - 1.100000e+01 - 16 - - + + YES YES allowsFloats + alwaysShowsDecimalSeparator decimalSeparator formatterBehavior groupingSeparator + maximum + maximumIntegerDigits + minimum + minimumFractionDigits positiveFormat YES + . - #.# + + + + + #.0 - #.# - #0.# + #.0 + #.0 @@ -2619,15 +2693,8 @@ AQAAAAA NaN - - 0 - 0 - YES - NO - 1 - AAAAAAAAAAAAAAAAAAAAAA - - + + 3 YES @@ -2640,84 +2707,87 @@ AQAAAAA YES YES - + YES - + 268 - {{340, 152}, {113, 14}} + {{298, 181}, {54, 14}} YES - - 68288064 - 272761856 - Delay (0.1 - 5.0 sec) + + 605158976 + 71435264 + Delay by: - + - + 268 - {{377, 12}, {109, 32}} + {{392, 177}, {15, 22}} YES - - 67239424 - 134217728 - Select Font - - - -2038284033 - 129 - - - 200 - 25 + + 604896800 + 131072 + + + 1.000000e+00 + 1.000000e-01 + 5.000000e+00 + 1.000000e-01 + YES - + 268 - {{277, 59}, {203, 19}} + {{410, 181}, {27, 14}} YES - - -2076049856 - 4327424 - + + 605158976 + 272761856 + secs - - YES - - + + + - + - 268 - {{314, 145}, {19, 27}} + 12 + {{154, 318}, {326, 5}} - YES - - 917024 + {0, 0} + + 67239424 0 - - 1.000000e+00 - 1.000000e-01 - 5.000000e+00 - 1.000000e-01 - YES + Box + + + + 3 + MCAwLjgwMDAwMDAxAA + + 3 + 2 + 0 + NO - {500, 309} + {500, 369} + NSView @@ -3745,7 +3815,7 @@ AQAAAAA YES - + @@ -3939,224 +4009,284 @@ AQAAAAA 848 - - value: values.CustomQueryAutoindent - - - - - - value: values.CustomQueryAutoindent - value - values.CustomQueryAutoindent - 2 - + + editorView + + - 866 + 928 - value: values.CustomQueryAutopair - + value: values.NewFieldsAllowNulls + - + - value: values.CustomQueryAutopair + value: values.NewFieldsAllowNulls value - values.CustomQueryAutopair + values.NewFieldsAllowNulls 2 - 870 + 953 - value: values.CustomQueryAutouppercaseKeywords - - + value: growlEnabled + + - - - value: values.CustomQueryAutouppercaseKeywords + + + value: growlEnabled value - values.CustomQueryAutouppercaseKeywords + growlEnabled + + NSNullPlaceholder + + 2 - 871 + 956 - value: values.CustomQueryAutohelp - + value: values.DisplayTableViewVerticalGridlines + - + - value: values.CustomQueryAutohelp + value: values.DisplayTableViewVerticalGridlines value - values.CustomQueryAutohelp + values.DisplayTableViewVerticalGridlines 2 - 872 + 961 - enabled: values.CustomQueryAutohelp - + value: values.CustomQueryEditorCaretColor + - + - enabled: values.CustomQueryAutohelp - enabled - values.CustomQueryAutohelp + value: values.CustomQueryEditorCaretColor + value + values.CustomQueryEditorCaretColor + + NSValueTransformerName + NSUnarchiveFromData + 2 - 876 + 1007 - showCustomQueryFontPanel: + setDefaultColors: - + - 926 + 1086 - - editorView + + showCustomQueryFontPanel: - + - 928 + 1087 editorFontName - + - 931 + 1088 - - setDefaultColors: - - + + value: values.CustomQueryAutoUppercaseKeywords + + + + + + value: values.CustomQueryAutoUppercaseKeywords + value + values.CustomQueryAutoUppercaseKeywords + 2 + - 932 + 1093 - - takeFloatValueFrom: - - + + value: values.CustomQueryAutoPairCharacters + + + + + + value: values.CustomQueryAutoPairCharacters + value + values.CustomQueryAutoPairCharacters + 2 + - 938 + 1096 - enabled: values.CustomQueryAutohelp - + value: values.CustomQueryAutoIndent + - + - enabled: values.CustomQueryAutohelp - enabled - values.CustomQueryAutohelp + value: values.CustomQueryAutoIndent + value + values.CustomQueryAutoIndent 2 - 942 + 1098 - value: values.CustomQueryAutohelpDelay - + value: values.CustomQueryAutoHelpDelay + - + - value: values.CustomQueryAutohelpDelay + value: values.CustomQueryAutoHelpDelay value - values.CustomQueryAutohelpDelay + values.CustomQueryAutoHelpDelay 2 - 948 + 1100 - value: values.CustomQueryAutohelpDelay - + value: values.CustomQueryAutoHelpDelay + - + - value: values.CustomQueryAutohelpDelay + value: values.CustomQueryAutoHelpDelay value - values.CustomQueryAutohelpDelay + values.CustomQueryAutoHelpDelay 2 - 949 + 1104 - value: values.NewFieldsAllowNulls - + value: values.CustomQueryUpdateAutoHelp + - + - value: values.NewFieldsAllowNulls + value: values.CustomQueryUpdateAutoHelp value - values.NewFieldsAllowNulls + values.CustomQueryUpdateAutoHelp 2 - 953 + 1107 - value: growlEnabled - - + enabled: values.CustomQueryUpdateAutoHelp + + - - - value: growlEnabled - value - growlEnabled - - NSNullPlaceholder - - + + + enabled: values.CustomQueryUpdateAutoHelp + enabled + values.CustomQueryUpdateAutoHelp 2 - 956 + 1108 - value: values.DisplayTableViewVerticalGridlines - + enabled: values.CustomQueryUpdateAutoHelp + - + - value: values.DisplayTableViewVerticalGridlines - value - values.DisplayTableViewVerticalGridlines + enabled: values.CustomQueryUpdateAutoHelp + enabled + values.CustomQueryUpdateAutoHelp 2 - 961 + 1109 + + + + enabled: values.CustomQueryUpdateAutoHelp + + + + + + enabled: values.CustomQueryUpdateAutoHelp + enabled + values.CustomQueryUpdateAutoHelp + 2 + + + 1110 + + + + enabled: values.CustomQueryUpdateAutoHelp + + + + + + enabled: values.CustomQueryUpdateAutoHelp + enabled + values.CustomQueryUpdateAutoHelp + 2 + + + 1112 + + + + takeFloatValueFrom: + + + + 1113 + + + + takeFloatValueFrom: + + + + 1114 @@ -5481,34 +5611,38 @@ AQAAAAA YES + + + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - + Editor @@ -5539,134 +5673,108 @@ AQAAAAA - 808 - + 823 + - 809 - + 950 + YES - + - + - 810 - - + 951 + + - 812 - + 957 + YES - + - + - 813 - - + 958 + + - 814 - - - YES - - + 1000 + - 815 - - - - - 816 - + 1026 + YES - + - 817 - - - - - 818 - + 1027 + YES - + - 819 - - - - - 820 - + 1028 + YES - + - 821 - - - - - 822 - + 1029 + + + YES + + - 823 - + 1030 + + + YES + + - 824 - + 1032 + YES - + - 825 - - - - - 826 - + 1034 + YES - + - 827 - - - - - 849 + 1035 YES @@ -5675,200 +5783,264 @@ AQAAAAA - 850 - - - - - 851 - + 1036 + YES - + - 852 - - - - - 853 - + 1037 + YES - + - 854 - - - - - 855 - + 1038 + YES - + - 856 - - - - - 857 - + 1039 + YES - + - 858 - - - - - 859 - + 1040 + YES - + - 860 - - - - - 861 - + 1041 + YES - + - 862 - + 1042 + YES - + - + - 863 - + 1043 + YES - + - 864 - - + 1051 + + + + + 1052 + + + + + 1053 + + + + + 1054 + + + + + 1055 + + - 882 - + 1056 + + + + + 1057 + + + + + 1058 + + + + + 1059 + + + + + 1060 + + + + + 1062 + + + + + 1064 + + + + + 1065 + + + + + 1066 + + + + + 1067 + + + + + 1068 + + + + + 1046 + YES - + - 883 - - + 1047 + + - 880 - + 1045 + YES - + - 881 - - + 1048 + + - 929 - + 1044 + YES - + - 930 - - + 1049 + + + YES + + + - 933 - + 1050 + + + + + 1033 + YES - + - 934 - - + 1061 + + - 943 - - - - - 950 - + 1031 + YES - + - + - 951 - - + 1063 + + - 957 - + 808 + + + + + 822 + + + + + 1083 + YES - + - + - 958 - - + 1084 + + + + + 1085 + + @@ -5886,10 +6058,57 @@ AQAAAAA 1.editorWindowContentRectSynchronizationRect 100.IBPluginDependency 100.ImportedFromIB2 + 1000.IBPluginDependency 101.IBPluginDependency 102.IBPluginDependency 102.ImportedFromIB2 + 1026.IBPluginDependency + 1027.IBPluginDependency + 1028.IBPluginDependency + 1029.IBPluginDependency 103.IBPluginDependency + 1030.IBPluginDependency + 1031.IBPluginDependency + 1032.IBPluginDependency + 1033.IBPluginDependency + 1034.IBPluginDependency + 1035.IBPluginDependency + 1036.IBPluginDependency + 1037.IBPluginDependency + 1038.IBPluginDependency + 1039.IBPluginDependency + 1040.IBPluginDependency + 1041.IBPluginDependency + 1042.IBPluginDependency + 1043.IBPluginDependency + 1044.IBPluginDependency + 1045.IBPluginDependency + 1046.IBPluginDependency + 1047.IBPluginDependency + 1048.IBPluginDependency + 1049.IBPluginDependency + 1050.IBPluginDependency + 1051.IBPluginDependency + 1052.IBPluginDependency + 1053.IBPluginDependency + 1054.IBPluginDependency + 1055.IBPluginDependency + 1056.IBPluginDependency + 1057.IBPluginDependency + 1058.IBPluginDependency + 1059.IBPluginDependency + 1060.IBPluginDependency + 1061.IBPluginDependency + 1062.IBPluginDependency + 1063.IBPluginDependency + 1064.IBPluginDependency + 1065.IBPluginDependency + 1066.IBPluginDependency + 1067.IBPluginDependency + 1068.IBPluginDependency + 1083.IBPluginDependency + 1084.IBPluginDependency + 1085.IBPluginDependency 110.IBPluginDependency 111.IBPluginDependency 112.IBPluginDependency @@ -6144,51 +6363,10 @@ AQAAAAA 806.IBPluginDependency 807.IBPluginDependency 808.IBPluginDependency - 809.IBPluginDependency - 810.IBPluginDependency - 812.IBPluginDependency - 813.IBPluginDependency - 814.IBPluginDependency - 815.IBPluginDependency - 816.IBPluginDependency - 817.IBPluginDependency - 818.IBPluginDependency - 819.IBPluginDependency - 820.IBPluginDependency - 821.IBPluginDependency 822.IBPluginDependency 823.IBPluginDependency - 824.IBPluginDependency - 825.IBPluginDependency - 826.IBPluginDependency - 827.IBPluginDependency - 849.IBPluginDependency - 850.IBPluginDependency - 851.IBPluginDependency - 852.IBPluginDependency - 853.IBPluginDependency - 854.IBPluginDependency - 855.IBPluginDependency - 856.IBPluginDependency - 857.IBPluginDependency - 858.IBPluginDependency - 859.IBPluginDependency - 860.IBPluginDependency - 861.IBPluginDependency - 862.IBPluginDependency - 863.IBPluginDependency - 864.IBPluginDependency - 880.IBPluginDependency - 881.IBPluginDependency - 882.IBPluginDependency - 883.IBPluginDependency - 929.IBPluginDependency - 930.IBPluginDependency - 933.IBPluginDependency - 934.IBPluginDependency 94.IBPluginDependency 94.ImportedFromIB2 - 943.IBPluginDependency 95.IBPluginDependency 950.IBPluginDependency 951.IBPluginDependency @@ -6216,12 +6394,59 @@ AQAAAAA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin {{408, 292}, {500, 234}} com.apple.InterfaceBuilder.CocoaPlugin @@ -6304,7 +6529,7 @@ AQAAAAA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{499, 188}, {500, 381}} + {{179, 460}, {500, 381}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -6555,7 +6780,7 @@ AQAAAAA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{113, 109}, {500, 309}} + {{428, 626}, {500, 369}} com.apple.InterfaceBuilder.CocoaPlugin YES @@ -6564,6 +6789,11 @@ AQAAAAA 1.450000e+02 0 + + + 2.500000e+02 + 0 + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -6574,51 +6804,10 @@ AQAAAAA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin YES @@ -6658,7 +6847,7 @@ AQAAAAA - 961 + 1114 diff --git a/Resources/PreferenceDefaults.plist b/Resources/PreferenceDefaults.plist index f930f058..0d89a164 100644 --- a/Resources/PreferenceDefaults.plist +++ b/Resources/PreferenceDefaults.plist @@ -56,15 +56,15 @@ BAtzdHJlYW10eXBlZIHoA4QBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWEAWMBhARmZmZmAAAAAYY= CustomQueryEditorVariableColor BAtzdHJlYW10eXBlZIHoA4QBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWEAWMBhARmZmZmg3zv/T6DfO/9PoN87/0+AYY= - CustomQueryAutoindent + CustomQueryAutoIndent - CustomQueryAutopair + CustomQueryAutoPairCharacters - CustomQueryAutouppercaseKeywords + CustomQueryAutoUppercaseKeywords - CustomQueryAutohelp + CustomQueryUpdateAutoHelp - CustomQueryAutohelpDelay + CustomQueryAutoHelpDelay 1 SelectLastFavoriteUsed diff --git a/Source/CMTextView.m b/Source/CMTextView.m index cdd612b8..3b06fcff 100644 --- a/Source/CMTextView.m +++ b/Source/CMTextView.m @@ -277,7 +277,7 @@ YY_BUFFER_STATE yy_scan_string (const char *); { // Cancel autoHelp timer - if([prefs boolForKey:@"CustomQueryAutohelp"]) + if([prefs boolForKey:@"CustomQueryUpdateAutoHelp"]) [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(autoHelp) object:nil]; @@ -285,8 +285,8 @@ YY_BUFFER_STATE yy_scan_string (const char *); [super mouseDown:theEvent]; // Start autoHelp timer - if([prefs boolForKey:@"CustomQueryAutohelp"]) - [self performSelector:@selector(autoHelp) withObject:nil afterDelay:[[[prefs valueForKey:@"CustomQueryAutohelpDelay"] retain] floatValue]]; + if([prefs boolForKey:@"CustomQueryUpdateAutoHelp"]) + [self performSelector:@selector(autoHelp) withObject:nil afterDelay:[[[prefs valueForKey:@"CustomQueryAutoHelpDelay"] retain] floatValue]]; } @@ -296,12 +296,12 @@ YY_BUFFER_STATE yy_scan_string (const char *); - (void) keyDown:(NSEvent *)theEvent { - if([prefs boolForKey:@"CustomQueryAutohelp"]) {// restart autoHelp timer + if([prefs boolForKey:@"CustomQueryUpdateAutoHelp"]) {// restart autoHelp timer [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(autoHelp) object:nil]; [self performSelector:@selector(autoHelp) withObject:nil - afterDelay:[[[prefs valueForKey:@"CustomQueryAutohelpDelay"] retain] floatValue]]; + afterDelay:[[[prefs valueForKey:@"CustomQueryAutoHelpDelay"] retain] floatValue]]; } long allFlags = (NSShiftKeyMask|NSControlKeyMask|NSAlternateKeyMask|NSCommandKeyMask); @@ -356,7 +356,7 @@ YY_BUFFER_STATE yy_scan_string (const char *); } // Only process for character autopairing if autopairing is enabled and a single character is being added. - if ([prefs boolForKey:@"CustomQueryAutopair"] && characters && [characters length] == 1) { + if ([prefs boolForKey:@"CustomQueryAutoPairCharacters"] && characters && [characters length] == 1) { delBackwardsWasPressed = NO; @@ -516,7 +516,7 @@ YY_BUFFER_STATE yy_scan_string (const char *); // Handle newlines, adding any indentation found on the current line to the new line - ignoring the enter key if appropriate if (aSelector == @selector(insertNewline:) - && [prefs boolForKey:@"CustomQueryAutoindent"] + && [prefs boolForKey:@"CustomQueryAutoIndent"] && (!autoindentIgnoresEnter || [[NSApp currentEvent] keyCode] != 0x4C)) { NSString *textViewString = [[self textStorage] string]; @@ -1870,7 +1870,7 @@ YY_BUFFER_STATE yy_scan_string (const char *); - (void)autoHelp { - if(![prefs boolForKey:@"CustomQueryAutohelp"]) return; + if(![prefs boolForKey:@"CustomQueryUpdateAutoHelp"]) return; // If selection show Help for it if([self selectedRange].length) @@ -1897,7 +1897,7 @@ YY_BUFFER_STATE yy_scan_string (const char *); NSTextStorage *textStore = [self textStorage]; NSRange textRange; - + // If text larger than SP_TEXT_SIZE_TRIGGER_FOR_PARTLY_PARSING // do highlighting partly (max SP_SYNTAX_HILITE_BIAS*2). // The approach is to take the middle position of the current view port @@ -1968,8 +1968,8 @@ YY_BUFFER_STATE yy_scan_string (const char *); NSColor *numericColor = [[NSUnarchiver unarchiveObjectWithData:[prefs dataForKey:@"CustomQueryEditorNumericColor"]] retain];//[NSColor colorWithDeviceRed:0.506 green:0.263 blue:0.0 alpha:1.000]; NSColor *variableColor = [[NSUnarchiver unarchiveObjectWithData:[prefs dataForKey:@"CustomQueryEditorVariableColor"]] retain];//[NSColor colorWithDeviceRed:0.5 green:0.5 blue:0.5 alpha:1.000]; NSColor *textColor = [[NSUnarchiver unarchiveObjectWithData:[prefs dataForKey:@"CustomQueryEditorTextColor"]] retain];//[NSColor colorWithDeviceRed:0.5 green:0.5 blue:0.5 alpha:1.000]; - - BOOL autouppercaseKeywords = [prefs boolForKey:@"CustomQueryAutouppercaseKeywords"]; + + BOOL autouppercaseKeywords = [prefs boolForKey:@"CustomQueryAutoUppercaseKeywords"]; unsigned long tokenEnd, token; NSRange tokenRange; @@ -2173,8 +2173,8 @@ YY_BUFFER_STATE yy_scan_string (const char *); //make sure that the notification is from the correct textStorage object if (textStore!=[self textStorage]) return; - if([prefs boolForKey:@"CustomQueryAutohelp"]) - [self performSelector:@selector(autoHelp) withObject:nil afterDelay:[[[prefs valueForKey:@"CustomQueryAutohelpDelay"] retain] floatValue]]; + if([prefs boolForKey:@"CustomQueryUpdateAutoHelp"]) + [self performSelector:@selector(autoHelp) withObject:nil afterDelay:[[[prefs valueForKey:@"CustomQueryAutoHelpDelay"] retain] floatValue]]; if([[self string] length] > SP_TEXT_SIZE_TRIGGER_FOR_PARTLY_PARSING) [NSObject cancelPreviousPerformRequestsWithTarget:self diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m index da538fe2..3b76aba7 100644 --- a/Source/CustomQuery.m +++ b/Source/CustomQuery.m @@ -121,11 +121,10 @@ [self performQueries:queries]; } - -- (IBAction)chooseQueryFavorite:(id)sender /* -insert the choosen favorite query in the query textView or save query to favorites or opens window to edit favorites -*/ + * Insert the choosen favorite query in the query textView or save query to favorites or opens window to edit favorites + */ +- (IBAction)chooseQueryFavorite:(id)sender { if ( [queryFavoritesButton indexOfSelectedItem] == 1) { //save query to favorites @@ -167,10 +166,10 @@ insert the choosen favorite query in the query textView or save query to favorit } } -- (IBAction)chooseQueryHistory:(id)sender /* -insert the choosen history query in the query textView -*/ + * Insert the choosen history query in the query textView + */ +- (IBAction)chooseQueryHistory:(id)sender { // Register the next action for undo [textView shouldChangeTextInRange:NSMakeRange(0,[[textView string] length]) replacementString:[queryHistoryButton titleOfSelectedItem]]; @@ -180,10 +179,10 @@ insert the choosen history query in the query textView [textView selectAll:self]; } -- (IBAction)closeSheet:(id)sender /* -closes the sheet -*/ + * Closes the sheet + */ +- (IBAction)closeSheet:(id)sender { [NSApp stopModal]; } @@ -227,7 +226,7 @@ closes the sheet // "Indent new lines" toggle if (sender == autoindentMenuItem) { BOOL enableAutoindent = !([autoindentMenuItem state] == NSOffState); - [prefs setBool:enableAutoindent forKey:@"CustomQueryAutoindent"]; + [prefs setBool:enableAutoindent forKey:@"CustomQueryAutoIndent"]; [prefs synchronize]; [autoindentMenuItem setState:enableAutoindent?NSOnState:NSOffState]; [textView setAutoindent:enableAutoindent]; @@ -236,7 +235,7 @@ closes the sheet // "Auto-pair characters" toggle if (sender == autopairMenuItem) { BOOL enableAutopair = !([autopairMenuItem state] == NSOffState); - [prefs setBool:enableAutopair forKey:@"CustomQueryAutopair"]; + [prefs setBool:enableAutopair forKey:@"CustomQueryAutoPair"]; [prefs synchronize]; [autopairMenuItem setState:enableAutopair?NSOnState:NSOffState]; [textView setAutopair:enableAutopair]; @@ -245,7 +244,7 @@ closes the sheet // "Auto-help" toggle if (sender == autohelpMenuItem) { BOOL enableAutohelp = !([autohelpMenuItem state] == NSOffState); - [prefs setBool:enableAutohelp forKey:@"CustomQueryAutohelp"]; + [prefs setBool:enableAutohelp forKey:@"CustomQueryUpdateAutoHelp"]; [prefs synchronize]; [autohelpMenuItem setState:enableAutohelp?NSOnState:NSOffState]; [textView setAutohelp:enableAutohelp]; @@ -254,22 +253,29 @@ closes the sheet // "Auto-uppercase keywords" toggle if (sender == autouppercaseKeywordsMenuItem) { BOOL enableAutouppercaseKeywords = !([autouppercaseKeywordsMenuItem state] == NSOffState); - [prefs setBool:enableAutouppercaseKeywords forKey:@"CustomQueryAutouppercaseKeywords"]; + [prefs setBool:enableAutouppercaseKeywords forKey:@"CustomQueryAutoUppercaseKeywords"]; [prefs synchronize]; [autouppercaseKeywordsMenuItem setState:enableAutouppercaseKeywords?NSOnState:NSOffState]; [textView setAutouppercaseKeywords:enableAutouppercaseKeywords]; } } +/* + * Set font panel's valid modes + */ +- (unsigned int)validModesForFontPanel:(NSFontPanel *)fontPanel +{ + return (NSFontPanelAllModesMask ^ NSFontPanelAllEffectsModeMask); +} + #pragma mark - #pragma mark queryFavoritesSheet methods - -- (IBAction)addQueryFavorite:(id)sender /* -adds a query favorite -*/ + * Adds a query favorite + */ +- (IBAction)addQueryFavorite:(id)sender { int row = [queryFavoritesView editedRow]; int column = [queryFavoritesView editedColumn]; @@ -289,10 +295,10 @@ adds a query favorite [queryFavoritesView editColumn:0 row:[queryFavoritesView numberOfRows]-1 withEvent:nil select:YES]; } -- (IBAction)removeQueryFavorite:(id)sender /* -removes a query favorite -*/ + * removes a query favorite + */ +- (IBAction)removeQueryFavorite:(id)sender { int row = [queryFavoritesView editedRow]; int column = [queryFavoritesView editedColumn]; @@ -312,10 +318,10 @@ removes a query favorite } } -- (IBAction)copyQueryFavorite:(id)sender /* -copies a query favorite -*/ + * Copies a query favorite + */ +- (IBAction)copyQueryFavorite:(id)sender { int row = [queryFavoritesView editedRow]; int column = [queryFavoritesView editedColumn]; @@ -339,10 +345,10 @@ copies a query favorite } } -- (IBAction)closeQueryFavoritesSheet:(id)sender /* -closes queryFavoritesSheet and saves favorites to preferences -*/ + * Closes queryFavoritesSheet and saves favorites to preferences + */ +- (IBAction)closeQueryFavoritesSheet:(id)sender { int row = [queryFavoritesView editedRow]; int column = [queryFavoritesView editedColumn]; @@ -365,12 +371,11 @@ closes queryFavoritesSheet and saves favorites to preferences #pragma mark - #pragma mark Query actions - -- (void)performQueries:(NSArray *)queries; /* -performs the mysql-query given by the user -sets the tableView columns corresponding to the mysql-result -*/ + * Performs the mysql-query given by the user + * sets the tableView columns corresponding to the mysql-result + */ +- (void)performQueries:(NSArray *)queries; { NSArray *theColumns; @@ -863,11 +868,12 @@ sets the tableView columns corresponding to the mysql-result #pragma mark - #pragma mark Accessors - -- (NSArray *)currentResult /* -returns the current result (as shown in custom result view) as array, the first object containing the field names as array, the following objects containing the rows as array -*/ + * Returns the current result (as shown in custom result view) as array, + * the first object containing the field names as array, + * the following objects containing the rows as array + */ +- (NSArray *)currentResult { NSArray *tableColumns = [customQueryView tableColumns]; NSEnumerator *enumerator = [tableColumns objectEnumerator]; @@ -898,11 +904,10 @@ returns the current result (as shown in custom result view) as array, the first #pragma mark - #pragma mark Additional methods - -- (void)setConnection:(CMMCPConnection *)theConnection /* -sets the connection (received from TableDocument) and makes things that have to be done only once -*/ + * Sets the connection (received from TableDocument) and makes things that have to be done only once + */ +- (void)setConnection:(CMMCPConnection *)theConnection { NSArray *tableColumns = [queryFavoritesView tableColumns]; NSEnumerator *enumerator = [tableColumns objectEnumerator]; @@ -932,15 +937,15 @@ sets the connection (received from TableDocument) and makes things that have to [customQueryView setVerticalMotionCanBeginDrag:NO]; [textView setContinuousSpellCheckingEnabled:NO]; - [autoindentMenuItem setState:([prefs boolForKey:@"CustomQueryAutoindent"]?NSOnState:NSOffState)]; - [textView setAutoindent:[prefs boolForKey:@"CustomQueryAutoindent"]]; + [autoindentMenuItem setState:([prefs boolForKey:@"CustomQueryAutoIndent"]?NSOnState:NSOffState)]; + [textView setAutoindent:[prefs boolForKey:@"CustomQueryAutoIndent"]]; [textView setAutoindentIgnoresEnter:YES]; - [autopairMenuItem setState:([prefs boolForKey:@"CustomQueryAutopair"]?NSOnState:NSOffState)]; - [textView setAutopair:[prefs boolForKey:@"CustomQueryAutopair"]]; - [autohelpMenuItem setState:([prefs boolForKey:@"CustomQueryAutohelp"]?NSOnState:NSOffState)]; - [textView setAutohelp:[prefs boolForKey:@"CustomQueryAutohelp"]]; - [autouppercaseKeywordsMenuItem setState:([prefs boolForKey:@"CustomQueryAutouppercaseKeywords"]?NSOnState:NSOffState)]; - [textView setAutouppercaseKeywords:[prefs boolForKey:@"CustomQueryAutouppercaseKeywords"]]; + [autopairMenuItem setState:([prefs boolForKey:@"CustomQueryAutoPair"]?NSOnState:NSOffState)]; + [textView setAutopair:[prefs boolForKey:@"CustomQueryAutoPair"]]; + [autohelpMenuItem setState:([prefs boolForKey:@"CustomQueryUpdateAutoHelp"]?NSOnState:NSOffState)]; + [textView setAutohelp:[prefs boolForKey:@"CustomQueryUpdateAutoHelp"]]; + [autouppercaseKeywordsMenuItem setState:([prefs boolForKey:@"CustomQueryAutoUppercaseKeywords"]?NSOnState:NSOffState)]; + [textView setAutouppercaseKeywords:[prefs boolForKey:@"CustomQueryAutoUppercaseKeywords"]]; [queryFavoritesView registerForDraggedTypes:[NSArray arrayWithObjects:@"SequelProPasteboard", nil]]; while ( (column = [enumerator nextObject]) ) { @@ -961,10 +966,10 @@ sets the connection (received from TableDocument) and makes things that have to } -- (void)setFavorites /* -set up the favorites popUpButton -*/ + * Set up the favorites popUpButton + */ +- (void)setFavorites { int i; @@ -975,10 +980,10 @@ set up the favorites popUpButton [queryFavoritesButton addItemsWithTitles:queryFavorites]; } -- (void)doPerformQueryService:(NSString *)query /* -inserts the query in the textView and performs query -*/ + * Inserts the query in the textView and performs query + */ +- (void)doPerformQueryService:(NSString *)query { [textView setString:query]; [self runAllQueries:self]; @@ -989,10 +994,10 @@ inserts the query in the textView and performs query return usedQuery; } + #pragma mark - #pragma mark TableView datasource methods - - (int)numberOfRowsInTableView:(NSTableView *)aTableView { if ( aTableView == customQueryView ) { @@ -1074,7 +1079,9 @@ inserts the query in the textView and performs query } -//tableView drag&drop datasource methods +#pragma mark - +#pragma mark TableView Drag & Drop datasource methods + - (BOOL)tableView:(NSTableView *)aTableView writeRows:(NSArray*)rows toPasteboard:(NSPasteboard*)pboard { int originalRow; @@ -1165,11 +1172,13 @@ inserts the query in the textView and performs query } -//tableView delegate methods -- (BOOL)tableView:(NSTableView *)aTableView shouldEditTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex +#pragma mark - +#pragma mark TableView delegate methods + /* -opens sheet with value when double clicking on a field -*/ + * Opens sheet with value when double clicking on a field + */ +- (BOOL)tableView:(NSTableView *)aTableView shouldEditTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex { if ( aTableView == customQueryView ) { NSArray *theRow; @@ -1209,54 +1218,30 @@ opens sheet with value when double clicking on a field } } - #pragma mark - -#pragma mark SplitView delegate methods - - -- (BOOL)splitView:(NSSplitView *)sender canCollapseSubview:(NSView *)subview -/* -tells the splitView that it can collapse views -*/ -{ - return YES; -} - -- (float)splitView:(NSSplitView *)sender constrainMaxCoordinate:(float)proposedMax ofSubviewAt:(int)offset -/* -defines max position of splitView -*/ -{ - if ( offset == 0 ) { - return proposedMax - 100; - } else { - return proposedMax - 73; - } -} +#pragma mark TableView notifications -- (float)splitView:(NSSplitView *)sender constrainMinCoordinate:(float)proposedMin ofSubviewAt:(int)offset /* -defines min position of splitView -*/ -{ - if ( offset == 0 ) { - return proposedMin + 100; - } else { - return proposedMin + 100; + * Updates various interface elements based on the current table view selection. + */ +- (void)tableViewSelectionDidChange:(NSNotification *)notification +{ + if ([notification object] == queryFavoritesView) { + + // Enable/disable buttons + [removeQueryFavoriteButton setEnabled:([queryFavoritesView numberOfSelectedRows] == 1)]; + [copyQueryFavoriteButton setEnabled:([queryFavoritesView numberOfSelectedRows] == 1)]; } } - #pragma mark - #pragma mark TextView delegate methods - -- (BOOL)textView:(NSTextView *)aTextView doCommandBySelector:(SEL)aSelector /* -traps enter key and - performs query instead of inserting a line break if aTextView == textView - closes valueSheet if aTextView == valueTextField -*/ + * Traps enter key and performs query instead of inserting a line break if aTextView == textView + * closes valueSheet if aTextView == valueTextField + */ +- (BOOL)textView:(NSTextView *)aTextView doCommandBySelector:(SEL)aSelector { if ( aTextView == textView ) { if ( [aTextView methodForSelector:aSelector] == [aTextView methodForSelector:@selector(insertNewline:)] && @@ -1280,6 +1265,9 @@ traps enter key and return NO; } +#pragma mark - +#pragma mark TextView notifications + /* * A notification posted when the selection changes within the text view; * used to control the run-currentrun-selection button state and action. @@ -1366,38 +1354,50 @@ traps enter key and } -#pragma mark - -#pragma mark TableView notifications +/* + * Save the custom query editor font if it is changed. + */ +- (void)textViewDidChangeTypingAttributes:(NSNotification *)aNotification +{ + // Only save the font if prefs have been loaded, ensuring the saved font has been applied once. + if (prefs) + [prefs setObject:[NSArchiver archivedDataWithRootObject:[textView font]] forKey:@"CustomQueryEditorFont"]; +} + +#pragma mark - +#pragma mark SplitView delegate methods /* - * Updates various interface elements based on the current table view selection. + * Tells the splitView that it can collapse views */ -- (void)tableViewSelectionDidChange:(NSNotification *)notification -{ - if ([notification object] == queryFavoritesView) { - - // Enable/disable buttons - [removeQueryFavoriteButton setEnabled:([queryFavoritesView numberOfSelectedRows] == 1)]; - [copyQueryFavoriteButton setEnabled:([queryFavoritesView numberOfSelectedRows] == 1)]; - } +- (BOOL)splitView:(NSSplitView *)sender canCollapseSubview:(NSView *)subview +{ + return YES; } /* - * Save the custom query editor font if it is changed. + * Defines max position of splitView */ -- (void)textViewDidChangeTypingAttributes:(NSNotification *)aNotification +- (float)splitView:(NSSplitView *)sender constrainMaxCoordinate:(float)proposedMax ofSubviewAt:(int)offset { - - // Only save the font if prefs have been loaded, ensuring the saved font has been applied once. - if (prefs) - [prefs setObject:[NSArchiver archivedDataWithRootObject:[textView font]] forKey:@"CustomQueryEditorFont"]; + if ( offset == 0 ) { + return proposedMax - 100; + } else { + return proposedMax - 73; + } } -// set font panel's valid modes -- (unsigned int)validModesForFontPanel:(NSFontPanel *)fontPanel +/* + * Defines min position of splitView + */ +- (float)splitView:(NSSplitView *)sender constrainMinCoordinate:(float)proposedMin ofSubviewAt:(int)offset { - return (NSFontPanelAllModesMask ^ NSFontPanelAllEffectsModeMask); + if ( offset == 0 ) { + return proposedMin + 100; + } else { + return proposedMin + 100; + } } @@ -1879,7 +1879,7 @@ traps enter key and #pragma mark - #pragma mark Other -/** +/* * This method is called as part of Key Value Observing which is used to watch for prefernce changes which effect the interface. */ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context -- cgit v1.2.3