From dffd78ccb013cbda907d5c266137de94814d9c00 Mon Sep 17 00:00:00 2001 From: Claudio Bisegni Date: Fri, 28 Aug 2009 21:16:52 +0200 Subject: [PATCH] Fixed the tokens update and update .gitignore for MacOSX packaging file Fixed the tokens update on preference pane if operation is made with NSStatusItem. Has been updated the src/packaging/MacOS/.gitingore for CellServDB file and src/libafs/.gitignore has been added afs.x86_darwin_100.plist. Reviewed-on: http://gerrit.openafs.org/372 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/libafs/.gitignore | 1 + src/packaging/MacOS/.gitignore | 2 +- .../AFSBackgrounder/AFSBackgrounderDelegate.m | 4 +-- .../DARWIN/AFSPreference/AFSCommanderPref.h | 1 + .../DARWIN/AFSPreference/AFSCommanderPref.m | 27 ++++++++++++------- src/platform/DARWIN/AFSPreference/global.h | 2 ++ 6 files changed, 25 insertions(+), 12 deletions(-) diff --git a/src/libafs/.gitignore b/src/libafs/.gitignore index 607091f73..d87f88a21 100644 --- a/src/libafs/.gitignore +++ b/src/libafs/.gitignore @@ -11,6 +11,7 @@ !/MakefileProto.*.in /afs /afs.x86_darwin_90.plist +/afs.x86_darwin_100.plist /afsint /asm /asm-generic diff --git a/src/packaging/MacOS/.gitignore b/src/packaging/MacOS/.gitignore index 7da76d129..1564103de 100644 --- a/src/packaging/MacOS/.gitignore +++ b/src/packaging/MacOS/.gitignore @@ -5,7 +5,7 @@ /OpenAFS.Info.plist /OpenAFS.info /buildpkg.sh - +/CellServDB .DS_Store *.mode1v3 *.pbxuser diff --git a/src/platform/DARWIN/AFSPreference/AFSBackgrounder/AFSBackgrounderDelegate.m b/src/platform/DARWIN/AFSPreference/AFSBackgrounder/AFSBackgrounderDelegate.m index 1ff2daf05..77251d799 100644 --- a/src/platform/DARWIN/AFSPreference/AFSBackgrounder/AFSBackgrounderDelegate.m +++ b/src/platform/DARWIN/AFSPreference/AFSBackgrounder/AFSBackgrounderDelegate.m @@ -232,7 +232,7 @@ //Dispose afs manager [afsPropMngr release]; [[NSDistributedNotificationCenter defaultCenter] postNotificationName:kAfsCommanderID - object:kMenuExtraEventOccured]; + object:kMExtraTokenOperation]; } // ------------------------------------------------------------------------------- @@ -243,7 +243,7 @@ [afsMngr unlog:nil]; [self updateAfsStatus:nil]; [[NSDistributedNotificationCenter defaultCenter] postNotificationName:kAfsCommanderID - object:kMenuExtraEventOccured]; + object:kMExtraTokenOperation]; } diff --git a/src/platform/DARWIN/AFSPreference/AFSCommanderPref.h b/src/platform/DARWIN/AFSPreference/AFSCommanderPref.h index df6737289..9180d3bc1 100644 --- a/src/platform/DARWIN/AFSPreference/AFSCommanderPref.h +++ b/src/platform/DARWIN/AFSPreference/AFSCommanderPref.h @@ -136,6 +136,7 @@ int CoreMenuExtraRemoveMenuExtra(void *menuExtra, int whoCares); - (void) writePreferenceFile; - (void) readPreferenceFile; - (void) refreshGui:(NSNotification *)notification; +- (void) refreshTokensNotify:(NSNotification*)notification; - (void) afsVolumeMountChange:(NSNotification *)notification; - (void)tabView:(NSTabView *)tabView willSelectTabViewItem: (NSTabViewItem *)tabViewItem; @end diff --git a/src/platform/DARWIN/AFSPreference/AFSCommanderPref.m b/src/platform/DARWIN/AFSPreference/AFSCommanderPref.m index b562acd1e..f7181c1bb 100644 --- a/src/platform/DARWIN/AFSPreference/AFSCommanderPref.m +++ b/src/platform/DARWIN/AFSPreference/AFSCommanderPref.m @@ -130,10 +130,10 @@ 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:) @@ -211,11 +211,14 @@ [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]; @@ -633,11 +636,17 @@ - (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 // ------------------------------------------------------------------------------- diff --git a/src/platform/DARWIN/AFSPreference/global.h b/src/platform/DARWIN/AFSPreference/global.h index 3a8d9bdb2..d695592fe 100644 --- a/src/platform/DARWIN/AFSPreference/global.h +++ b/src/platform/DARWIN/AFSPreference/global.h @@ -57,6 +57,8 @@ #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 -- 2.39.5