From 806fdb031400dab32317fc3319f8a01caa3caaa2 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Tue, 22 Jan 2013 03:54:51 +0000 Subject: [PATCH] When renaming a transfer or file, reload the proper tables. --- macosx/Controller.m | 3 +++ macosx/FileOutlineController.m | 10 ++++++---- macosx/InfoWindowController.m | 3 ++- macosx/Torrent.m | 2 +- macosx/en.lproj/MainMenu.xib | 16 ++++++++-------- 5 files changed, 20 insertions(+), 14 deletions(-) diff --git a/macosx/Controller.m b/macosx/Controller.m index e627f853d..dbee41602 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -555,6 +555,7 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy [nc addObserver: fWindow selector: @selector(makeKeyWindow) name: @"MakeWindowKey" object: nil]; + #warning rename [nc addObserver: self selector: @selector(fullUpdateUI) name: @"UpdateQueue" object: nil]; @@ -1752,6 +1753,8 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy { dispatch_async(dispatch_get_main_queue(), ^{ [self fullUpdateUI]; + + [[NSNotificationCenter defaultCenter] postNotificationName: @"ResetInspector" object: self userInfo: @{ @"Torrent" : torrent }]; }); } }]; diff --git a/macosx/FileOutlineController.m b/macosx/FileOutlineController.m index 8e278f4fa..4596c8144 100644 --- a/macosx/FileOutlineController.m +++ b/macosx/FileOutlineController.m @@ -442,17 +442,19 @@ typedef enum if (![torrent isFolder]) { [FileRenameSheetController presentSheetForTorrent: torrent modalForWindow: [fOutline window] completionHandler: ^(BOOL didRename) { -#warning need to re-sort if (didRename) - [[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateUI" object: nil]; + { + [[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateQueue" object: self]; + [[NSNotificationCenter defaultCenter] postNotificationName: @"ResetInspector" object: self userInfo: @{ @"Torrent" : torrent }]; + } }]; } else { [FileRenameSheetController presentSheetForFileListNode: node modalForWindow: [fOutline window] completionHandler: ^(BOOL didRename) { -#warning need to re-sort + #warning instead of calling reset inspector, just resort? if (didRename) - [[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateUI" object: nil]; + [[NSNotificationCenter defaultCenter] postNotificationName: @"ResetInspector" object: self userInfo: @{ @"Torrent" : torrent }]; }]; } } diff --git a/macosx/InfoWindowController.m b/macosx/InfoWindowController.m index c14e2f553..ba9b409f0 100644 --- a/macosx/InfoWindowController.m +++ b/macosx/InfoWindowController.m @@ -543,7 +543,8 @@ typedef enum - (void) resetInfoForTorrent: (NSNotification *) notification { - if (fTorrents && [fTorrents containsObject: [notification object]]) + Torrent * torrent = [notification userInfo][@"Torrent"]; + if (fTorrents && (!torrent || [fTorrents containsObject: torrent])) [self resetInfo]; } diff --git a/macosx/Torrent.m b/macosx/Torrent.m index 5303e6962..fcb29dd27 100644 --- a/macosx/Torrent.m +++ b/macosx/Torrent.m @@ -1940,7 +1940,7 @@ int trashDataFile(const char * filename) [self changeDownloadFolderBeforeUsing: location determinationType:TorrentDeterminationAutomatic]; } - [[NSNotificationCenter defaultCenter] postNotificationName: @"ResetInspector" object: self]; + [[NSNotificationCenter defaultCenter] postNotificationName: @"ResetInspector" object: self userInfo: @{ @"Torrent" : self }]; } - (BOOL) shouldShowEta diff --git a/macosx/en.lproj/MainMenu.xib b/macosx/en.lproj/MainMenu.xib index a3850cbdb..295f22a1d 100644 --- a/macosx/en.lproj/MainMenu.xib +++ b/macosx/en.lproj/MainMenu.xib @@ -1558,7 +1558,7 @@ AADAcW1tb2QAAAAAAAAGEAAAoAcAAAAAySceAAAAAAAAAAAAAAAAAAAAAAA - + Rename Selected… @@ -1975,7 +1975,7 @@ AADAcW1tb2QAAAAAAAAGEAAAoAcAAAAAySceAAAAAAAAAAAAAAAAAAAAAAA - + Rename Selected… @@ -3683,7 +3683,7 @@ AADAcW1tb2QAAAAAAAAGEAAAoAcAAAAAySceAAAAAAAAAAAAAAAAAAAAAAA renameSelected: - + 3444 @@ -3691,7 +3691,7 @@ AADAcW1tb2QAAAAAAAAGEAAAoAcAAAAAySceAAAAAAAAAAAAAAAAAAAAAAA renameSelected: - + 3447 @@ -4492,7 +4492,7 @@ AADAcW1tb2QAAAAAAAAGEAAAoAcAAAAAySceAAAAAAAAAAAAAAAAAAAAAAA - + @@ -4723,7 +4723,7 @@ AADAcW1tb2QAAAAAAAAGEAAAoAcAAAAAySceAAAAAAAAAAAAAAAAAAAAAAA - + ContextRowMenu @@ -5506,12 +5506,12 @@ AADAcW1tb2QAAAAAAAAGEAAAoAcAAAAAySceAAAAAAAAAAAAAAAAAAAAAAA 3441 - + 3445 - + -- 2.40.0