//Dispose afs manager
[afsPropMngr release];
[[NSDistributedNotificationCenter defaultCenter] postNotificationName:kAfsCommanderID
- object:kMenuExtraEventOccured];
+ object:kMExtraTokenOperation];
}
// -------------------------------------------------------------------------------
[afsMngr unlog:nil];
[self updateAfsStatus:nil];
[[NSDistributedNotificationCenter defaultCenter] postNotificationName:kAfsCommanderID
- object:kMenuExtraEventOccured];
+ object:kMExtraTokenOperation];
}
afsProperty = [[AFSPropertyManager alloc] init];
// register preference pane to detect menuextra killed by user
-/* [[NSDistributedNotificationCenter defaultCenter] addObserver:self
- selector:@selector(mextraChangeActivation:)
- name:kAfsCommanderID
- object:kMExtraClosedNotification];*/
+ [[NSDistributedNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(refreshTokensNotify:)
+ name:kAfsCommanderID
+ object:kMExtraTokenOperation];
[[NSDistributedNotificationCenter defaultCenter] addObserver:self
selector:@selector(refreshGui:)
[self writePreferenceFile];
// unregister preference pane to detect menuextra killed by user
- [[NSDistributedNotificationCenter defaultCenter] removeObserver:self
- name:kAfsCommanderID
+ [[NSDistributedNotificationCenter defaultCenter] removeObserver:self
+ name:kAfsCommanderID
object:kMExtraClosedNotification];
- [[NSDistributedNotificationCenter defaultCenter] removeObserver:self
- name:kAfsCommanderID
+ [[NSDistributedNotificationCenter defaultCenter] removeObserver:self
+ name:kAfsCommanderID
+ object:kMExtraTokenOperation];
+ [[NSDistributedNotificationCenter defaultCenter] removeObserver:self
+ name:kAfsCommanderID
object:kMenuExtraEventOccured];
[[[NSWorkspace sharedWorkspace] notificationCenter] removeObserver:self
name:NSWorkspaceDidMountNotification object:nil];
- (void) refreshGui:(NSNotification *)notification{
BOOL afsIsUp = [afsProperty checkAfsStatus];
[self setAfsStatus];
- [self refreshTokens:nil];
[tokensButton setEnabled:afsIsUp];
[unlogButton setEnabled:afsIsUp];
}
// -------------------------------------------------------------------------------
+// -(void) refreshTokensNotify:(NSNotification*)notification
+// -------------------------------------------------------------------------------
+-(void) refreshTokensNotify:(NSNotification*)notification {
+ [self refreshTokens:nil];
+}
+
+// -------------------------------------------------------------------------------
// afsVolumeMountChange: Track the afs volume state change
// -------------------------------------------------------------------------------
- (void) afsVolumeMountChange:(NSNotification *)notification{
#define kMenuExtraEventOccured @"menu_extra_event_occured"
// Changed preference notification key
#define kMExtraClosedNotification @"preference_changed"
+// Changed preference notification key
+#define kMExtraTokenOperation @"kMExtraTokenOperation"
// Update MenuExtra AfsState notification key
#define kMExtraAFSStateChange @"menu_extra_afs_state_change"
// Update MenuExtra for show menu notification key