aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/SPCustomQuery.m17
-rw-r--r--Source/SPEditSheetTextView.m17
-rw-r--r--Source/SPFieldEditorController.m9
-rw-r--r--Source/SPUserManager.m2
4 files changed, 32 insertions, 13 deletions
diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m
index 41a6b62f..1a7eeffe 100644
--- a/Source/SPCustomQuery.m
+++ b/Source/SPCustomQuery.m
@@ -2319,11 +2319,6 @@
[NSNumber numberWithBool:isFieldEditable], @"isFieldEditable",
nil]];
- // Preserve focus and restore selection indexes if appropriate
- [[tableDocumentInstance parentWindow] makeFirstResponder:customQueryView];
- if (selectionIndexToRestore)
- [customQueryView selectRowIndexes:selectionIndexToRestore byExtendingSelection:NO];
-
return NO;
}
@@ -3418,12 +3413,6 @@
NSUInteger column = [[contextInfo objectForKey:@"column"] integerValue];
BOOL isFieldEditable = ([contextInfo objectForKey:@"isFieldEditable"]) ? YES : NO;
- // if ([data isKindOfClass:[NSString class]]
- // && [data isEqualToString:[prefs objectForKey:SPNullValue]]
- // && [[NSArrayObjectAtIndex(dataColumns, column) objectForKey:@"null"] boolValue])
- // {
- // data = [[NSNull null] retain];
- // }
if(isFieldEditable) {
[self tableView:customQueryView setObjectValue:[[data copy] autorelease] forTableColumn:[customQueryView tableColumnWithIdentifier:[contextInfo objectForKey:@"column"]] row:row];
}
@@ -3434,7 +3423,11 @@
fieldEditor = nil;
}
- // [[tableDocumentInstance parentWindow] makeFirstResponder:tableContentView];
+ // Preserve focus and restore selection indexes if appropriate
+ [[tableDocumentInstance parentWindow] makeFirstResponder:customQueryView];
+ if (selectionIndexToRestore)
+ [customQueryView selectRowIndexes:selectionIndexToRestore byExtendingSelection:NO];
+
}
#pragma mark -
diff --git a/Source/SPEditSheetTextView.m b/Source/SPEditSheetTextView.m
index e46868b7..ab6530e9 100644
--- a/Source/SPEditSheetTextView.m
+++ b/Source/SPEditSheetTextView.m
@@ -327,4 +327,21 @@
[self saveChangedFontInUserDefaults];
}
+/**
+ * Needed to allow Find Panel inside the textView if it runs in a sheet
+ */
+- (BOOL)becomeFirstResponder
+{
+ return YES;
+}
+
+/**
+ * Needed to allow Find Panel inside the textView if it runs in a sheet
+ */
+- (BOOL)resignFirstResponder
+{
+ return YES;
+}
+
+
@end
diff --git a/Source/SPFieldEditorController.m b/Source/SPFieldEditorController.m
index b8b250ce..05266381 100644
--- a/Source/SPFieldEditorController.m
+++ b/Source/SPFieldEditorController.m
@@ -423,6 +423,14 @@
[editSheetProgressBar stopAnimation:self];
+ // The field editor sheet runs as sheet thus a NSTextView won't respond to the Find Panel
+ // since the Find Panel validate its buttons against [[NSApp mainWindow] firstResponder] == NSTextView.
+ // After ordering out this sheet SPCopyTable remains the first responder thus set it hard.
+ // This only works in conjunction with [NSTextView becomeFirstResponder] and [NSTextView resignFirstResponder]
+ // which has to return YES.
+ if([[self window] firstResponder] == editTextView)
+ [[NSApp mainWindow] makeFirstResponder:[[self window] firstResponder]];
+
}
}
@@ -507,6 +515,7 @@
[hexTextView setHidden:YES];
[hexTextScrollView setHidden:YES];
[usedSheet makeFirstResponder:editTextView];
+ [[NSApp mainWindow] makeFirstResponder:editTextView];
break;
case 1: // image
[editTextView setHidden:YES];
diff --git a/Source/SPUserManager.m b/Source/SPUserManager.m
index f947568e..d8851c3c 100644
--- a/Source/SPUserManager.m
+++ b/Source/SPUserManager.m
@@ -739,7 +739,7 @@ static const NSString *SPTableViewNameColumnID = @"NameColumn";
{
SPBeginAlertSheet(NSLocalizedString(@"Unable to remove host", @"error removing host message"),
NSLocalizedString(@"OK", @"OK button"), nil, nil, [self window], self, nil, nil,
- NSLocalizedString(@"This user doesn't seem have any hosts associated with it. The user will be removed unless one is added", @"error removing host informative message"));
+ NSLocalizedString(@"This user doesn't seem to have any associated hosts and will be removed unless a host is added.", @"error removing host informative message"));
}
}