aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2011-04-14 00:23:22 +0000
committerrowanbeentje <rowan@beent.je>2011-04-14 00:23:22 +0000
commitad7328e56541556d23f527303deddaefd4253ef2 (patch)
tree344dbe7ac1780cfa81952be0cdb34ef20ca7f7bd /Source
parent0ce916eb0583ec6b062786f91bee0133906671ce (diff)
downloadsequelpro-ad7328e56541556d23f527303deddaefd4253ef2.tar.gz
sequelpro-ad7328e56541556d23f527303deddaefd4253ef2.tar.bz2
sequelpro-ad7328e56541556d23f527303deddaefd4253ef2.zip
Make some minor changes after reviewing r3271:
- Fix a few encoding issues - Recode a few [NSApp keyWindow] uses back to [SPDatabaseDocument parentWindow] following discussion; possibly for later refactoring into use of an error method
Diffstat (limited to 'Source')
-rw-r--r--Source/SPConnectionController.m6
-rw-r--r--Source/SPCustomQuery.m32
-rw-r--r--Source/SPDatabaseDocument.m6
-rw-r--r--Source/SPFieldMapperController.m12
-rw-r--r--Source/SPIndexesController.m6
-rw-r--r--Source/SPTableContent.m80
-rw-r--r--Source/SPTableStructure.m28
-rw-r--r--Source/SPTableStructureDelegate.m6
-rw-r--r--Source/SPTextView.m8
9 files changed, 92 insertions, 92 deletions
diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m
index 239681d0..728c621e 100644
--- a/Source/SPConnectionController.m
+++ b/Source/SPConnectionController.m
@@ -507,8 +507,8 @@
// Only display the connection error message if there is a window visible and the connection attempt
// wasn't cancelled even though it failed.
- if ([[NSApp keyWindow] isVisible] && (!mySQLConnectionCancelled)) {
- SPBeginAlertSheet(theTitle, NSLocalizedString(@"OK", @"OK button"), (errorDetail) ? NSLocalizedString(@"Show Detail", @"Show detail button") : nil, (isSSHTunnelBindError) ? NSLocalizedString(@"Use Standard Connection", @"use standard connection button") : nil, [NSApp keyWindow], self, @selector(connectionFailureSheetDidEnd:returnCode:contextInfo:), @"connect", theErrorMessage);
+ if ([[tableDocument parentWindow] isVisible] && (!mySQLConnectionCancelled)) {
+ SPBeginAlertSheet(theTitle, NSLocalizedString(@"OK", @"OK button"), (errorDetail) ? NSLocalizedString(@"Show Detail", @"Show detail button") : nil, (isSSHTunnelBindError) ? NSLocalizedString(@"Use Standard Connection", @"use standard connection button") : nil, [tableDocument parentWindow], self, @selector(connectionFailureSheetDidEnd:returnCode:contextInfo:), @"connect", theErrorMessage);
}
}
@@ -1329,7 +1329,7 @@
// If SSL was enabled, check it was established correctly
if (useSSL && ([self type] == SPTCPIPConnection || [self type] == SPSocketConnection)) {
if (![mySQLConnection isConnectedViaSSL]) {
- SPBeginAlertSheet(NSLocalizedString(@"SSL connection not established", @"SSL requested but not used title"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [NSApp keyWindow], nil, nil, nil, NSLocalizedString(@"You requested that the connection should be established using SSL, but MySQL made the connection without SSL.\n\nThis may be because the server does not support SSL connections, or has SSL disabled; or insufficient details were supplied to establish an SSL connection.\n\nThis connection is not encrypted.", @"SSL connection requested but not established error detail"));
+ SPBeginAlertSheet(NSLocalizedString(@"SSL connection not established", @"SSL requested but not used title"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [tableDocument parentWindow], nil, nil, nil, NSLocalizedString(@"You requested that the connection should be established using SSL, but MySQL made the connection without SSL.\n\nThis may be because the server does not support SSL connections, or has SSL disabled; or insufficient details were supplied to establish an SSL connection.\n\nThis connection is not encrypted.", @"SSL connection requested but not established error detail"));
} else {
#ifndef SP_REFACTOR /* [tableDocument setStatusIconToImageWithName:@"titlebarlock"] */
[tableDocument setStatusIconToImageWithName:@"titlebarlock"];
diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m
index 732ed5db..91570d14 100644
--- a/Source/SPCustomQuery.m
+++ b/Source/SPCustomQuery.m
@@ -1156,7 +1156,7 @@
}
/*
- * Add or remove "‚ÅÑ* *‚ÅÑ" for each line in the current query
+ * Add or remove "⁄* *⁄" for each line in the current query
* a given selection
*/
- (void)commentOutCurrentQueryTakingSelection:(BOOL)takeSelection
@@ -1209,8 +1209,8 @@
/*
* Add or remove "-- " for each line in the current query or selection,
- * if the selection is in-line wrap selection into ‚ÅÑ* block comments and
- * place the caret after ‚ÅÑ* to allow to enter !xxxxxx e.g.
+ * if the selection is in-line wrap selection into ⁄* block comments and
+ * place the caret after ⁄* to allow to enter !xxxxxx e.g.
*/
- (void)commentOut
{
@@ -1582,7 +1582,7 @@
[[dataCell formatter] setFieldType:[columnDefinition objectForKey:@"type"]];
[theCol setDataCell:dataCell];
[[theCol headerCell] setStringValue:[columnDefinition objectForKey:@"name"]];
- [theCol setHeaderToolTip:[NSString stringWithFormat:@"%@ – %@%@", [columnDefinition objectForKey:@"name"], [columnDefinition objectForKey:@"type"], ([columnDefinition objectForKey:@"char_length"]) ? [NSString stringWithFormat:@"(%@)", [columnDefinition objectForKey:@"char_length"]] : @""]];
+ [theCol setHeaderToolTip:[NSString stringWithFormat:@"%@ – %@%@", [columnDefinition objectForKey:@"name"], [columnDefinition objectForKey:@"type"], ([columnDefinition objectForKey:@"char_length"]) ? [NSString stringWithFormat:@"(%@)", [columnDefinition objectForKey:@"char_length"]] : @""]];
#ifndef SP_REFACTOR
// Set the width of this column to saved value if exists and maps to a real column
@@ -2043,7 +2043,7 @@
return;
}
- // This shouldn't happen – for safety reasons
+ // This shouldn't happen – for safety reasons
if ( ![mySQLConnection affectedRows] ) {
#ifndef SP_REFACTOR
if ( [prefs boolForKey:SPShowNoAffectedRowsError] ) {
@@ -3147,7 +3147,7 @@
aRange = [desc rangeOfRegex:@"\\[HELP ([^ ]*?)\\]" options:RKLNoOptions inRange:NSMakeRange(aRange.location+aRange.length+53, [desc length]-53-aRange.location-aRange.length) capture:1 error:&err1];
if(aRange.location != NSNotFound) {
aUrl = [[desc substringWithRange:aRange] stringByReplacingOccurrencesOfString:@"\n" withString:@" "];
- [desc replaceCharactersInRange:aRange withString:[NSString stringWithFormat:@"<a title='%@ “%@”' href='%@' class='internallink'>%@</a>", NSLocalizedString(@"Show MySQL help for", @"show mysql help for"), aUrl, aUrl, aUrl]];
+ [desc replaceCharactersInRange:aRange withString:[NSString stringWithFormat:@"<a title='%@ “%@”' href='%@' class='internallink'>%@</a>", NSLocalizedString(@"Show MySQL help for", @"show mysql help for"), aUrl, aUrl, aUrl]];
}
else
break;
@@ -3162,7 +3162,7 @@
// aRange = [desc rangeOfRegex:@"(?<!\\w)([A-Z_]{2,}( [A-Z_]{2,})?)" options:RKLNoOptions inRange:NSMakeRange(aRange.location+aRange.length, [desc length]-aRange.location-aRange.length) capture:1 error:&err1];
// if(aRange.location != NSNotFound) {
// aUrl = [desc substringWithRange:aRange];
- // [desc replaceCharactersInRange:aRange withString:[NSString stringWithFormat:@"<a title='%@ “%@”' href='%@' class='internallink'>%@</a>", NSLocalizedString(@"Show MySQL help for", @"show mysql help for"), aUrl, aUrl, aUrl]];
+ // [desc replaceCharactersInRange:aRange withString:[NSString stringWithFormat:@"<a title='%@ “%@”' href='%@' class='internallink'>%@</a>", NSLocalizedString(@"Show MySQL help for", @"show mysql help for"), aUrl, aUrl, aUrl]];
// }
// else
// break;
@@ -3186,16 +3186,16 @@
if (r) [theResult dataSeek:0];
// check if HELP 'contents' is called
if(![searchString isEqualToString:SP_HELP_TOC_SEARCH_STRING])
- [theHelp appendFormat:@"<br><i>%@ “%@”</i><br>", NSLocalizedString(@"Help topics for", @"help topics for"), searchString];
+ [theHelp appendFormat:@"<br><i>%@ “%@”</i><br>", NSLocalizedString(@"Help topics for", @"help topics for"), searchString];
else
- [theHelp appendFormat:@"<br><b>%@:</b><br>", NSLocalizedString(@"MySQL Help – Categories", @"mysql help categories"), searchString];
+ [theHelp appendFormat:@"<br><b>%@:</b><br>", NSLocalizedString(@"MySQL Help – Categories", @"mysql help categories"), searchString];
// iterate through all found rows and print them as HTML ul/li list
[theHelp appendString:@"<ul>"];
for ( i = 0 ; i < r ; i++ ) {
NSArray *anArray = [theResult fetchRowAsArray];
NSString *topic = [anArray objectAtIndex:[anArray count]-2];
- [theHelp appendFormat:@"<li><a title='%@ “%@”' href='%@' class='internallink'>%@</a></li>",
+ [theHelp appendFormat:@"<li><a title='%@ “%@”' href='%@' class='internallink'>%@</a></li>",
NSLocalizedString(@"Show MySQL help for", @"show mysql help for"), topic, topic, topic];
}
[theHelp appendString:@"</ul>"];
@@ -3377,7 +3377,7 @@
[[[[tableDocumentInstance fileURL] absoluteString] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding] lastPathComponent]
action:NULL keyEquivalent:@""];
[headerMenuItem setTag:SP_FAVORITE_HEADER_MENUITEM_TAG];
- [headerMenuItem setToolTip:[NSString stringWithFormat:@"‘%@’ based favorites",
+ [headerMenuItem setToolTip:[NSString stringWithFormat:@"‘%@’ based favorites",
[[[[tableDocumentInstance fileURL] absoluteString] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding] lastPathComponent]]];
[headerMenuItem setIndentationLevel:0];
[menu addItem:headerMenuItem];
@@ -3389,7 +3389,7 @@
[paraStyle addTabStop:[[[NSTextTab alloc] initWithType:NSRightTabStopType location:190.0f] autorelease]];
NSDictionary *attributes = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:paraStyle, [NSFont systemFontOfSize:11], nil] forKeys:[NSArray arrayWithObjects:NSParagraphStyleAttributeName, NSFontAttributeName, nil]];
NSAttributedString *titleString = [[[NSAttributedString alloc]
- initWithString:([favorite objectForKey:@"tabtrigger"] && [(NSString*)[favorite objectForKey:@"tabtrigger"] length]) ? [NSString stringWithFormat:@"%@\t%@‚á•", [favorite objectForKey:@"name"], [favorite objectForKey:@"tabtrigger"]] : [favorite objectForKey:@"name"]
+ initWithString:([favorite objectForKey:@"tabtrigger"] && [(NSString*)[favorite objectForKey:@"tabtrigger"] length]) ? [NSString stringWithFormat:@"%@\t%@⇥", [favorite objectForKey:@"name"], [favorite objectForKey:@"tabtrigger"]] : [favorite objectForKey:@"name"]
attributes:attributes] autorelease];
NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:@"" action:NULL keyEquivalent:@""];
[item setToolTip:[NSString stringWithString:[favorite objectForKey:@"query"]]];
@@ -3414,7 +3414,7 @@
[paraStyle addTabStop:[[[NSTextTab alloc] initWithType:NSRightTabStopType location:190.0f] autorelease]];
NSDictionary *attributes = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:paraStyle, [NSFont systemFontOfSize:11], nil] forKeys:[NSArray arrayWithObjects:NSParagraphStyleAttributeName, NSFontAttributeName, nil]];
NSAttributedString *titleString = [[[NSAttributedString alloc]
- initWithString:([favorite objectForKey:@"tabtrigger"] && [(NSString*)[favorite objectForKey:@"tabtrigger"] length]) ? [NSString stringWithFormat:@"%@\t%@‚á•", [favorite objectForKey:@"name"], [favorite objectForKey:@"tabtrigger"]] : [favorite objectForKey:@"name"]
+ initWithString:([favorite objectForKey:@"tabtrigger"] && [(NSString*)[favorite objectForKey:@"tabtrigger"] length]) ? [NSString stringWithFormat:@"%@\t%@⇥", [favorite objectForKey:@"name"], [favorite objectForKey:@"tabtrigger"]] : [favorite objectForKey:@"name"]
attributes:attributes] autorelease];
NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:@"" action:NULL keyEquivalent:@""];
[item setToolTip:[NSString stringWithString:[favorite objectForKey:@"query"]]];
@@ -3516,7 +3516,7 @@
// Result Table Font preference changed
else if ([keyPath isEqualToString:SPGlobalResultTableFont]) {
NSFont *tableFont = [NSUnarchiver unarchiveObjectWithData:[change objectForKey:NSKeyValueChangeNewKey]];
- [customQueryView setRowHeight:2.0f+NSSizeToCGSize([[NSString stringWithString:@"{«û·π∂·∏π√ú‚àëzgyf"] sizeWithAttributes:[NSDictionary dictionaryWithObject:tableFont forKey:NSFontAttributeName]]).height];
+ [customQueryView setRowHeight:2.0f+NSSizeToCGSize([[NSString stringWithString:@"{ǞṶḹÜ∑zgyf"] sizeWithAttributes:[NSDictionary dictionaryWithObject:tableFont forKey:NSFontAttributeName]]).height];
[customQueryView setFont:tableFont];
[customQueryView reloadData];
}
@@ -3643,7 +3643,7 @@
[menuItem setToolTip:NSLocalizedString(@"Clear the global history list", @"clear the global history list tooltip message")];
#ifndef SP_REFACTOR /* if ( [tableDocumentInstance isUntitled] ) */
} else {
- [menuItem setTitle:[NSString stringWithFormat:NSLocalizedString(@"Clear History for “%@”", @"clear history for “%@” menu title"), [tableDocumentInstance displayName]]];
+ [menuItem setTitle:[NSString stringWithFormat:NSLocalizedString(@"Clear History for “%@”", @"clear history for “%@” menu title"), [tableDocumentInstance displayName]]];
[menuItem setToolTip:NSLocalizedString(@"Clear the document-based history list", @"clear the document-based history list tooltip message")];
}
#endif
@@ -3728,7 +3728,7 @@
// an error occurred while reading
if (helpHTMLTemplate == nil) {
- NSLog(@"%@", [NSString stringWithFormat:@"Error reading “%@.html”!<br>%@", SPHTMLHelpTemplate, [error localizedFailureReason]]);
+ NSLog(@"%@", [NSString stringWithFormat:@"Error reading “%@.html”!<br>%@", SPHTMLHelpTemplate, [error localizedFailureReason]]);
NSBeep();
}
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m
index c19e4e0d..e81a7c05 100644
--- a/Source/SPDatabaseDocument.m
+++ b/Source/SPDatabaseDocument.m
@@ -1338,7 +1338,7 @@
- (void) centerTaskWindow
{
NSPoint newBottomLeftPoint;
- NSRect mainWindowRect = [[NSApp keyWindow] frame];
+ NSRect mainWindowRect = [parentWindow frame];
NSRect taskWindowRect = [taskProgressWindow frame];
newBottomLeftPoint.x = roundf(mainWindowRect.origin.x + mainWindowRect.size.width/2 - taskWindowRect.size.width/2);
@@ -2353,7 +2353,7 @@
*/
- (BOOL)couldCommitCurrentViewActions
{
- [[NSApp keyWindow] endEditingFor:nil];
+ [parentWindow endEditingFor:nil];
switch ([tableTabView indexOfTabViewItem:[tableTabView selectedTabViewItem]]) {
// Table structure view
@@ -5777,7 +5777,7 @@
// Update the database list
[[self onMainThread] setDatabases:self];
- SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [NSApp keyWindow], self, nil, nil, [NSString stringWithFormat:NSLocalizedString(@"Unable to select database %@.\nPlease check you have the necessary privileges to view the database, and that the database still exists.", @"message of panel when connection to db failed after selecting from popupbutton"), targetDatabaseName]);
+ SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, parentWindow, self, nil, nil, [NSString stringWithFormat:NSLocalizedString(@"Unable to select database %@.\nPlease check you have the necessary privileges to view the database, and that the database still exists.", @"message of panel when connection to db failed after selecting from popupbutton"), targetDatabaseName]);
}
[taskPool drain];
diff --git a/Source/SPFieldMapperController.m b/Source/SPFieldMapperController.m
index d42916a1..6ff712b3 100644
--- a/Source/SPFieldMapperController.m
+++ b/Source/SPFieldMapperController.m
@@ -4,7 +4,7 @@
// SPFieldMapperController.m
// sequel-pro
//
-// Created by Hans-Jörg Bibiko on February 01, 2010
+// Created by Hans-Jörg Bibiko on February 01, 2010
//
// 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
@@ -82,7 +82,7 @@ static NSString *SPTableViewSqlColumnID = @"sql";
doImport = [NSNumber numberWithInteger:0];
doNotImport = [NSNumber numberWithInteger:1];
isEqual = [NSNumber numberWithInteger:2];
- doImportString = @"―";
+ doImportString = @"―";
doNotImportString = @" ";
isEqualString = @"=";
newTableMode = NO;
@@ -256,8 +256,8 @@ static NSString *SPTableViewSqlColumnID = @"sql";
NSInteger i;
for(i=0; i<numberOfImportColumns; i++) {
- [fieldMappingGlobalValues addObject:@"…"];
- [fieldMappingGlobalValuesSQLMarked addObject:@"…"];
+ [fieldMappingGlobalValues addObject:@"…"];
+ [fieldMappingGlobalValuesSQLMarked addObject:@"…"];
}
}
@@ -558,7 +558,7 @@ static NSString *SPTableViewSqlColumnID = @"sql";
if([column objectForKey:@"length"])
[type appendFormat:@"(%@)", [column objectForKey:@"length"]];
if([column objectForKey:@"values"])
- [type appendFormat:@"(%@)", [[column objectForKey:@"values"] componentsJoinedByString:@"¦"]];
+ [type appendFormat:@"(%@)", [[column objectForKey:@"values"] componentsJoinedByString:@"¦"]];
if([column objectForKey:@"isprimarykey"]) {
[type appendFormat:@",%@",@"PRIMARY"];
@@ -1823,7 +1823,7 @@ static NSString *SPTableViewSqlColumnID = @"sql";
if([[self selectedImportMethod] isEqualToString:@"UPDATE"])
[c addItemWithTitle:NSLocalizedString(@"Match Field", @"match field menu item")];
[m addItem:[NSMenuItem separatorItem]];
- NSMenuItem *menuItem = [m addItemWithTitle:NSLocalizedString(@"Add Value or Expression…", @"add global value or expression menu item") action:@selector(addGlobalSourceVariable:) keyEquivalent:@"g"];
+ NSMenuItem *menuItem = [m addItemWithTitle:NSLocalizedString(@"Add Value or Expression…", @"add global value or expression menu item") action:@selector(addGlobalSourceVariable:) keyEquivalent:@"g"];
[menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)];
[c addItemWithTitle:[NSString stringWithFormat:@"DEFAULT: %@", [fieldMappingTableDefaultValues objectAtIndex:rowIndex]]];
[[m itemAtIndex:[c numberOfItems]-1] setEnabled:NO];
diff --git a/Source/SPIndexesController.m b/Source/SPIndexesController.m
index 21320897..9c0c03a6 100644
--- a/Source/SPIndexesController.m
+++ b/Source/SPIndexesController.m
@@ -235,7 +235,7 @@ static const NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize";
// Begin the sheet
[NSApp beginSheet:[self window]
- modalForWindow:[NSApp keyWindow]
+ modalForWindow:[dbDocument parentWindow]
modalDelegate:self
didEndSelector:@selector(addIndexSheetDidEnd:returnCode:contextInfo:)
contextInfo:nil];
@@ -293,7 +293,7 @@ static const NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize";
[[buttons objectAtIndex:0] setKeyEquivalentModifierMask:NSCommandKeyMask];
[[buttons objectAtIndex:1] setKeyEquivalent:@"\r"];
- [alert beginSheetModalForWindow:[NSApp keyWindow] modalDelegate:self didEndSelector:@selector(removeIndexSheetDidEnd:returnCode:contextInfo:) contextInfo:(hasForeignKey) ? @"removeIndexAndForeignKey" : @"removeIndex"];
+ [alert beginSheetModalForWindow:[dbDocument parentWindow] modalDelegate:self didEndSelector:@selector(removeIndexSheetDidEnd:returnCode:contextInfo:) contextInfo:(hasForeignKey) ? @"removeIndexAndForeignKey" : @"removeIndex"];
}
/**
@@ -795,7 +795,7 @@ static const NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize";
// Check for errors, but only if the query wasn't cancelled
if ([connection queryErrored] && ![connection queryCancelled]) {
- SPBeginAlertSheet(NSLocalizedString(@"Unable to add index", @"add index error message"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [NSApp keyWindow], self, nil, nil,
+ SPBeginAlertSheet(NSLocalizedString(@"Unable to add index", @"add index error message"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [dbDocument parentWindow], self, nil, nil,
[NSString stringWithFormat:NSLocalizedString(@"An error occured while trying to add the index.\n\nMySQL said: %@", @"add index error informative message"), [connection getLastErrorMessage]]);
}
else {
diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m
index a5f7d373..821321cb 100644
--- a/Source/SPTableContent.m
+++ b/Source/SPTableContent.m
@@ -478,7 +478,7 @@
// Set up the column
theCol = [[NSTableColumn alloc] initWithIdentifier:[columnDefinition objectForKey:@"datacolumnindex"]];
[[theCol headerCell] setStringValue:[columnDefinition objectForKey:@"name"]];
- [theCol setHeaderToolTip:[NSString stringWithFormat:@"%@ – %@%@%@%@",
+ [theCol setHeaderToolTip:[NSString stringWithFormat:@"%@ – %@%@%@%@",
[columnDefinition objectForKey:@"name"],
[columnDefinition objectForKey:@"type"],
([columnDefinition objectForKey:@"length"]) ? [NSString stringWithFormat:@"(%@)", [columnDefinition objectForKey:@"length"]] : @"",
@@ -599,7 +599,7 @@
}
// Store the current first responder so filter field doesn't steal focus
- id currentFirstResponder = [[NSApp keyWindow] firstResponder];
+ id currentFirstResponder = [[tableDocumentInstance parentWindow] firstResponder];
// Enable and initialize filter fields (with tags for position of menu item and field position)
[fieldField setEnabled:YES];
@@ -643,7 +643,7 @@
contentPage = pageToRestore;
// Restore first responder
- [[NSApp keyWindow] makeFirstResponder:currentFirstResponder];
+ [[tableDocumentInstance parentWindow] makeFirstResponder:currentFirstResponder];
// Set the state of the table buttons
[addButton setEnabled:(enableInteraction && [tablesListInstance tableType] == SPTableTypeTable)];
@@ -859,15 +859,15 @@
if ([mySQLConnection queryErrored] && ![mySQLConnection queryCancelled]) {
if(activeFilter == 0) {
if(filterString)
- SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [NSApp keyWindow], self, nil, nil,
+ SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [tableDocumentInstance parentWindow], self, nil, nil,
[NSString stringWithFormat:NSLocalizedString(@"The table data couldn't be loaded presumably due to used filter clause. \n\nMySQL said: %@", @"message of panel when loading of table failed and presumably due to used filter argument"), [mySQLConnection getLastErrorMessage]]);
else
- SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [NSApp keyWindow], self, nil, nil,
+ SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [tableDocumentInstance parentWindow], self, nil, nil,
[NSString stringWithFormat:NSLocalizedString(@"The table data couldn't be loaded.\n\nMySQL said: %@", @"message of panel when loading of table failed"), [mySQLConnection getLastErrorMessage]]);
}
// Filter task came from filter table
else if(activeFilter == 1){
- [filterTableWindow setTitle:[NSString stringWithFormat:@"%@ – %@", NSLocalizedString(@"Filter", @"filter label"), NSLocalizedString(@"WHERE clause not valid", @"WHERE clause not valid")]];
+ [filterTableWindow setTitle:[NSString stringWithFormat:@"%@ – %@", NSLocalizedString(@"Filter", @"filter label"), NSLocalizedString(@"WHERE clause not valid", @"WHERE clause not valid")]];
}
} else {
// Trigger a full reload if required
@@ -998,7 +998,7 @@
}
// If the clause has the placeholder $BINARY that placeholder will be replaced
- // by BINARY if the user pressed ‚áß while invoking 'Filter' otherwise it will
+ // by BINARY if the user pressed ⇧ while invoking 'Filter' otherwise it will
// replaced by @"".
BOOL caseSensitive = (([[[NSApp onMainThread] currentEvent] modifierFlags]
& (NSShiftKeyMask|NSControlKeyMask|NSAlternateKeyMask|NSCommandKeyMask)) > 0);
@@ -1013,21 +1013,21 @@
// Current selected filter type
if(![contentFilters objectForKey:compareType]) {
- NSLog(@"Error while retrieving filters. Filter type “%@” unknown.", compareType);
+ NSLog(@"Error while retrieving filters. Filter type “%@” unknown.", compareType);
NSBeep();
return nil;
}
NSDictionary *filter = [[contentFilters objectForKey:compareType] objectAtIndex:[[compareField selectedItem] tag]];
if(![filter objectForKey:@"NumberOfArguments"]) {
- NSLog(@"Error while retrieving filter clause. No “Clause” or/and “NumberOfArguments” key found.");
+ NSLog(@"Error while retrieving filter clause. No “Clause” or/and “NumberOfArguments” key found.");
NSBeep();
return nil;
}
if(![filter objectForKey:@"Clause"] || ![(NSString *)[filter objectForKey:@"Clause"] length]) {
- SPBeginAlertSheet(NSLocalizedString(@"Warning", @"warning"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [NSApp keyWindow], self, nil, nil,
+ SPBeginAlertSheet(NSLocalizedString(@"Warning", @"warning"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [tableDocumentInstance parentWindow], self, nil, nil,
NSLocalizedString(@"Content Filter clause is empty.", @"content filter clause is empty tooltip."));
return nil;
@@ -1091,7 +1091,7 @@
// Check number of placeholders and given 'NumberOfArguments'
if([clause replaceOccurrencesOfString:@"%@" withString:@"%@" options:NSLiteralSearch range:NSMakeRange(0, [clause length])] != numberOfArguments) {
- NSLog(@"Error while setting filter string. “NumberOfArguments” differs from the number of arguments specified in “Clause”.");
+ NSLog(@"Error while setting filter string. “NumberOfArguments” differs from the number of arguments specified in “Clause”.");
NSBeep();
[argument release];
[firstBetweenArgument release];
@@ -1465,7 +1465,7 @@
- (IBAction)toggleFilterField:(id)sender
{
- // Check if user called "Edit Filter…"
+ // Check if user called "Edit Filter…"
if([[compareField selectedItem] tag] == (NSInteger)[[contentFilters objectForKey:compareType] count]) {
[self openContentFilterManager];
return;
@@ -1788,7 +1788,7 @@
if ( [tableContentView numberOfSelectedRows] < 1 )
return;
if ( [tableContentView numberOfSelectedRows] > 1 ) {
- SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [NSApp keyWindow], self, nil, nil, NSLocalizedString(@"You can only copy single rows.", @"message of panel when trying to copy multiple rows"));
+ SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [tableDocumentInstance parentWindow], self, nil, nil, NSLocalizedString(@"You can only copy single rows.", @"message of panel when trying to copy multiple rows"));
return;
}
@@ -1851,7 +1851,7 @@
// return;
// cancel editing (maybe this is not the ideal method -- see xcode docs for that method)
- [[NSApp keyWindow] endEditingFor:nil];
+ [[tableDocumentInstance parentWindow] endEditingFor:nil];
if (![tableContentView numberOfSelectedRows])
@@ -1904,7 +1904,7 @@
[alert setInformativeText:[NSString stringWithFormat:NSLocalizedString(@"Are you sure you want to delete the selected %ld rows from this table? This action cannot be undone.", @"delete rows informative message"), (long)[tableContentView numberOfSelectedRows]]];
}
- [alert beginSheetModalForWindow:[NSApp keyWindow] modalDelegate:self didEndSelector:@selector(removeRowSheetDidEnd:returnCode:contextInfo:) contextInfo:contextInfo];
+ [alert beginSheetModalForWindow:[tableDocumentInstance parentWindow] modalDelegate:self didEndSelector:@selector(removeRowSheetDidEnd:returnCode:contextInfo:) contextInfo:contextInfo];
}
/**
@@ -2521,7 +2521,7 @@
[tip setString:[[filter objectForKey:@"Clause"] stringByReplacingOccurrencesOfRegex:@"(?<!\\\\)(\\$\\{.*?\\})" withString:@"[arg]"]];
if([tip isMatchedByRegex:@"(?<!\\\\)\\$BINARY"]) {
[tip replaceOccurrencesOfRegex:@"(?<!\\\\)\\$BINARY" withString:@""];
- [tip appendString:NSLocalizedString(@"\n\nPress ‚áß for binary search (case-sensitive).", @"\n\npress shift for binary search tooltip message")];
+ [tip appendString:NSLocalizedString(@"\n\nPress ⇧ for binary search (case-sensitive).", @"\n\npress shift for binary search tooltip message")];
}
[tip flushCachedRegexData];
[tip replaceOccurrencesOfRegex:@"(?<!\\\\)\\$CURRENT_FIELD" withString:[[fieldField titleOfSelectedItem] backtickQuotedString]];
@@ -2539,8 +2539,8 @@
}
[menu addItem:[NSMenuItem separatorItem]];
- NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Edit Filters…", @"edit filter") action:NULL keyEquivalent:@""];
- [item setToolTip:NSLocalizedString(@"Edit user-defined Filters…", @"edit user-defined filter")];
+ NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Edit Filters…", @"edit filter") action:NULL keyEquivalent:@""];
+ [item setToolTip:NSLocalizedString(@"Edit user-defined Filters…", @"edit user-defined filter")];
[item setTag:i];
[menu addItem:item];
[item release];
@@ -2573,7 +2573,7 @@
// Open query favorite manager
[NSApp beginSheet:[contentFilterManager window]
- modalForWindow:[NSApp keyWindow]
+ modalForWindow:[tableDocumentInstance parentWindow]
modalDelegate:contentFilterManager
didEndSelector:nil
contextInfo:nil];
@@ -2698,7 +2698,7 @@
if ( ![mySQLConnection affectedRows] && ![mySQLConnection queryErrored] ) {
#ifndef SP_REFACTOR
if ( [prefs boolForKey:SPShowNoAffectedRowsError] ) {
- SPBeginAlertSheet(NSLocalizedString(@"Warning", @"warning"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [NSApp keyWindow], self, nil, nil,
+ SPBeginAlertSheet(NSLocalizedString(@"Warning", @"warning"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [tableDocumentInstance parentWindow], self, nil, nil,
NSLocalizedString(@"The row was not written to the MySQL database. You probably haven't changed anything.\nReload the table to be sure that the row exists and use a primary key for your table.\n(This error can be turned off in the preferences.)", @"message of panel when no rows have been affected after writing to the db"));
} else {
NSBeep();
@@ -2728,7 +2728,7 @@
if ( isEditingNewRow ) {
#ifndef SP_REFACTOR
if ( [prefs boolForKey:SPReloadAfterAddingRow] ) {
- [[NSApp keyWindow] endEditingFor:nil];
+ [[tableDocumentInstance parentWindow] endEditingFor:nil];
previousTableRowsCount = tableRowsCount;
[self loadTableValues];
} else {
@@ -2750,7 +2750,7 @@
// Reload table if set to - otherwise no action required.
#ifndef SP_REFACTOR
if ( [prefs boolForKey:SPReloadAfterEditingRow] ) {
- [[NSApp keyWindow] endEditingFor:nil];
+ [[tableDocumentInstance parentWindow] endEditingFor:nil];
previousTableRowsCount = tableRowsCount;
[self loadTableValues];
}
@@ -2762,7 +2762,7 @@
// Report errors which have occurred
} else {
- SPBeginAlertSheet(NSLocalizedString(@"Couldn't write row", @"Couldn't write row error"), NSLocalizedString(@"Edit row", @"Edit row button"), NSLocalizedString(@"Discard changes", @"discard changes button"), nil, [NSApp keyWindow], self, @selector(addRowErrorSheetDidEnd:returnCode:contextInfo:), nil,
+ SPBeginAlertSheet(NSLocalizedString(@"Couldn't write row", @"Couldn't write row error"), NSLocalizedString(@"Edit row", @"Edit row button"), NSLocalizedString(@"Discard changes", @"discard changes button"), nil, [tableDocumentInstance parentWindow], self, @selector(addRowErrorSheetDidEnd:returnCode:contextInfo:), nil,
[NSString stringWithFormat:NSLocalizedString(@"MySQL said:\n\n%@", @"message of panel when error while adding row to db"), [mySQLConnection getLastErrorMessage]]);
return NO;
}
@@ -2906,7 +2906,7 @@
// the right values to use in the WHERE statement. Throw an error if this is the case.
#ifndef SP_REFACTOR
if ( [prefs boolForKey:SPLoadBlobsAsNeeded] && [self tableContainsBlobOrTextColumns] ) {
- SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [NSApp keyWindow], self, nil, nil,
+ SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [tableDocumentInstance parentWindow], self, nil, nil,
NSLocalizedString(@"You can't hide blob and text fields when working with tables without index.", @"message of panel when trying to edit tables without index and with hidden blob/text fields"));
[keys removeAllObjects];
[tableContentView deselectAll:self];
@@ -2934,7 +2934,7 @@
[argument appendFormat:@"%@ IS NULL", [NSArrayObjectAtIndex(keys, i) backtickQuotedString]];
}
else if ([tempValue isSPNotLoaded]) {
- NSLog(@"Exceptional case: SPNotLoaded object found for method “argumentForRow:”!");
+ NSLog(@"Exceptional case: SPNotLoaded object found for method “argumentForRow:”!");
return @"";
}
else {
@@ -3150,7 +3150,7 @@
{
// error := first object is the title , second the message, only one button OK
SPBeginAlertSheet([error objectAtIndex:0], NSLocalizedString(@"OK", @"OK button"),
- nil, nil, [NSApp keyWindow], self, nil, nil,
+ nil, nil, [tableDocumentInstance parentWindow], self, nil, nil,
[error objectAtIndex:1]);
}
@@ -4004,7 +4004,7 @@
// Check for errors while UPDATE
if ([mySQLConnection queryErrored]) {
- SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), NSLocalizedString(@"Cancel", @"cancel button"), nil, [NSApp keyWindow], self, nil, nil,
+ SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), NSLocalizedString(@"Cancel", @"cancel button"), nil, [tableDocumentInstance parentWindow], self, nil, nil,
[NSString stringWithFormat:NSLocalizedString(@"Couldn't write field.\nMySQL said: %@", @"message of panel when error while updating field to db"), [mySQLConnection getLastErrorMessage]]);
[tableDocumentInstance endTask];
@@ -4013,11 +4013,11 @@
}
- // This shouldn't happen – for safety reasons
+ // This shouldn't happen – for safety reasons
if ( ![mySQLConnection affectedRows] ) {
#ifndef SP_REFACTOR
if ( [prefs boolForKey:SPShowNoAffectedRowsError] ) {
- SPBeginAlertSheet(NSLocalizedString(@"Warning", @"warning"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [NSApp keyWindow], self, nil, nil,
+ SPBeginAlertSheet(NSLocalizedString(@"Warning", @"warning"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [tableDocumentInstance parentWindow], self, nil, nil,
NSLocalizedString(@"The row was not written to the MySQL database. You probably haven't changed anything.\nReload the table to be sure that the row exists and use a primary key for your table.\n(This error can be turned off in the preferences.)", @"message of panel when no rows have been affected after writing to the db"));
} else {
NSBeep();
@@ -4029,7 +4029,7 @@
}
} else {
- SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [NSApp keyWindow], self, nil, nil,
+ SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [tableDocumentInstance parentWindow], self, nil, nil,
[NSString stringWithFormat:NSLocalizedString(@"Updating field content failed. Couldn't identify field origin unambiguously (%ld match%@). It's very likely that while editing this field the table `%@` was changed by an other user.", @"message of panel when error while updating field to db after enabling it"),
(long)numberOfPossibleUpdateRows, (numberOfPossibleUpdateRows>1)?@"es":@"", tableForColumn]);
@@ -4166,7 +4166,7 @@
[self loadTableValues];
if ([mySQLConnection queryErrored]) {
- SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [NSApp keyWindow], self, nil, nil,
+ SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [tableDocumentInstance parentWindow], self, nil, nil,
[NSString stringWithFormat:NSLocalizedString(@"Couldn't sort table. MySQL said: %@", @"message of panel when sorting of table failed"), [mySQLConnection getLastErrorMessage]]);
[tableDocumentInstance endTask];
[sortPool drain];
@@ -4328,7 +4328,7 @@
MCPResult *tempResult = [mySQLConnection queryString:query];
if (![tempResult numOfRows]) {
- SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [NSApp keyWindow], self, nil, nil,
+ SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [tableDocumentInstance parentWindow], self, nil, nil,
NSLocalizedString(@"Couldn't load the row. Reload the table to be sure that the row exists and use a primary key for your table.", @"message of panel when loading of row failed"));
return NO;
}
@@ -4405,7 +4405,7 @@
usingEncoding:[mySQLConnection stringEncoding]
isObjectBlob:isBlob
isEditable:isFieldEditable
- withWindow:[NSApp keyWindow]
+ withWindow:[tableDocumentInstance parentWindow]
sender:self
contextInfo:[NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInteger:rowIndex], @"row",
@@ -4431,7 +4431,7 @@
if (aTableView == tableContentView) {
NSString *tmp;
- // By holding ‚åò, ‚áß, or/and ‚å• copies selected rows as SQL INSERTS
+ // By holding ⌘, ⇧, or/and ⌥ copies selected rows as SQL INSERTS
// otherwise \t delimited lines
if([[NSApp currentEvent] modifierFlags] & (NSCommandKeyMask|NSShiftKeyMask|NSAlternateKeyMask))
tmp = [tableContentView rowsAsSqlInsertsOnlySelectedRows:YES];
@@ -4651,7 +4651,7 @@
if([tableContentView isCellEditingMode]) {
NSArray *editStatus = [self fieldEditStatusForRow:row andColumn:[NSArrayObjectAtIndex([tableContentView tableColumns], column) identifier]];
NSInteger numberOfPossibleUpdateRows = [[editStatus objectAtIndex:0] integerValue];
- NSPoint pos = [[NSApp keyWindow] convertBaseToScreen:[tableContentView convertPoint:[tableContentView frameOfCellAtColumn:column row:row].origin toView:nil]];
+ NSPoint pos = [[tableDocumentInstance parentWindow] convertBaseToScreen:[tableContentView convertPoint:[tableContentView frameOfCellAtColumn:column row:row].origin toView:nil]];
pos.y -= 20;
switch(numberOfPossibleUpdateRows) {
case -1:
@@ -4744,7 +4744,7 @@
// Table font preference changed
else if ([keyPath isEqualToString:SPGlobalResultTableFont]) {
NSFont *tableFont = [NSUnarchiver unarchiveObjectWithData:[change objectForKey:NSKeyValueChangeNewKey]];
- [tableContentView setRowHeight:2.0f+NSSizeToCGSize([[NSString stringWithString:@"{«û·π∂·∏π√ú‚àëzgyf"] sizeWithAttributes:[NSDictionary dictionaryWithObject:tableFont forKey:NSFontAttributeName]]).height];
+ [tableContentView setRowHeight:2.0f+NSSizeToCGSize([[NSString stringWithString:@"{ǞṶḹÜ∑zgyf"] sizeWithAttributes:[NSDictionary dictionaryWithObject:tableFont forKey:NSFontAttributeName]]).height];
[tableContentView setFont:tableFont];
[tableContentView reloadData];
}
@@ -4803,7 +4803,7 @@
BOOL lookInAllFields = NO;
- NSString *re1 = @"^\\s*(<[=>]?|>=?|!?=|≠|≤|≥)\\s*(.*?)\\s*$";
+ NSString *re1 = @"^\\s*(<[=>]?|>=?|!?=|≠|≤|≥)\\s*(.*?)\\s*$";
NSString *re2 = @"^\\s*(.*)\\s+(.*?)\\s*$";
NSInteger editedRow = [filterTableView editedRow];
@@ -4849,9 +4849,9 @@
if([filterCell length]) {
// Recode special operators
- filterCell = [filterCell stringByReplacingOccurrencesOfRegex:@"^\\s*≠" withString:@"!="];
- filterCell = [filterCell stringByReplacingOccurrencesOfRegex:@"^\\s*≤" withString:@"<="];
- filterCell = [filterCell stringByReplacingOccurrencesOfRegex:@"^\\s*‚â•" withString:@">="];
+ filterCell = [filterCell stringByReplacingOccurrencesOfRegex:@"^\\s*≠" withString:@"!="];
+ filterCell = [filterCell stringByReplacingOccurrencesOfRegex:@"^\\s*≤" withString:@"<="];
+ filterCell = [filterCell stringByReplacingOccurrencesOfRegex:@"^\\s*≥" withString:@">="];
if(numberOfValues)
[clause appendString:(lookInAllFields) ? @" OR " : @" AND "];
diff --git a/Source/SPTableStructure.m b/Source/SPTableStructure.m
index a616951c..31ba47f3 100644
--- a/Source/SPTableStructure.m
+++ b/Source/SPTableStructure.m
@@ -516,7 +516,7 @@
alternateButton:nil
otherButton:nil
informativeTextWithFormat:[NSString stringWithFormat:NSLocalizedString(@"An error occurred while fetching the optimized field type.\n\nMySQL said:%@",@"an error occurred while fetching the optimized field type.\n\nMySQL said:%@"), [mySQLConnection getLastErrorMessage]]]
- beginSheetModalForWindow:[NSApp keyWindow]
+ beginSheetModalForWindow:[tableDocumentInstance parentWindow]
modalDelegate:self
didEndSelector:NULL
contextInfo:NULL];
@@ -539,7 +539,7 @@
alternateButton:nil
otherButton:nil
informativeTextWithFormat:type]
- beginSheetModalForWindow:[NSApp keyWindow]
+ beginSheetModalForWindow:[tableDocumentInstance parentWindow]
modalDelegate:self
didEndSelector:NULL
contextInfo:NULL];
@@ -642,7 +642,7 @@
[alert setAlertStyle:NSCriticalAlertStyle];
- [alert beginSheetModalForWindow:[NSApp keyWindow] modalDelegate:self didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:) contextInfo:@"cannotremovefield"];
+ [alert beginSheetModalForWindow:[tableDocumentInstance parentWindow] modalDelegate:self didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:) contextInfo:@"cannotremovefield"];
}
@@ -680,7 +680,7 @@
[[buttons objectAtIndex:0] setKeyEquivalentModifierMask:NSCommandKeyMask];
[[buttons objectAtIndex:1] setKeyEquivalent:@"\r"];
- [alert beginSheetModalForWindow:[NSApp keyWindow] modalDelegate:self didEndSelector:@selector(removeFieldSheetDidEnd:returnCode:contextInfo:) contextInfo:(hasForeignKey) ? @"removeFieldAndForeignKey" : @"removeField"];
+ [alert beginSheetModalForWindow:[tableDocumentInstance parentWindow] modalDelegate:self didEndSelector:@selector(removeFieldSheetDidEnd:returnCode:contextInfo:) contextInfo:(hasForeignKey) ? @"removeFieldAndForeignKey" : @"removeField"];
}
/**
@@ -697,7 +697,7 @@
// Begin the sheet
[NSApp beginSheet:resetAutoIncrementSheet
- modalForWindow:[NSApp keyWindow]
+ modalForWindow:[tableDocumentInstance parentWindow]
modalDelegate:self
didEndSelector:@selector(resetAutoincrementSheetDidEnd:returnCode:contextInfo:)
contextInfo:nil];
@@ -766,7 +766,7 @@
autoIncrementIndex = nil;
[tableSourceView reloadData];
currentlyEditingRow = -1;
- [[NSApp keyWindow] makeFirstResponder:tableSourceView];
+ [[tableDocumentInstance parentWindow] makeFirstResponder:tableSourceView];
return YES;
}
@@ -901,9 +901,9 @@
// Save any edits which have been made but not saved to the table yet;
// but not for any NSSearchFields which could cause a crash for undo, redo.
- id currentFirstResponder = [[NSApp keyWindow] firstResponder];
+ id currentFirstResponder = [[tableDocumentInstance parentWindow] firstResponder];
if (currentFirstResponder && [currentFirstResponder isKindOfClass:[NSView class]] && [(NSView *)currentFirstResponder isDescendantOf:tableSourceView]) {
- [[NSApp keyWindow] endEditingFor:nil];
+ [[tableDocumentInstance parentWindow] endEditingFor:nil];
}
// If no rows are currently being edited, or a save is already in progress, return success at once.
@@ -1185,7 +1185,7 @@
if([mySQLConnection getLastErrorID] == 1146) { // If the current table doesn't exist anymore
SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"),
NSLocalizedString(@"OK", @"OK button"),
- nil, nil, [NSApp keyWindow], self, nil, nil,
+ nil, nil, [tableDocumentInstance parentWindow], self, nil, nil,
[NSString stringWithFormat:NSLocalizedString(@"An error occurred while trying to alter table '%@'.\n\nMySQL said: %@", @"error while trying to alter table message"),
selectedTable, [mySQLConnection getLastErrorMessage]]);
@@ -1208,14 +1208,14 @@
if (isEditingNewRow) {
SPBeginAlertSheet(NSLocalizedString(@"Error adding field", @"error adding field message"),
NSLocalizedString(@"Edit row", @"Edit row button"),
- NSLocalizedString(@"Discard changes", @"discard changes button"), nil, [NSApp keyWindow], self, @selector(addRowErrorSheetDidEnd:returnCode:contextInfo:), nil,
+ NSLocalizedString(@"Discard changes", @"discard changes button"), nil, [tableDocumentInstance parentWindow], self, @selector(addRowErrorSheetDidEnd:returnCode:contextInfo:), nil,
[NSString stringWithFormat:NSLocalizedString(@"An error occurred when trying to add the field '%@' via\n\n%@\n\nMySQL said: %@", @"error adding field informative message"),
[theRow objectForKey:@"name"], queryString, [mySQLConnection getLastErrorMessage]]);
}
else {
SPBeginAlertSheet(NSLocalizedString(@"Error changing field", @"error changing field message"),
NSLocalizedString(@"Edit row", @"Edit row button"),
- NSLocalizedString(@"Discard changes", @"discard changes button"), nil, [NSApp keyWindow], self, @selector(addRowErrorSheetDidEnd:returnCode:contextInfo:), nil,
+ NSLocalizedString(@"Discard changes", @"discard changes button"), nil, [tableDocumentInstance parentWindow], self, @selector(addRowErrorSheetDidEnd:returnCode:contextInfo:), nil,
[NSString stringWithFormat:NSLocalizedString(@"An error occurred when trying to change the field '%@' via\n\n%@\n\nMySQL said: %@", @"error changing field informative message"),
[theRow objectForKey:@"name"], queryString, [mySQLConnection getLastErrorMessage]]);
}
@@ -1260,7 +1260,7 @@
// Display the error sheet
SPBeginAlertSheet([errorDictionary objectForKey:@"title"], NSLocalizedString(@"OK", @"OK button"),
- nil, nil, [NSApp keyWindow], self, nil, nil,
+ nil, nil, [tableDocumentInstance parentWindow], self, nil, nil,
[errorDictionary objectForKey:@"message"]);
}
@@ -1342,7 +1342,7 @@
// Problem: reentering edit mode for first cell doesn't function
[tableSourceView selectRowIndexes:[NSIndexSet indexSetWithIndex:currentlyEditingRow] byExtendingSelection:NO];
- [tableSourceView performSelector:@selector(keyDown:) withObject:[NSEvent keyEventWithType:NSKeyDown location:NSMakePoint(0,0) modifierFlags:0 timestamp:0 windowNumber:[[NSApp keyWindow] windowNumber] context:[NSGraphicsContext currentContext] characters:nil charactersIgnoringModifiers:nil isARepeat:NO keyCode:0x24] afterDelay:0.0];
+ [tableSourceView performSelector:@selector(keyDown:) withObject:[NSEvent keyEventWithType:NSKeyDown location:NSMakePoint(0,0) modifierFlags:0 timestamp:0 windowNumber:[[tableDocumentInstance parentWindow] windowNumber] context:[NSGraphicsContext currentContext] characters:nil charactersIgnoringModifiers:nil isARepeat:NO keyCode:0x24] afterDelay:0.0];
}
// Discard changes and cancel editing
@@ -1650,7 +1650,7 @@
[tableDocumentInstance endTask];
// Preserve focus on table for keyboard navigation
- [[NSApp keyWindow] makeFirstResponder:tableSourceView];
+ [[tableDocumentInstance parentWindow] makeFirstResponder:tableSourceView];
[pool drain];
}
diff --git a/Source/SPTableStructureDelegate.m b/Source/SPTableStructureDelegate.m
index 9c8f341c..73496e94 100644
--- a/Source/SPTableStructureDelegate.m
+++ b/Source/SPTableStructureDelegate.m
@@ -129,7 +129,7 @@
[chooseKeyButton selectItemWithTag:SPPrimaryKeyMenuTag];
[NSApp beginSheet:keySheet
- modalForWindow:[NSApp keyWindow] modalDelegate:self
+ modalForWindow:[tableDocumentInstance parentWindow] modalDelegate:self
didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:)
contextInfo:@"autoincrementindex" ];
}
@@ -352,7 +352,7 @@
[mySQLConnection queryString:queryString];
if ([mySQLConnection queryErrored]) {
- SPBeginAlertSheet(NSLocalizedString(@"Error moving field", @"error moving field message"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [NSApp keyWindow], self, nil, nil,
+ SPBeginAlertSheet(NSLocalizedString(@"Error moving field", @"error moving field message"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [tableDocumentInstance parentWindow], self, nil, nil,
[NSString stringWithFormat:NSLocalizedString(@"An error occurred while trying to move the field.\n\nMySQL said: %@", @"error moving field informative message"), [mySQLConnection getLastErrorMessage]]);
}
else {
@@ -475,7 +475,7 @@
[[control window] makeFirstResponder:control];
[self addRowToDB];
[tableSourceView selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO];
- [[NSApp keyWindow] makeFirstResponder:tableSourceView];
+ [[tableDocumentInstance parentWindow] makeFirstResponder:tableSourceView];
return YES;
}
diff --git a/Source/SPTextView.m b/Source/SPTextView.m
index 5e04ff2b..84937e2d 100644
--- a/Source/SPTextView.m
+++ b/Source/SPTextView.m
@@ -1825,9 +1825,9 @@ NSInteger _alphabeticSort(id string1, id string2, void *reverse)
[theHintString flushCachedRegexData];
#ifndef SP_REFACTOR
- // If inside the snippet hint $() is defined run as BASH command
- // and replace $() by the return string of that command. Please note
- // only one $() statement is allowed within one ${} snippet environment.
+ // If inside the snippet hint $(…) is defined run … as BASH command
+ // and replace $(…) by the return string of that command. Please note
+ // only one $(…) statement is allowed within one ${…} snippet environment.
NSRange tagRange = [theHintString rangeOfRegex:@"(?s)(?<!\\\\)\\$\\((.*)\\)"];
if(tagRange.length) {
[theHintString flushCachedRegexData];
@@ -2129,7 +2129,7 @@ NSInteger _alphabeticSort(id string1, id string2, void *reverse)
long allFlags = (NSShiftKeyMask|NSControlKeyMask|NSAlternateKeyMask|NSCommandKeyMask);
// Check if user pressed ⌥ to allow composing of accented characters.
- // e.g. for US keyboard "⌥u a" to insert ä
+ // e.g. for US keyboard "⌥ a" to insert ä
// or for non-US keyboards to allow to enter dead keys
// e.g. for German keyboard ` is a dead key, press space to enter `
if (([theEvent modifierFlags] & allFlags) == NSAlternateKeyMask || [[theEvent characters] length] == 0)