diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPCustomQuery.m | 19 | ||||
-rw-r--r-- | Source/SPTextView.h | 2 | ||||
-rw-r--r-- | Source/SPTextView.m | 13 |
3 files changed, 17 insertions, 17 deletions
diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m index 2aeaacb6..822348be 100644 --- a/Source/SPCustomQuery.m +++ b/Source/SPCustomQuery.m @@ -876,17 +876,24 @@ } } else { if (totalAffectedRows==1) { - statusString = [NSString stringWithFormat:NSLocalizedString(@"%@; 1 row affected, taking %@", @"text showing one row has been affected by a single query"), - statusErrorString, - [NSString stringForTimeInterval:executionTime] + statusString = [NSString stringWithFormat:NSLocalizedString(@"%@; 1 row affected", @"text showing one row has been affected by a single query"), + statusErrorString ]; } else { - statusString = [NSString stringWithFormat:NSLocalizedString(@"%@; %ld rows affected, taking %@", @"text showing how many rows have been affected by a single query"), + statusString = [NSString stringWithFormat:NSLocalizedString(@"%@; %ld rows affected", @"text showing how many rows have been affected by a single query"), statusErrorString, - (long)totalAffectedRows, - [NSString stringForTimeInterval:executionTime] + (long)totalAffectedRows ]; } + if(resultDataCount) { + // we were running a query that returns a result set (ie. SELECT). + // TODO: mysql_query() returns as soon as the first result row is found (which might be pretty soon when using indexes / not doing aggregations) + // and that makes our query time measurement pretty useless (see #264) + statusString = [statusString stringByAppendingFormat:NSLocalizedString(@", first row available after %1$@",@"Custom Query : text appended to the “x row(s) affected” messages. $1 is a time interval"),[NSString stringForTimeInterval:executionTime]]; + } + else { + statusString = [statusString stringByAppendingFormat:NSLocalizedString(@", taking %1$@",@"Custom Query : text appended to the “x row(s) affected” messages (for update/delete queries). $1 is a time interval"),[NSString stringForTimeInterval:executionTime]]; + } } [[affectedRowsText onMainThread] setStringValue:statusString]; diff --git a/Source/SPTextView.h b/Source/SPTextView.h index 4289bd40..31a39d7a 100644 --- a/Source/SPTextView.h +++ b/Source/SPTextView.h @@ -169,7 +169,7 @@ typedef struct { - (void) doAutoCompletion; - (void) refreshCompletion; - (NSArray *)suggestionsForSQLCompletionWith:(NSString *)currentWord dictMode:(BOOL)isDictMode browseMode:(BOOL)dbBrowseMode withTableName:(NSString*)aTableName withDbName:(NSString*)aDbName; -- (void) selectCurrentQuery; +- (IBAction) selectCurrentQuery:(id)sender; - (void) processMirroredSnippets; - (BOOL)checkForCaretInsideSnippet; diff --git a/Source/SPTextView.m b/Source/SPTextView.m index ce5f8454..36bd005e 100644 --- a/Source/SPTextView.m +++ b/Source/SPTextView.m @@ -1131,7 +1131,7 @@ static inline NSPoint SPPointOnLine(NSPoint a, NSPoint b, CGFloat t) { return NS } } -- (void) selectCurrentQuery +- (IBAction) selectCurrentQuery:(id)sender { if([self isEditable]) [customQueryInstance selectCurrentQuery]; @@ -2244,12 +2244,6 @@ static inline NSPoint SPPointOnLine(NSPoint a, NSPoint b, CGFloat t) { return NS #endif } - if([charactersIgnMod isEqualToString:@"y"]) // ^Y select current query - if(curFlags==(NSControlKeyMask)) - { - [self selectCurrentQuery]; - return; - } if(curFlags & NSCommandKeyMask) { if([charactersIgnMod isEqualToString:@"+"] || [charactersIgnMod isEqualToString:@"="]) // increase text size by 1; ⌘+, ⌘=, and ⌘ numpad + { @@ -3112,9 +3106,8 @@ static inline NSPoint SPPointOnLine(NSPoint a, NSPoint b, CGFloat t) { return NS } if ([[[self class] defaultMenu] itemWithTag:SP_CQ_SELECT_CURRENT_QUERY_MENU_ITEM_TAG] == nil) { - NSMenuItem *selectCurrentQueryMenuItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Select Active Query", @"Select Active Query") action:@selector(selectCurrentQuery) keyEquivalent:@"y"]; + NSMenuItem *selectCurrentQueryMenuItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Select Active Query", @"Select Active Query") action:@selector(selectCurrentQuery:) keyEquivalent:@""]; [selectCurrentQueryMenuItem setTag:SP_CQ_SELECT_CURRENT_QUERY_MENU_ITEM_TAG]; - [selectCurrentQueryMenuItem setKeyEquivalentModifierMask:NSControlKeyMask]; [menu insertItem:selectCurrentQueryMenuItem atIndex:4]; [selectCurrentQueryMenuItem release]; } @@ -3222,7 +3215,7 @@ static inline NSPoint SPPointOnLine(NSPoint a, NSPoint b, CGFloat t) { return NS return ([self selectedRange].length>0); } // Validate Select Active Query - if ([menuItem action] == @selector(selectCurrentQuery)) { + if ([menuItem action] == @selector(selectCurrentQuery:)) { return ([self isEditable] && [[self delegate] isKindOfClass:[SPCustomQuery class]]); } // Disable "Copy with Column Names" and "Copy as SQL INSERT" |