From: Mitchell Livingston Date: Tue, 22 Jan 2013 00:44:58 +0000 (+0000) Subject: use the new rename function for the torrent, instead of the per-file function; update... X-Git-Tag: 2.80~239 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5a53ea421f0550e86c5dd562aba91f4414eebae3;p=transmission use the new rename function for the torrent, instead of the per-file function; update the interface right away when renaming the torrent --- diff --git a/macosx/Controller.m b/macosx/Controller.m index a286b338e..06df4ac0c 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -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]; + }); + } }]; } diff --git a/macosx/FileRenameSheetController.m b/macosx/FileRenameSheetController.m index c9865b10a..13d7c6bbe 100644 --- a/macosx/FileRenameSheetController.m +++ b/macosx/FileRenameSheetController.m @@ -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; diff --git a/macosx/Torrent.m b/macosx/Torrent.m index 02fd74002..5303e6962 100644 --- a/macosx/Torrent.m +++ b/macosx/Torrent.m @@ -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