Develop and Download Open Source Software

Browse Subversion Repository

Diff of /bardiche/trunk/BSAltImgPreviewer.m

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1680 by wolfrosch, Wed Jan 8 00:03:37 2014 UTC revision 1681 by tsawada2, Sun Jan 12 17:15:35 2014 UTC
# Line 26  Line 26 
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    
# Line 146  Line 148 
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    
# Line 175  Line 177 
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    
# Line 209  Line 212 
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      }      }
# Line 229  Line 233 
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

Legend:
Removed from v.1680  
changed lines
  Added in v.1681

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26