add an option in the duplicate alert to not prompt again

This commit is contained in:
Mitchell Livingston 2007-06-29 23:54:36 +00:00
parent 84fe42c280
commit 264cdfdc11
3 changed files with 12 additions and 4 deletions

View File

@ -464,7 +464,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
" This setting can be changed in the Message Log window (accessible from the Window menu).",
"Debug log alert -> informative message")];
[alert addButtonWithTitle: NSLocalizedString(@"OK", "Debug log alert -> button")];
[alert addButtonWithTitle: NSLocalizedString(@"Don't Remind Again", "Debug log alert -> button")];
[alert addButtonWithTitle: NSLocalizedString(@"Don't Alert Again", "Debug log alert -> button")];
if ([alert runModal] == NSAlertSecondButtonReturn)
[fDefaults setBool: NO forKey: @"WarningDebug"];
@ -896,16 +896,21 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
- (void) duplicateOpenAlert: (NSString *) name
{
if (![fDefaults boolForKey: @"WarningDuplicate"])
return;
NSAlert * alert = [[NSAlert alloc] init];
[alert addButtonWithTitle: NSLocalizedString(@"OK", "Open duplicate alert -> button")];
[alert setMessageText: [NSString stringWithFormat: NSLocalizedString(@"Transfer of \"%@\" is already running.",
[alert setMessageText: [NSString stringWithFormat: NSLocalizedString(@"A transfer of \"%@\" is already running.",
"Open duplicate alert -> title"), name]];
[alert setInformativeText:
NSLocalizedString(@"The torrent file cannot be opened because it is a duplicate of an already running transfer.",
"Open duplicate alert -> message")];
[alert addButtonWithTitle: NSLocalizedString(@"OK", "Open duplicate alert -> button")];
[alert addButtonWithTitle: NSLocalizedString(@"Don't Alert Again", "Open duplicate alert -> button")];
[alert setAlertStyle: NSWarningAlertStyle];
[alert runModal];
if ([alert runModal] == NSAlertSecondButtonReturn)
[fDefaults setBool: NO forKey: @"WarningDuplicate"];
[alert release];
}

View File

@ -116,6 +116,8 @@
<false/>
<key>WarningDebug</key>
<true/>
<key>WarningDuplicate</key>
<true/>
<key>WarningRemainingSpace</key>
<true/>
</dict>

View File

@ -438,6 +438,7 @@
- (void) resetWarnings: (id) sender
{
[fDefaults setBool: YES forKey: @"WarningDebug"];
[fDefaults setBool: YES forKey: @"WarningDuplicate"];
[fDefaults setBool: YES forKey: @"WarningRemainingSpace"];
}