]> granicus.if.org Git - transmission/commitdiff
When renaming a transfer or file, reload the proper tables.
authorMitchell Livingston <livings124@transmissionbt.com>
Tue, 22 Jan 2013 03:54:51 +0000 (03:54 +0000)
committerMitchell Livingston <livings124@transmissionbt.com>
Tue, 22 Jan 2013 03:54:51 +0000 (03:54 +0000)
macosx/Controller.m
macosx/FileOutlineController.m
macosx/InfoWindowController.m
macosx/Torrent.m
macosx/en.lproj/MainMenu.xib

index e627f853d2523678f9a8a2f1be4684b01f819c9f..dbee4160280988ff8c1744b5b6740ab2d7178c54 100644 (file)
@@ -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 }];
             });
         }
     }];
index 8e278f4fa1f2f91182ef06288690e1eae268a9ca..4596c8144eab7292c44334e632c1e2cd8f3ceb08 100644 (file)
@@ -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 }];
         }];
     }
 }
index c14e2f55393d8bc3f180579402a58729f134494a..ba9b409f0960602500547d298192a5f99250c1bd 100644 (file)
@@ -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];
 }
 
index 5303e6962400a341019adb32ff1e2cd133d5972f..fcb29dd274126a1ed55cd013a4153ecfeb79b617 100644 (file)
@@ -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
index a3850cbdb0b9def5a2beb86d5c8dd622363aa18f..295f22a1dc670f2664fc81c8ee66730c352647e8 100644 (file)
@@ -1558,7 +1558,7 @@ AADAcW1tb2QAAAAAAAAGEAAAoAcAAAAAySceAAAAAAAAAAAAAAAAAAAAAAA</bytes>
                                                                        <reference key="NSOnImage" ref="246127200"/>
                                                                        <reference key="NSMixedImage" ref="330170270"/>
                                                                </object>
-                                                               <object class="NSMenuItem" id="974370788">
+                                                               <object class="NSMenuItem" id="279484089">
                                                                        <reference key="NSMenu" ref="335948734"/>
                                                                        <string key="NSTitle">Rename Selected…</string>
                                                                        <string key="NSKeyEquiv"/>
@@ -1975,7 +1975,7 @@ AADAcW1tb2QAAAAAAAAGEAAAoAcAAAAAySceAAAAAAAAAAAAAAAAAAAAAAA</bytes>
                                                <reference key="NSOnImage" ref="246127200"/>
                                                <reference key="NSMixedImage" ref="330170270"/>
                                        </object>
-                                       <object class="NSMenuItem" id="266554750">
+                                       <object class="NSMenuItem" id="762842238">
                                                <reference key="NSMenu" ref="434296936"/>
                                                <string key="NSTitle">Rename Selected…</string>
                                                <string key="NSKeyEquiv"/>
@@ -3683,7 +3683,7 @@ AADAcW1tb2QAAAAAAAAGEAAAoAcAAAAAySceAAAAAAAAAAAAAAAAAAAAAAA</bytes>
                                        <object class="IBActionConnection" key="connection">
                                                <string key="label">renameSelected:</string>
                                                <reference key="source" ref="30116300"/>
-                                               <reference key="destination" ref="974370788"/>
+                                               <reference key="destination" ref="279484089"/>
                                        </object>
                                        <int key="connectionID">3444</int>
                                </object>
@@ -3691,7 +3691,7 @@ AADAcW1tb2QAAAAAAAAGEAAAoAcAAAAAySceAAAAAAAAAAAAAAAAAAAAAAA</bytes>
                                        <object class="IBActionConnection" key="connection">
                                                <string key="label">renameSelected:</string>
                                                <reference key="source" ref="30116300"/>
-                                               <reference key="destination" ref="266554750"/>
+                                               <reference key="destination" ref="762842238"/>
                                        </object>
                                        <int key="connectionID">3447</int>
                                </object>
@@ -4492,7 +4492,7 @@ AADAcW1tb2QAAAAAAAAGEAAAoAcAAAAAySceAAAAAAAAAAAAAAAAAAAAAAA</bytes>
                                                        <reference ref="349340971"/>
                                                        <reference ref="245039314"/>
                                                        <reference ref="96633809"/>
-                                                       <reference ref="974370788"/>
+                                                       <reference ref="279484089"/>
                                                </array>
                                                <reference key="parent" ref="249425108"/>
                                        </object>
@@ -4723,7 +4723,7 @@ AADAcW1tb2QAAAAAAAAGEAAAoAcAAAAAySceAAAAAAAAAAAAAAAAAAAAAAA</bytes>
                                                        <reference ref="24108443"/>
                                                        <reference ref="922629505"/>
                                                        <reference ref="143702072"/>
-                                                       <reference ref="266554750"/>
+                                                       <reference ref="762842238"/>
                                                </array>
                                                <reference key="parent" ref="0"/>
                                                <string key="objectName">ContextRowMenu</string>
@@ -5506,12 +5506,12 @@ AADAcW1tb2QAAAAAAAAGEAAAoAcAAAAAySceAAAAAAAAAAAAAAAAAAAAAAA</bytes>
                                        </object>
                                        <object class="IBObjectRecord">
                                                <int key="objectID">3441</int>
-                                               <reference key="object" ref="974370788"/>
+                                               <reference key="object" ref="279484089"/>
                                                <reference key="parent" ref="335948734"/>
                                        </object>
                                        <object class="IBObjectRecord">
                                                <int key="objectID">3445</int>
-                                               <reference key="object" ref="266554750"/>
+                                               <reference key="object" ref="762842238"/>
                                                <reference key="parent" ref="434296936"/>
                                        </object>
                                </array>