add "move data file" to torrent action menu

This commit is contained in:
Mitchell Livingston 2008-03-22 17:05:48 +00:00
parent 48ee65795b
commit 24fedbe044
6 changed files with 4207 additions and 4150 deletions

View File

@ -157,7 +157,8 @@ typedef enum
- (void) removeDeleteTorrent: (id) sender;
- (void) removeDeleteDataAndTorrent: (id) sender;
- (void) moveDataFiles: (id) sender;
- (void) moveDataFilesSelected: (id) sender;
- (void) moveDataFiles: (NSArray *) torrents;
- (void) moveDataFileChoiceClosed: (NSOpenPanel *) panel returnCode: (int) code contextInfo: (NSArray *) torrents;
- (void) copyTorrentFiles: (id) sender;

View File

@ -1224,7 +1224,12 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
[self removeTorrents: [fTableView selectedTorrents] deleteData: YES deleteTorrent: YES];
}
- (void) moveDataFiles: (id) sender
- (void) moveDataFilesSelected: (id) sender
{
[self moveDataFiles: [fTableView selectedTorrents]];
}
- (void) moveDataFiles: (NSArray *) torrents
{
NSOpenPanel * panel = [NSOpenPanel openPanel];
[panel setPrompt: NSLocalizedString(@"Select", "Move torrent -> prompt")];
@ -1233,7 +1238,7 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
[panel setCanChooseDirectories: YES];
[panel setCanCreateDirectories: YES];
NSArray * torrents = [[fTableView selectedTorrents] retain];
torrents = [torrents retain];
int count = [torrents count];
if (count == 1)
[panel setMessage: [NSString stringWithFormat: NSLocalizedString(@"Select the new folder for \"%@\".",
@ -1886,7 +1891,7 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
{
BOOL removeTextField = YES;
NSEnumerator * trackerEnumerator = [[torrent allTrackers: NO] objectEnumerator];
id tracker;
NSString * tracker;
while ((tracker = [trackerEnumerator nextObject]))
{
if ([tracker rangeOfString: searchString options: NSCaseInsensitiveSearch].location != NSNotFound)
@ -3599,7 +3604,7 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
return canUseTable && [fTableView numberOfSelectedRows] > 0;
//enable move torrent file item
if (action == @selector(moveDataFiles:))
if (action == @selector(moveDataFilesSelected:))
return canUseTable && [fTableView numberOfSelectedRows] > 0;
//enable copy torrent file item

File diff suppressed because it is too large Load Diff

View File

@ -757,6 +757,7 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
NSTimeInterval difference = [[NSDate dateWithTimeIntervalSince1970: date] timeIntervalSinceNow];
return difference > 0 ? (int)difference : -1;
}
- (NSString *) scrapeResponse
{
return [NSString stringWithUTF8String: fStat->tracker_stat.scrapeResponse];
@ -766,11 +767,13 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
{
NSMutableArray * allTrackers = [NSMutableArray array];
int i, j;
int i;
for (i = 0; i < fInfo->trackerTiers; i++)
{
if (separators)
[allTrackers addObject: [NSNumber numberWithInt: i]];
int j;
for (j = 0; j < fInfo->trackerList[i].count; j++)
[allTrackers addObject: [NSString stringWithFormat: @"http://%s:%d",
fInfo->trackerList[i].list[j].address, fInfo->trackerList[i].list[j].port]];

View File

@ -77,6 +77,7 @@
- (void) setQuickRatio: (id) sender;
- (void) checkFile: (id) sender;
- (void) moveDataFile: (id) sender;
- (void) togglePiecesBar;
- (float) piecesBarPercent;

View File

@ -723,6 +723,11 @@
[[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateStats" object: nil];
}
- (void) moveDataFile: (id) sender
{
[fController moveDataFiles: [NSArray arrayWithObject: fMenuTorrent]];
}
- (void) togglePiecesBar
{
[self resizePiecesBarIncrement];