Display an error if saving of the log file fails.
This commit is contained in:
parent
e4480f7a97
commit
c5394700e0
|
@ -847,8 +847,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
|
|||
{
|
||||
NSAlert * alert = [[NSAlert alloc] init];
|
||||
[alert addButtonWithTitle: @"OK"];
|
||||
[alert setMessageText: [NSString stringWithFormat:
|
||||
@"Copy of \"%@\" Cannot Be Created", [torrent name]]];
|
||||
[alert setMessageText: [NSString stringWithFormat: @"Copy of \"%@\" Cannot Be Created", [torrent name]]];
|
||||
[alert setInformativeText: [NSString stringWithFormat:
|
||||
@"The torrent file (%@) cannot be found.", [torrent torrentLocation]]];
|
||||
[alert setAlertStyle: NSWarningAlertStyle];
|
||||
|
|
Binary file not shown.
|
@ -170,7 +170,19 @@
|
|||
- (void) writeToFileSheetClosed: (NSSavePanel *) panel returnCode: (int) code contextInfo: (NSString *) string
|
||||
{
|
||||
if (code == NSOKButton)
|
||||
[string writeToFile: [panel filename] atomically: YES encoding: NSUTF8StringEncoding error: nil];
|
||||
{
|
||||
if (![string writeToFile: [panel filename] atomically: YES encoding: NSUTF8StringEncoding error: nil])
|
||||
{
|
||||
NSAlert * alert = [[NSAlert alloc] init];
|
||||
[alert addButtonWithTitle: @"OK"];
|
||||
[alert setMessageText: [NSString stringWithFormat: @"Log Could Not Be Saved"]];
|
||||
[alert setInformativeText: [NSString stringWithFormat:
|
||||
@"There was a problem creating the file \"%@\".", [[panel filename] lastPathComponent]]];
|
||||
[alert setAlertStyle: NSWarningAlertStyle];
|
||||
|
||||
[alert runModal];
|
||||
}
|
||||
}
|
||||
|
||||
[string release];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue