Changeset 8842
- Timestamp:
- Jul 19, 2009, 7:14:01 PM (13 years ago)
- Location:
- trunk/macosx
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/Controller.h
r8386 r8842 141 141 - (void) stopTorrents: (NSArray *) torrents; 142 142 143 - (void) removeTorrents: (NSArray *) torrents 144 deleteData: (BOOL) deleteData deleteTorrent: (BOOL) deleteData; 143 - (void) removeTorrents: (NSArray *) torrents deleteData: (BOOL) deleteData; 145 144 - (void) removeSheetDidEnd: (NSWindow *) sheet returnCode: (NSInteger) returnCode 146 145 contextInfo: (NSDictionary *) dict; 147 - (void) confirmRemoveTorrents: (NSArray *) torrents deleteData: (BOOL) deleteData deleteTorrent: (BOOL) deleteTorrent;146 - (void) confirmRemoveTorrents: (NSArray *) torrents deleteData: (BOOL) deleteData; 148 147 - (void) removeNoDelete: (id) sender; 149 148 - (void) removeDeleteData: (id) sender; 150 - (void) removeDeleteTorrent: (id) sender;151 - (void) removeDeleteDataAndTorrent: (id) sender;152 149 153 150 - (void) moveDataFilesSelected: (id) sender; -
trunk/macosx/Controller.m
r8676 r8842 1146 1146 } 1147 1147 1148 - (void) removeTorrents: (NSArray *) torrents deleteData: (BOOL) deleteData deleteTorrent: (BOOL) deleteTorrent1148 - (void) removeTorrents: (NSArray *) torrents deleteData: (BOOL) deleteData 1149 1149 { 1150 1150 [torrents retain]; … … 1165 1165 NSDictionary * dict = [[NSDictionary alloc] initWithObjectsAndKeys: 1166 1166 torrents, @"Torrents", 1167 [NSNumber numberWithBool: deleteData], @"DeleteData", 1168 [NSNumber numberWithBool: deleteTorrent], @"DeleteTorrent", nil]; 1167 [NSNumber numberWithBool: deleteData], @"DeleteData", nil]; 1169 1168 1170 1169 NSString * title, * message; 1171 1170 1172 NSInteger selected = [torrents count];1171 const NSInteger selected = [torrents count]; 1173 1172 if (selected == 1) 1174 1173 { 1175 1174 NSString * torrentName = [[torrents objectAtIndex: 0] name]; 1176 1175 1177 if (!deleteData && !deleteTorrent) 1176 if (deleteData) 1177 title = [NSString stringWithFormat: 1178 NSLocalizedString(@"Are you sure you want to remove \"%@\" from the transfer list" 1179 " and trash the data file?", "Removal confirm panel -> title"), torrentName]; 1180 else 1178 1181 title = [NSString stringWithFormat: 1179 1182 NSLocalizedString(@"Are you sure you want to remove \"%@\" from the transfer list?", 1180 1183 "Removal confirm panel -> title"), torrentName]; 1181 else if (deleteData && !deleteTorrent)1182 title = [NSString stringWithFormat:1183 NSLocalizedString(@"Are you sure you want to remove \"%@\" from the transfer list"1184 " and trash the data file?", "Removal confirm panel -> title"), torrentName];1185 else if (!deleteData && deleteTorrent)1186 title = [NSString stringWithFormat:1187 NSLocalizedString(@"Are you sure you want to remove \"%@\" from the transfer list"1188 " and trash the torrent file?", "Removal confirm panel -> title"), torrentName];1189 else1190 title = [NSString stringWithFormat:1191 NSLocalizedString(@"Are you sure you want to remove \"%@\" from the transfer list"1192 " and trash both the data and torrent files?", "Removal confirm panel -> title"), torrentName];1193 1184 1194 1185 message = NSLocalizedString(@"This transfer is active." … … 1198 1189 else 1199 1190 { 1200 if (!deleteData && !deleteTorrent) 1191 if (deleteData) 1192 title = [NSString stringWithFormat: 1193 NSLocalizedString(@"Are you sure you want to remove %d transfers from the transfer list" 1194 " and trash the data files?", "Removal confirm panel -> title"), selected]; 1195 else 1201 1196 title = [NSString stringWithFormat: 1202 1197 NSLocalizedString(@"Are you sure you want to remove %d transfers from the transfer list?", 1203 1198 "Removal confirm panel -> title"), selected]; 1204 else if (deleteData && !deleteTorrent)1205 title = [NSString stringWithFormat:1206 NSLocalizedString(@"Are you sure you want to remove %d transfers from the transfer list"1207 " and trash the data file?", "Removal confirm panel -> title"), selected];1208 else if (!deleteData && deleteTorrent)1209 title = [NSString stringWithFormat:1210 NSLocalizedString(@"Are you sure you want to remove %d transfers from the transfer list"1211 " and trash the torrent file?", "Removal confirm panel -> title"), selected];1212 else1213 title = [NSString stringWithFormat:1214 NSLocalizedString(@"Are you sure you want to remove %d transfers from the transfer list"1215 " and trash both the data and torrent files?", "Removal confirm panel -> title"), selected];1216 1199 1217 1200 if (selected == active) … … 1233 1216 } 1234 1217 1235 [self confirmRemoveTorrents: torrents deleteData: deleteData deleteTorrent: deleteTorrent];1218 [self confirmRemoveTorrents: torrents deleteData: deleteData]; 1236 1219 } 1237 1220 … … 1240 1223 NSArray * torrents = [dict objectForKey: @"Torrents"]; 1241 1224 if (returnCode == NSAlertDefaultReturn) 1242 [self confirmRemoveTorrents: torrents deleteData: [[dict objectForKey: @"DeleteData"] boolValue] 1243 deleteTorrent: [[dict objectForKey: @"DeleteTorrent"] boolValue]]; 1225 [self confirmRemoveTorrents: torrents deleteData: [[dict objectForKey: @"DeleteData"] boolValue]]; 1244 1226 else 1245 1227 [torrents release]; … … 1248 1230 } 1249 1231 1250 - (void) confirmRemoveTorrents: (NSArray *) torrents deleteData: (BOOL) deleteData deleteTorrent: (BOOL) deleteTorrent1232 - (void) confirmRemoveTorrents: (NSArray *) torrents deleteData: (BOOL) deleteData 1251 1233 { 1252 1234 //don't want any of these starting then stopping … … 1263 1245 if (deleteData) 1264 1246 [torrent trashData]; 1265 if (deleteTorrent)1266 [torrent trashTorrent];1267 1247 1268 1248 [torrent closeRemoveTorrent]; … … 1278 1258 - (void) removeNoDelete: (id) sender 1279 1259 { 1280 [self removeTorrents: [fTableView selectedTorrents] deleteData: NO deleteTorrent: NO];1260 [self removeTorrents: [fTableView selectedTorrents] deleteData: NO]; 1281 1261 } 1282 1262 1283 1263 - (void) removeDeleteData: (id) sender 1284 1264 { 1285 [self removeTorrents: [fTableView selectedTorrents] deleteData: YES deleteTorrent: NO]; 1286 } 1287 1288 - (void) removeDeleteTorrent: (id) sender 1289 { 1290 [self removeTorrents: [fTableView selectedTorrents] deleteData: NO deleteTorrent: YES]; 1291 } 1292 1293 - (void) removeDeleteDataAndTorrent: (id) sender 1294 { 1295 [self removeTorrents: [fTableView selectedTorrents] deleteData: YES deleteTorrent: YES]; 1265 [self removeTorrents: [fTableView selectedTorrents] deleteData: YES]; 1296 1266 } 1297 1267 … … 3541 3511 3542 3512 //enable remove items 3543 if (action == @selector(removeNoDelete:) || action == @selector(removeDeleteData:) 3544 || action == @selector(removeDeleteTorrent:) || action == @selector(removeDeleteDataAndTorrent:)) 3545 { 3546 BOOL warning = NO, 3547 onlyDownloading = [fDefaults boolForKey: @"CheckRemoveDownloading"], 3548 canDelete = action != @selector(removeDeleteTorrent:) && action != @selector(removeDeleteDataAndTorrent:); 3513 if (action == @selector(removeNoDelete:) || action == @selector(removeDeleteData:)) 3514 { 3515 BOOL warning = NO; 3549 3516 3550 3517 for (Torrent * torrent in [fTableView selectedTorrents]) 3551 3518 { 3552 if ( !warning &&[torrent isActive])3519 if ([torrent isActive]) 3553 3520 { 3554 warning = onlyDownloading ? ![torrent isSeeding] : YES; 3555 if (warning && canDelete) 3521 if ([fDefaults boolForKey: @"CheckRemoveDownloading"] ? ![torrent isSeeding] : YES) 3522 { 3523 warning = YES; 3556 3524 break; 3557 } 3558 if (!canDelete && [torrent publicTorrent]) 3559 { 3560 canDelete = YES; 3561 if (warning) 3562 break; 3525 } 3563 3526 } 3564 3527 } … … 3577 3540 } 3578 3541 3579 return canUseTable && canDelete &&[fTableView numberOfSelectedRows] > 0;3542 return canUseTable && [fTableView numberOfSelectedRows] > 0; 3580 3543 } 3581 3544 … … 4124 4087 - (void) rpcRemoveTorrent: (Torrent *) torrent 4125 4088 { 4126 [self confirmRemoveTorrents: [[NSArray arrayWithObject: torrent] retain] deleteData: NO deleteTorrent: NO];4089 [self confirmRemoveTorrents: [[NSArray arrayWithObject: torrent] retain] deleteData: NO]; 4127 4090 [torrent release]; 4128 4091 } -
trunk/macosx/en.lproj/MainMenu.xib
r8836 r8842 9 9 <object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> 10 10 <bool key="EncodedWithXMLCoder">YES</bool> 11 <integer value="1400"/> 11 12 <integer value="3088"/> 12 <integer value=" 1533"/>13 <integer value="456"/> 13 14 </object> 14 15 <object class="NSArray" key="IBDocument.PluginDependencies"> … … 2692 2693 <int key="NSTag">4</int> 2693 2694 </object> 2694 <object class="NSMenuItem" id="529318312">2695 <reference key="NSMenu" ref="335948734"/>2696 <string key="NSTitle">Remove Torrent File</string>2697 <string key="NSKeyEquiv"/>2698 <int key="NSKeyEquivModMask">1572864</int>2699 <int key="NSMnemonicLoc">2147483647</int>2700 <reference key="NSOnImage" ref="322614661"/>2701 <reference key="NSMixedImage" ref="3851078"/>2702 <int key="NSTag">4</int>2703 </object>2704 <object class="NSMenuItem" id="535651621">2705 <reference key="NSMenu" ref="335948734"/>2706 <string key="NSTitle">Remove All Files</string>2707 <string key="NSKeyEquiv"/>2708 <int key="NSKeyEquivModMask">1048576</int>2709 <int key="NSMnemonicLoc">2147483647</int>2710 <reference key="NSOnImage" ref="322614661"/>2711 <reference key="NSMixedImage" ref="3851078"/>2712 <int key="NSTag">4</int>2713 </object>2714 2695 <object class="NSMenuItem" id="135816226"> 2715 2696 <reference key="NSMenu" ref="335948734"/> … … 3149 3130 <string key="NSKeyEquiv"/> 3150 3131 <int key="NSKeyEquivModMask">1572864</int> 3151 <int key="NSMnemonicLoc">2147483647</int>3152 <reference key="NSOnImage" ref="322614661"/>3153 <reference key="NSMixedImage" ref="3851078"/>3154 <int key="NSTag">4</int>3155 </object>3156 <object class="NSMenuItem" id="1022418913">3157 <reference key="NSMenu" ref="434296936"/>3158 <string key="NSTitle">Remove Torrent File</string>3159 <string key="NSKeyEquiv"/>3160 <int key="NSKeyEquivModMask">1572864</int>3161 <int key="NSMnemonicLoc">2147483647</int>3162 <reference key="NSOnImage" ref="322614661"/>3163 <reference key="NSMixedImage" ref="3851078"/>3164 <int key="NSTag">4</int>3165 </object>3166 <object class="NSMenuItem" id="776874527">3167 <reference key="NSMenu" ref="434296936"/>3168 <string key="NSTitle">Remove All Files</string>3169 <string key="NSKeyEquiv"/>3170 <int key="NSKeyEquivModMask">1048576</int>3171 3132 <int key="NSMnemonicLoc">2147483647</int> 3172 3133 <reference key="NSOnImage" ref="322614661"/> … … 4992 4953 <object class="IBConnectionRecord"> 4993 4954 <object class="IBActionConnection" key="connection"> 4994 <string key="label">removeDeleteTorrent:</string>4995 <reference key="source" ref="30116300"/>4996 <reference key="destination" ref="529318312"/>4997 </object>4998 <int key="connectionID">1548</int>4999 </object>5000 <object class="IBConnectionRecord">5001 <object class="IBActionConnection" key="connection">5002 4955 <string key="label">removeNoDelete:</string> 5003 4956 <reference key="source" ref="30116300"/> … … 5013 4966 </object> 5014 4967 <int key="connectionID">1555</int> 5015 </object>5016 <object class="IBConnectionRecord">5017 <object class="IBActionConnection" key="connection">5018 <string key="label">removeDeleteTorrent:</string>5019 <reference key="source" ref="30116300"/>5020 <reference key="destination" ref="1022418913"/>5021 </object>5022 <int key="connectionID">1556</int>5023 4968 </object> 5024 4969 <object class="IBConnectionRecord"> … … 5077 5022 </object> 5078 5023 <int key="connectionID">1584</int> 5079 </object>5080 <object class="IBConnectionRecord">5081 <object class="IBActionConnection" key="connection">5082 <string key="label">removeDeleteDataAndTorrent:</string>5083 <reference key="source" ref="30116300"/>5084 <reference key="destination" ref="535651621"/>5085 </object>5086 <int key="connectionID">1585</int>5087 </object>5088 <object class="IBConnectionRecord">5089 <object class="IBActionConnection" key="connection">5090 <string key="label">removeDeleteDataAndTorrent:</string>5091 <reference key="source" ref="30116300"/>5092 <reference key="destination" ref="776874527"/>5093 </object>5094 <int key="connectionID">1586</int>5095 5024 </object> 5096 5025 <object class="IBConnectionRecord"> … … 6827 6756 <reference ref="910530743"/> 6828 6757 <reference ref="698258555"/> 6829 <reference ref="529318312"/>6830 <reference ref="535651621"/>6831 6758 <reference ref="200454823"/> 6832 6759 <reference ref="117698132"/> … … 6890 6817 <int key="objectID">1541</int> 6891 6818 <reference key="object" ref="698258555"/> 6892 <reference key="parent" ref="335948734"/>6893 </object>6894 <object class="IBObjectRecord">6895 <int key="objectID">1544</int>6896 <reference key="object" ref="529318312"/>6897 <reference key="parent" ref="335948734"/>6898 </object>6899 <object class="IBObjectRecord">6900 <int key="objectID">1545</int>6901 <reference key="object" ref="535651621"/>6902 6819 <reference key="parent" ref="335948734"/> 6903 6820 </object> … … 7083 7000 <reference ref="767449940"/> 7084 7001 <reference ref="46144164"/> 7085 <reference ref="1022418913"/>7086 <reference ref="776874527"/>7087 7002 <reference ref="572427220"/> 7088 7003 <reference ref="897097834"/> … … 7134 7049 <int key="objectID">1551</int> 7135 7050 <reference key="object" ref="46144164"/> 7136 <reference key="parent" ref="434296936"/>7137 </object>7138 <object class="IBObjectRecord">7139 <int key="objectID">1552</int>7140 <reference key="object" ref="1022418913"/>7141 <reference key="parent" ref="434296936"/>7142 </object>7143 <object class="IBObjectRecord">7144 <int key="objectID">1553</int>7145 <reference key="object" ref="776874527"/>7146 7051 <reference key="parent" ref="434296936"/> 7147 7052 </object> … … 8444 8349 <string>1541.IBPluginDependency</string> 8445 8350 <string>1541.ImportedFromIB2</string> 8446 <string>1544.IBPluginDependency</string>8447 <string>1544.ImportedFromIB2</string>8448 <string>1545.IBPluginDependency</string>8449 <string>1545.ImportedFromIB2</string>8450 8351 <string>1550.IBPluginDependency</string> 8451 8352 <string>1550.ImportedFromIB2</string> 8452 8353 <string>1551.IBPluginDependency</string> 8453 8354 <string>1551.ImportedFromIB2</string> 8454 <string>1552.IBPluginDependency</string>8455 <string>1552.ImportedFromIB2</string>8456 <string>1553.IBPluginDependency</string>8457 <string>1553.ImportedFromIB2</string>8458 8355 <string>1558.IBPluginDependency</string> 8459 8356 <string>1558.ImportedFromIB2</string> … … 9010 8907 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 9011 8908 <reference ref="9"/> 9012 <string>{{376, 4 27}, {293, 373}}</string>8909 <string>{{376, 467}, {293, 333}}</string> 9013 8910 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 9014 8911 <reference ref="9"/> … … 9034 8931 <reference ref="9"/> 9035 8932 <string>{{0, 974}, {400, 21}}</string> 9036 <string>com.apple.InterfaceBuilder.CocoaPlugin</string>9037 <reference ref="9"/>9038 <string>com.apple.InterfaceBuilder.CocoaPlugin</string>9039 <reference ref="9"/>9040 <string>com.apple.InterfaceBuilder.CocoaPlugin</string>9041 <reference ref="9"/>9042 <string>com.apple.InterfaceBuilder.CocoaPlugin</string>9043 <reference ref="9"/>9044 8933 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 9045 8934 <reference ref="9"/> … … 9493 9382 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 9494 9383 <reference ref="9"/> 9495 <string>{{529, 3 36}, {277, 273}}</string>9384 <string>{{529, 376}, {277, 233}}</string> 9496 9385 <string>com.apple.InterfaceBuilder.CocoaPlugin</string> 9497 9386 <reference ref="9"/> … … 9591 9480 <string>openURLShowSheet:</string> 9592 9481 <string>removeDeleteData:</string> 9593 <string>removeDeleteDataAndTorrent:</string>9594 <string>removeDeleteTorrent:</string>9595 9482 <string>removeNoDelete:</string> 9596 9483 <string>resumeAllTorrents:</string> … … 9689 9576 <string>id</string> 9690 9577 <string>id</string> 9691 <string>id</string>9692 <string>id</string>9693 9578 </object> 9694 9579 </object>
Note: See TracChangeset
for help on using the changeset viewer.