aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPFieldEditorController.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2011-04-22 17:44:57 +0000
committerstuconnolly <stuart02@gmail.com>2011-04-22 17:44:57 +0000
commit4611475c5b255eed9202474dd3bdee147e932946 (patch)
tree39bdc50e046f802265950c6e2607ca9ebda453be /Source/SPFieldEditorController.m
parent3ed8b33deeadcc98185911f41bc6bcb4e53b4719 (diff)
downloadsequelpro-4611475c5b255eed9202474dd3bdee147e932946.tar.gz
sequelpro-4611475c5b255eed9202474dd3bdee147e932946.tar.bz2
sequelpro-4611475c5b255eed9202474dd3bdee147e932946.zip
Bring outline view branch up to date with trunk (r3234:3277).
Diffstat (limited to 'Source/SPFieldEditorController.m')
-rw-r--r--Source/SPFieldEditorController.m36
1 files changed, 32 insertions, 4 deletions
diff --git a/Source/SPFieldEditorController.m b/Source/SPFieldEditorController.m
index 73fafe39..52a90fcd 100644
--- a/Source/SPFieldEditorController.m
+++ b/Source/SPFieldEditorController.m
@@ -4,7 +4,7 @@
// SPFieldEditorController.m
// sequel-pro
//
-// Created by Hans-Jörg Bibiko on July 16, 2009
+// Created by Hans-Jörg Bibiko on July 16, 2009
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -31,6 +31,8 @@
#import "SPGeometryDataView.h"
#import "SPCopyTable.h"
#include <objc/objc-runtime.h>
+#import "SPCustomQuery.h"
+#import "SPTableContent.h"
@interface SPFieldEditorController (SPFieldEditorControllerDelegate)
@@ -110,6 +112,7 @@
[qlTypesItems addObject:type];
}
}
+#ifndef SP_REFACTOR
// Load user-defined QL types
if([prefs objectForKey:SPQuickLookTypes]) {
for(id type in [prefs objectForKey:SPQuickLookTypes]) {
@@ -122,6 +125,7 @@
[qlTypesItems addObject:type];
}
}
+#endif
qlTypes = [[NSDictionary dictionaryWithObject:qlTypesItems forKey:SPQuickLookTypes] retain];
[qlTypesItems release];
@@ -239,14 +243,28 @@
usedSheet = editSheet;
// If required, use monospaced fonts
+#ifndef SP_REFACTOR
if (![prefs objectForKey:SPFieldEditorSheetFont]) {
- [editTextView setFont:([prefs boolForKey:SPUseMonospacedFonts]) ? [NSFont fontWithName:SPDefaultMonospacedFontName size:[NSFont smallSystemFontSize]] : [NSFont systemFontOfSize:[NSFont smallSystemFontSize]]];
+#endif
+ [editTextView setFont:
+#ifndef SP_REFACTOR
+ ([prefs boolForKey:SPUseMonospacedFonts]) ? [NSFont fontWithName:SPDefaultMonospacedFontName size:[NSFont smallSystemFontSize]] :
+#endif
+ [NSFont systemFontOfSize:[NSFont smallSystemFontSize]]];
+#ifndef SP_REFACTOR
}
else {
[editTextView setFont:[NSUnarchiver unarchiveObjectWithData:[prefs dataForKey:@"FieldEditorSheetFont"]]];
}
+#endif
- [editTextView setContinuousSpellCheckingEnabled:[prefs boolForKey:SPBlobTextEditorSpellCheckingEnabled]];
+ [editTextView setContinuousSpellCheckingEnabled:
+#ifndef SP_REFACTOR
+ [prefs boolForKey:SPBlobTextEditorSpellCheckingEnabled]
+#else
+ NO
+#endif
+ ];
[hexTextView setFont:[NSFont fontWithName:SPDefaultMonospacedFontName size:[NSFont smallSystemFontSize]]];
@@ -532,8 +550,10 @@
- (void)sheetDidEnd:(id)sheet returnCode:(NSInteger)returnCode contextInfo:(NSString *)contextInfo
{
+#ifndef SP_REFACTOR
// Remember spell cheecker status
[prefs setBool:[editTextView isContinuousSpellCheckingEnabled] forKey:SPBlobTextEditorSpellCheckingEnabled];
+#endif
}
/**
@@ -551,7 +571,7 @@
// and suppress closing the sheet
if(sender == editSheetOkButton) {
if (maxTextLength > 0 && [[editTextView textStorage] length] > maxTextLength && ![[[editTextView textStorage] string] isEqualToString:[prefs objectForKey:SPNullValue]]) {
- [editTextView setSelectedRange:NSMakeRange((NSUInteger)maxTextLength, [[editTextView textStorage] length] - (NSUInteger)maxTextLength)];
+ [editTextView setSelectedRange:NSMakeRange(maxTextLength, [[editTextView textStorage] length] - maxTextLength)];
[editTextView scrollRangeToVisible:NSMakeRange([editTextView selectedRange].location,0)];
[SPTooltip showWithObject:[NSString stringWithFormat:NSLocalizedString(@"Text is too long. Maximum text length is set to %llu.", @"Text is too long. Maximum text length is set to %llu."), maxTextLength]];
return;
@@ -580,7 +600,15 @@
if(callerInstance) {
id returnData = ( editSheetReturnCode && _isEditable ) ? (_isGeometry) ? [editTextView string] : sheetEditData : nil;
+
+#ifdef SP_REFACTOR /* patch */
+ if ( [callerInstance isKindOfClass:[SPCustomQuery class]] )
+ [(SPCustomQuery*)callerInstance processFieldEditorResult:returnData contextInfo:contextInfo];
+ else if ( [callerInstance isKindOfClass:[SPTableContent class]] )
+ [(SPTableContent*)callerInstance processFieldEditorResult:returnData contextInfo:contextInfo];
+#else
[callerInstance processFieldEditorResult:returnData contextInfo:contextInfo];
+#endif
}
}