@@ -28,24 +28,26 @@ - (void)awakeFromNib
2828
2929- (void )observeValueForKeyPath : (NSString *)keyPath ofObject : (id )object change : (NSDictionary *)change context : (void *)context
3030{
31- if ([keyPath isEqualToString: @" browsing" ]) {
32- [self updateProgressIndicator ];
33- } else if ([keyPath isEqualToString: @" resolvingServiceCount" ]) {
34- [self updateProgressIndicator ];
35- } else if ([keyPath isEqualToString: @" proxyServiceList" ]) {
36- [self updateStartButton ];
37- [self updateProxyPopUpButton ];
38- } else if ([keyPath isEqualToString: @" interfaceList" ]) {
39- [self updateStartButton ];
40- [self updateInterfacePopUpButton ];
41- } else if ([keyPath isEqualToString: @" proxyEnabled" ]) {
42- [self updateStartButton ];
43- [self updateInterfacePopUpButton ];
44- [self updateProxyPopUpButton ];
45- } else if ([keyPath isEqualToString: @" automatic" ]) {
46- [self updateStartButton ];
47- [self updateInterfacePopUpButton ];
48- [self updateProxyPopUpButton ];
31+ if (object == appDelegate) {
32+ if ([keyPath isEqualToString: @" browsing" ]) {
33+ [self updateProgressIndicator ];
34+ } else if ([keyPath isEqualToString: @" resolvingServiceCount" ]) {
35+ [self updateProgressIndicator ];
36+ } else if ([keyPath isEqualToString: @" proxyServiceList" ]) {
37+ [self updateStartButton ];
38+ [self updateProxyPopUpButton ];
39+ } else if ([keyPath isEqualToString: @" interfaceList" ]) {
40+ [self updateStartButton ];
41+ [self updateInterfacePopUpButton ];
42+ } else if ([keyPath isEqualToString: @" proxyEnabled" ]) {
43+ [self updateStartButton ];
44+ [self updateInterfacePopUpButton ];
45+ [self updateProxyPopUpButton ];
46+ } else if ([keyPath isEqualToString: @" automatic" ]) {
47+ [self updateStartButton ];
48+ [self updateInterfacePopUpButton ];
49+ [self updateProxyPopUpButton ];
50+ }
4951 }
5052}
5153
@@ -74,8 +76,6 @@ - (void)updateStartButton
7476
7577- (void )updateProxyPopUpButton
7678{
77- NSString *defaultProxy = appDelegate.defaultProxy ;
78-
7979 [proxyPopUpButton removeAllItems ];
8080 for (NSNetService *service in appDelegate.proxyServiceList ) {
8181 NSString *title;
@@ -86,9 +86,6 @@ - (void)updateProxyPopUpButton
8686 } else {
8787 [proxyPopUpButton addItemWithTitle: [NSString stringWithFormat: @" %@ (disabled)" , title]];
8888 }
89- if ([defaultProxy isEqualToString: title]) {
90- [proxyPopUpButton selectItem: [proxyPopUpButton lastItem ]];
91- }
9289 [title release ];
9390 }
9491 [proxyPopUpButton setEnabled: !appDelegate.proxyEnabled && !appDelegate.automatic];
@@ -137,7 +134,6 @@ - (IBAction)interfacePopUpButtonAction:(id)sender
137134
138135- (IBAction )proxyPopUpButtonAction : (id )sender
139136{
140- appDelegate.defaultProxy = [appDelegate.proxyServiceList objectAtIndex: [proxyPopUpButton indexOfSelectedItem ]];
141137}
142138
143139@end
0 commit comments