Changeset 10073 for trunk/macosx/Controller.m
- Timestamp:
- Feb 2, 2010, 1:47:22 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/Controller.m
r10008 r10073 946 946 - (void) openMagnet: (NSString *) address 947 947 { 948 tr_torrent * duplicateTorrent; 949 if ((duplicateTorrent = tr_torrentFindFromMagnetLink(fLib, [address UTF8String]))) 950 { 951 const tr_info * info = tr_torrentInfo(duplicateTorrent); 952 NSString * name = (info != NULL && info->name != NULL) ? [NSString stringWithUTF8String: info->name] : nil; 953 [self duplicateOpenMagnetAlert: address transferName: name]; 954 return; 955 } 956 948 957 Torrent * torrent; 949 958 if (!(torrent = [[Torrent alloc] initWithMagnetAddress: address location: nil lib: fLib])) … … 1084 1093 1085 1094 NSAlert * alert = [[NSAlert alloc] init]; 1086 [alert setMessageText: NSLocalizedString(@"Adding magnetized transfer failed ", "Magnet link failed -> title")];1095 [alert setMessageText: NSLocalizedString(@"Adding magnetized transfer failed.", "Magnet link failed -> title")]; 1087 1096 [alert setInformativeText: [NSString stringWithFormat: NSLocalizedString(@"There was an error when adding the magnet link \"%@\"." 1088 1097 " The transfer will not occur.", "Magnet link failed -> message"), address]]; … … 1109 1118 [alert setAlertStyle: NSWarningAlertStyle]; 1110 1119 [alert addButtonWithTitle: NSLocalizedString(@"OK", "Open duplicate alert -> button")]; 1120 [alert setShowsSuppressionButton: YES]; 1121 1122 [alert runModal]; 1123 if ([[alert suppressionButton] state]) 1124 [fDefaults setBool: NO forKey: @"WarningDuplicate"]; 1125 [alert release]; 1126 } 1127 1128 - (void) duplicateOpenMagnetAlert: (NSString *) address transferName: (NSString *) name 1129 { 1130 if (![fDefaults boolForKey: @"WarningDuplicate"]) 1131 return; 1132 1133 NSAlert * alert = [[NSAlert alloc] init]; 1134 if (name) 1135 [alert setMessageText: [NSString stringWithFormat: NSLocalizedString(@"A transfer of \"%@\" already exists.", 1136 "Open duplicate magnet alert -> title"), name]]; 1137 else 1138 [alert setMessageText: NSLocalizedString(@"Magnet link is a duplicate of an existing transfer.", 1139 "Open duplicate magnet alert -> title")]; 1140 [alert setInformativeText: [NSString stringWithFormat: 1141 NSLocalizedString(@"The magnet link \"%@\" cannot be added because it is a duplicate of an already existing transfer.", 1142 "Open duplicate magnet alert -> message"), address]]; 1143 [alert setAlertStyle: NSWarningAlertStyle]; 1144 [alert addButtonWithTitle: NSLocalizedString(@"OK", "Open duplicate magnet alert -> button")]; 1111 1145 [alert setShowsSuppressionButton: YES]; 1112 1146
Note: See TracChangeset
for help on using the changeset viewer.