From bd2ad5ca97fcb153807442b6d7c2c38beca721e0 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Thu, 5 Jun 2008 15:22:18 +0000 Subject: [PATCH] handle all settings changed by rpc (previously download location was missing) --- macosx/InfoWindowController.m | 6 ++---- macosx/PrefsController.m | 5 ++++- macosx/Torrent.h | 2 +- macosx/Torrent.m | 4 +--- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/macosx/InfoWindowController.m b/macosx/InfoWindowController.m index 92824216b..87b49d71d 100644 --- a/macosx/InfoWindowController.m +++ b/macosx/InfoWindowController.m @@ -1553,10 +1553,8 @@ typedef enum [fTrackers removeObjectsAtIndexes: indexes]; - if (![torrent updateAllTrackersForRemove: fTrackers]) - NSBeep(); - else - [fTrackerTable deselectAll: self]; + [torrent updateAllTrackersForRemove: fTrackers]; + [fTrackerTable deselectAll: self]; //reset table with either new or old value [fTrackers release]; diff --git a/macosx/PrefsController.m b/macosx/PrefsController.m index 79dd92921..67d441d9c 100644 --- a/macosx/PrefsController.m +++ b/macosx/PrefsController.m @@ -810,7 +810,8 @@ [fDefaults setBool: encryptionMode == TR_ENCRYPTION_PREFERRED forKey: @"EncryptionPrefer"]; //download directory - #warning missing! + NSString * downloadLocation = [[NSString stringWithUTF8String: tr_sessionGetDownloadDir(fHandle)] stringByStandardizingPath]; + [fDefaults setObject: downloadLocation forKey: @"DownloadFolder"]; //peers uint16_t peersTotal = tr_sessionGetPeerLimit(fHandle); @@ -850,6 +851,8 @@ { //encryption handled by bindings + //download directory handled by bindings + [fPeersGlobalField setIntValue: peersTotal]; //pex handled by bindings diff --git a/macosx/Torrent.h b/macosx/Torrent.h index 3b99e16a3..d77878b36 100644 --- a/macosx/Torrent.h +++ b/macosx/Torrent.h @@ -151,7 +151,7 @@ typedef enum - (NSMutableArray *) allTrackers: (BOOL) separators; - (BOOL) updateAllTrackersForAdd: (NSMutableArray *) trackers; -- (BOOL) updateAllTrackersForRemove: (NSMutableArray *) trackers; +- (void) updateAllTrackersForRemove: (NSMutableArray *) trackers; - (BOOL) hasAddedTrackers; - (NSString *) comment; diff --git a/macosx/Torrent.m b/macosx/Torrent.m index 563af5905..540ff4557 100644 --- a/macosx/Torrent.m +++ b/macosx/Torrent.m @@ -819,15 +819,13 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void * return YES; } -- (BOOL) updateAllTrackersForRemove: (NSMutableArray *) trackers +- (void) updateAllTrackersForRemove: (NSMutableArray *) trackers { //check if no user-added groups if ([[trackers objectAtIndex: 0] intValue] != 0) fAddedTrackers = NO; [self updateAllTrackers: trackers]; - - return YES; } - (BOOL) hasAddedTrackers