Changeset 831


Ignore:
Timestamp:
Aug 24, 2006, 2:41:12 AM (15 years ago)
Author:
livings124
Message:

Display an error if saving of the log file fails.

Location:
trunk/macosx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r828 r831  
    848848        NSAlert * alert = [[NSAlert alloc] init];
    849849        [alert addButtonWithTitle: @"OK"];
    850         [alert setMessageText: [NSString stringWithFormat:
    851                 @"Copy of \"%@\" Cannot Be Created", [torrent name]]];
     850        [alert setMessageText: [NSString stringWithFormat: @"Copy of \"%@\" Cannot Be Created", [torrent name]]];
    852851        [alert setInformativeText: [NSString stringWithFormat:
    853852                @"The torrent file (%@) cannot be found.", [torrent torrentLocation]]];
  • trunk/macosx/MessageWindowController.m

    r830 r831  
    171171{
    172172    if (code == NSOKButton)
    173         [string writeToFile: [panel filename] atomically: YES encoding: NSUTF8StringEncoding error: nil];
     173    {
     174        if (![string writeToFile: [panel filename] atomically: YES encoding: NSUTF8StringEncoding error: nil])
     175        {
     176            NSAlert * alert = [[NSAlert alloc] init];
     177            [alert addButtonWithTitle: @"OK"];
     178            [alert setMessageText: [NSString stringWithFormat: @"Log Could Not Be Saved"]];
     179            [alert setInformativeText: [NSString stringWithFormat:
     180                    @"There was a problem creating the file \"%@\".", [[panel filename] lastPathComponent]]];
     181            [alert setAlertStyle: NSWarningAlertStyle];
     182           
     183            [alert runModal];
     184        }
     185    }
    174186   
    175187    [string release];
Note: See TracChangeset for help on using the changeset viewer.