| 26 |
- (void)setPreviewFolderPath:(NSString *)newPath; |
- (void)setPreviewFolderPath:(NSString *)newPath; |
| 27 |
|
|
| 28 |
- (BOOL)previewLinkWithWebBrowser:(NSArray *)urlsArray; |
- (BOOL)previewLinkWithWebBrowser:(NSArray *)urlsArray; |
| 29 |
|
|
| 30 |
|
- (void)showBardicheErrorAlertWithMessage:(NSString *)messageText underlyingError:(NSError *)error; |
| 31 |
@end |
@end |
| 32 |
|
|
| 33 |
|
|
| 148 |
NSString *path; |
NSString *path; |
| 149 |
|
|
| 150 |
path = [[self applicationSupportBundle] pathForResource:resourceName ofType:aType inDirectory:PREVIEW_DIR]; |
path = [[self applicationSupportBundle] pathForResource:resourceName ofType:aType inDirectory:PREVIEW_DIR]; |
| 151 |
if (path) { |
if (path && [[NSFileManager defaultManager] fileExistsAtPath:path]) { |
| 152 |
return path; |
return path; |
| 153 |
} |
} |
| 154 |
|
|
| 177 |
} else { |
} else { |
| 178 |
if (error) { |
if (error) { |
| 179 |
NSLog(@"** Bardiche ** Can't write html source file to %@. reason:%@ (%@ %ld)", filePath, [error localizedDescription], [error domain], (long)[error code]); |
NSLog(@"** Bardiche ** Can't write html source file to %@. reason:%@ (%@ %ld)", filePath, [error localizedDescription], [error domain], (long)[error code]); |
| 180 |
|
[self showBardicheErrorAlertWithMessage:BSAltLocalizedString(PREVIEW_ERROR_WRITE, @"") underlyingError:error]; |
| 181 |
} |
} |
| 182 |
} |
} |
| 183 |
|
|
| 212 |
if (!source) { |
if (!source) { |
| 213 |
if (error) { |
if (error) { |
| 214 |
NSLog(@"** Bardiche ** Can't read html source file at %@. reason:%@ (%@ %ld)", templatePath, [error localizedDescription], [error domain], (long)[error code]); |
NSLog(@"** Bardiche ** Can't read html source file at %@. reason:%@ (%@ %ld)", templatePath, [error localizedDescription], [error domain], (long)[error code]); |
| 215 |
|
[self showBardicheErrorAlertWithMessage:BSAltLocalizedString(PREVIEW_ERROR_READ, @"") underlyingError:error]; |
| 216 |
} |
} |
| 217 |
return NO; |
return NO; |
| 218 |
} |
} |
| 233 |
} |
} |
| 234 |
return [self launchWebBrowser:array inBackground:[[self preferences] openInBg]]; |
return [self launchWebBrowser:array inBackground:[[self preferences] openInBg]]; |
| 235 |
} |
} |
| 236 |
|
|
| 237 |
|
- (void)showBardicheErrorAlertWithMessage:(NSString *)messageText underlyingError:(NSError *)error |
| 238 |
|
{ |
| 239 |
|
if (messageText && error) { |
| 240 |
|
NSAlert *alert = [[[NSAlert alloc] init] autorelease]; |
| 241 |
|
[alert setAlertStyle:NSWarningAlertStyle]; |
| 242 |
|
[alert setMessageText:messageText]; |
| 243 |
|
[alert setInformativeText:[error localizedDescription]]; |
| 244 |
|
[alert runModal]; |
| 245 |
|
} |
| 246 |
|
} |
| 247 |
@end |
@end |