aboutsummaryrefslogtreecommitdiffstats
path: root/Source/CustomQuery.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2009-04-03 00:08:28 +0000
committerrowanbeentje <rowan@beent.je>2009-04-03 00:08:28 +0000
commitb7a565dd0196dcd77143874b27162d4300182019 (patch)
tree732ef42200affccae1a92d86aeadb49d63f52e7f /Source/CustomQuery.m
parent6e4d0662303ecd6b3f953ff3313965835a9b8074 (diff)
downloadsequelpro-b7a565dd0196dcd77143874b27162d4300182019.tar.gz
sequelpro-b7a565dd0196dcd77143874b27162d4300182019.tar.bz2
sequelpro-b7a565dd0196dcd77143874b27162d4300182019.zip
- Add the ability for CMTextView to automatically capitalise SQL keywords in the text view, currently off by default but saved from preferences. Thanks again to Hans-Jörg Bibiko for this patch; see Issue #218.
Diffstat (limited to 'Source/CustomQuery.m')
-rw-r--r--Source/CustomQuery.m11
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m
index 3d6c18d0..6b89f6a4 100644
--- a/Source/CustomQuery.m
+++ b/Source/CustomQuery.m
@@ -201,6 +201,15 @@ closes the sheet
[autopairMenuItem setState:enableAutopair?NSOnState:NSOffState];
[textView setAutopair:enableAutopair];
}
+
+ // "Auto-uppercase keywords" toggle
+ if (sender == autouppercaseKeywordsMenuItem) {
+ BOOL enableAutouppercaseKeywords = ([autouppercaseKeywordsMenuItem state] == NSOffState);
+ [prefs setBool:enableAutouppercaseKeywords forKey:@"CustomQueryAutouppercaseKeywords"];
+ [prefs synchronize];
+ [autouppercaseKeywordsMenuItem setState:enableAutouppercaseKeywords?NSOnState:NSOffState];
+ [textView setAutouppercaseKeywords:enableAutouppercaseKeywords];
+ }
}
@@ -603,6 +612,8 @@ sets the connection (received from TableDocument) and makes things that have to
[textView setAutoindentIgnoresEnter:YES];
[autopairMenuItem setState:([prefs boolForKey:@"CustomQueryAutopair"]?NSOnState:NSOffState)];
[textView setAutopair:[prefs boolForKey:@"CustomQueryAutopair"]];
+ [autouppercaseKeywordsMenuItem setState:([prefs boolForKey:@"CustomQueryAutouppercaseKeywords"]?NSOnState:NSOffState)];
+ [textView setAutouppercaseKeywords:[prefs boolForKey:@"CustomQueryAutouppercaseKeywords"]];
[queryFavoritesView registerForDraggedTypes:[NSArray arrayWithObjects:@"SequelProPasteboard", nil]];
while ( (column = [enumerator nextObject]) )
{