Have PBWebController react to configuration changes.

Override preferencesChanged in subclasses to actually react to changes.
Base class does nothing by default.
This commit is contained in:
Daniel Lundqvist
2008-12-26 21:00:41 +08:00
committed by Pieter de Bie
parent 55d57ba076
commit 865ae5f422
+19
View File
@@ -13,6 +13,10 @@
#include <SystemConfiguration/SCNetworkReachability.h>
@interface PBWebController()
- (void)preferencesChangedWithNotification:(NSNotification *)theNotification;
@end
@implementation PBWebController
@synthesize startFile, repository;
@@ -24,6 +28,12 @@
NSURLRequest * request = [NSURLRequest requestWithURL:[NSURL fileURLWithPath:file]];
callbacks = [NSMapTable mapTableWithKeyOptions:(NSPointerFunctionsObjectPointerPersonality|NSPointerFunctionsStrongMemory) valueOptions:(NSPointerFunctionsObjectPointerPersonality|NSPointerFunctionsStrongMemory)];
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
[nc addObserver:self
selector:@selector(preferencesChangedWithNotification:)
name:NSUserDefaultsDidChangeNotification
object:nil];
finishedLoading = NO;
[view setUIDelegate:self];
[view setFrameLoadDelegate:self];
@@ -179,4 +189,13 @@
[self returnCallBackForObject:[notification object] withData:data];
}
- (void) preferencesChanged
{
}
- (void)preferencesChangedWithNotification:(NSNotification *)theNotification
{
[self preferencesChanged];
}
@end