use the new rename function for the torrent, instead of the per-file function; update the interface right away when renaming the torrent

This commit is contained in:
Mitchell Livingston 2013-01-22 00:44:58 +00:00
parent aae38eb05f
commit 5a53ea421f
3 changed files with 11 additions and 2 deletions

View File

@ -1748,7 +1748,12 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
Torrent * torrent = selected[0];
[FileRenameSheetController presentSheetForTorrent:torrent modalForWindow: fWindow completionHandler: ^(BOOL didRename) {
NSLog(@"finished");
if (didRename)
{
dispatch_async(dispatch_get_main_queue(), ^{
[self fullUpdateUI];
});
}
}];
}

View File

@ -85,6 +85,10 @@ typedef void (^CompletionBlock)(BOOL);
[self.inputField setStringValue: name];
[self.renameButton setEnabled: NO];
#warning size these
[self.renameButton setStringValue: NSLocalizedString(@"Rename", "rename sheet button")];
[self.cancelButton setStringValue: NSLocalizedString(@"Cancel", "rename sheet button")];
}
- (IBAction) rename: (id) sender;

View File

@ -849,7 +849,7 @@ int trashDataFile(const char * filename)
NSDictionary * contextInfo = [@{ @"Nodes" : fFileList, @"CompletionHandler" : [[completionHandler copy] autorelease] } retain];
tr_torrentRenamePath(fHandle, fInfo->name, [newName UTF8String], renameCallback, contextInfo);
tr_torrentRename(fHandle, [newName UTF8String], renameCallback, contextInfo);
}
- (void) renameFileNode: (FileListNode *) node withName: (NSString *) newName completionHandler: (void (^)(BOOL didRename)) completionHandler