From 264cdfdc11f7cb3c57da7914880c4fb64847ab67 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Fri, 29 Jun 2007 23:54:36 +0000 Subject: [PATCH] add an option in the duplicate alert to not prompt again --- macosx/Controller.m | 13 +++++++++---- macosx/Defaults.plist | 2 ++ macosx/PrefsController.m | 1 + 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/macosx/Controller.m b/macosx/Controller.m index c002d2f98..3290f5401 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -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]; } diff --git a/macosx/Defaults.plist b/macosx/Defaults.plist index fedf74379..487021b61 100644 --- a/macosx/Defaults.plist +++ b/macosx/Defaults.plist @@ -116,6 +116,8 @@ WarningDebug + WarningDuplicate + WarningRemainingSpace diff --git a/macosx/PrefsController.m b/macosx/PrefsController.m index 7870ec0e1..f832424b0 100644 --- a/macosx/PrefsController.m +++ b/macosx/PrefsController.m @@ -438,6 +438,7 @@ - (void) resetWarnings: (id) sender { [fDefaults setBool: YES forKey: @"WarningDebug"]; + [fDefaults setBool: YES forKey: @"WarningDuplicate"]; [fDefaults setBool: YES forKey: @"WarningRemainingSpace"]; }