Skip to content

Commit ba147b3

Browse files
committed
• Added another block-based method to SSYAlert.
• Better label for regular expressions
1 parent 0c8ed84 commit ba147b3

File tree

3 files changed

+26
-2
lines changed

3 files changed

+26
-2
lines changed

Diff for: SSYAlert.h

+4
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,10 @@ extern NSObject <SSYAlertErrorHideManager> * gSSYAlertErrorHideManager ;
737737
*/
738738
- (SSYAlertRecovery)alertError:(NSError*)error ;
739739

740+
- (void)alertError:(NSError*)error
741+
onWindow:(NSWindow*)window
742+
completionHandler:(void(^)(NSModalResponse returnCode))completionHandler ;
743+
740744
/*!
741745
@brief Invokes -alertError: on the application's shared alert.
742746
*/

Diff for: SSYAlert.m

+20
Original file line numberDiff line numberDiff line change
@@ -2077,6 +2077,26 @@ - (void)returnToScriptError:(NSError*)error {
20772077
[[NSScriptCommand currentCommand] setScriptErrorString:[error localizedDescription]] ;
20782078
}
20792079

2080+
- (void)alertError:(NSError*)error
2081+
onWindow:(NSWindow*)window
2082+
completionHandler:(void(^)(NSModalResponse returnCode))completionHandler {
2083+
if (!error) {
2084+
return ;
2085+
}
2086+
2087+
if ([gSSYAlertErrorHideManager shouldHideError:error]) {
2088+
return ;
2089+
}
2090+
2091+
if ([[error domain] isEqualToString:NSCocoaErrorDomain] && ([error code] == NSUserCancelledError)) {
2092+
return ;
2093+
}
2094+
2095+
[self doLayoutError:error] ;
2096+
[self runModalSheetOnWindow:window
2097+
completionHandler:completionHandler] ;
2098+
}
2099+
20802100
- (void)alertError:(NSError*)error
20812101
onWindow:(NSWindow*)documentWindow_
20822102
modalDelegate:(id)modalDelegate

Diff for: SSYReplacePredicateEditorRowTemplate.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ - (BOOL)isRegex {
114114
return isRegex ;
115115
}
116116

117-
118117
@end
119118

119+
120120
@implementation SSYReplacePredicateEditorRowTemplate
121121

122122
/* Superclass NSPredicateEditorRowTemplate must conform to NSCopying because,
@@ -187,7 +187,7 @@ + (NSString*)anyEditableStringValueInView:(NSView*)view {
187187
}
188188

189189
+ (NSString*)localizedRegexMenuItemTitle {
190-
return NSLocalizedString(@"Matches Regular Expression", nil) ;
190+
return NSLocalizedString(@"matches regular expression", nil) ;
191191
}
192192

193193
@end

0 commit comments

Comments
 (0)