5 // Created by Claudio Bisegni on 10/05/07.
6 // Copyright (c) 2007 INFN - National Institute of Nuclear Physics. All rights reserved.
9 #import <PreferencePanes/PreferencePanes.h>
10 #import "AFSPropertyManager.h"
12 #import "ViewUtility.h"
13 #import "LynkCreationController.h"
15 // the way to load and unload the menuextra was inspired by MenuMeters developed by Alex Harper
16 // Routines to handle adding and remove menu extras in HIServices (from ASM source)
17 int CoreMenuExtraGetMenuExtra(CFStringRef identifier, void *menuExtra);
18 int CoreMenuExtraAddMenuExtra(CFURLRef path, int position, int whoCares, int whoCares2, int whoCares3, int whoCares4);
19 int CoreMenuExtraRemoveMenuExtra(void *menuExtra, int whoCares);
23 @interface AFSCommanderPref : NSPreferencePane
25 //for check system version
29 IBOutlet NSView *afsCommanderView;
30 IBOutlet NSSearchField *textSearchField;
31 IBOutlet NSTextField *afsDefaultCellLabel;
32 IBOutlet NSButton *tokensButton;
33 IBOutlet NSButton *unlogButton;
34 IBOutlet NSButton *aklogCredentialAtLoginTime;
35 IBOutlet NSButton *installKRB5AuthAtLoginButton;
36 IBOutlet NSButton *useAklogCheck;
37 IBOutlet NSTextField *afsVersionLabel;
38 IBOutlet NSButton *checkButtonAfsAtBootTime;
39 IBOutlet NSTextField *textFieldDevInfoLabel;
40 IBOutlet NSTextField *statCacheEntry;
41 IBOutlet NSTextField *dCacheDim;
42 IBOutlet NSTextField *cacheDimension;
43 IBOutlet NSTextField *daemonNumber;
44 IBOutlet NSTextField *afsRootMountPoint;
45 IBOutlet NSTextField *nVolEntry;
46 IBOutlet NSButton *dynRoot;
47 IBOutlet NSButton *afsDB;
48 IBOutlet NSButton *verbose;
49 IBOutlet NSBox *groupsBox;
51 //id installationPathTextField;
54 //id cellNameTextEdit;
58 //id refreshConfigurationButton;
59 id saveConfigurationButton;
65 id ipConfigurationSheet;
66 id ipConfControllerCommander;
70 id credentialCommander;
79 IBOutlet LynkCreationController *lynkCreationController;
82 IBOutlet NSButton *checkEnableLink;
83 IBOutlet NSButton *buttonAddLink;
84 IBOutlet NSButton *buttonRemoveLink;
87 AFSPropertyManager *afsProperty; //AFS Property managment class
88 NSMutableArray *filteredCellDB; //Filtered CellServDB
90 NSTimer *timerForCheckTokensList;
94 - (void) mainViewDidLoad;
95 - (void) willUnselect;
97 - (id) initWithBundle:(NSBundle *)bundle;
101 - (IBAction) refreshConfiguration:(id) sender;
102 - (void) fillCacheParamView;
103 - (void) updateCacheParamFromView;
104 - (IBAction) showCellIP:(id) sender;
105 - (IBAction) addRemoveCell:(id) sender;
106 - (IBAction) addLink:(id) sender;
107 - (IBAction) removeLink:(id) sender;
108 - (IBAction) enableLink:(id) sender;
109 - (IBAction) saveConfiguration:(id) sender;
110 - (IBAction) saveCacheManagerParam:(id) sender;
111 - (IBAction) startStopAfs:(id) sender;
112 - (IBAction) info:(id) sender;
113 - (IBAction) tableDoubleAction:(id) sender;
114 - (IBAction) getNewToken:(id) sender;
115 - (IBAction) unlog:(id) sender;
116 - (IBAction) afsMenuActivationEvent:(id) sender;
117 - (IBAction) aklogSwitchEvent:(id) sender;
118 - (IBAction) credentialAtLoginTimeEvent:(id) sender;
119 - (IBAction) afsStartupSwitchEvent:(id) sender;
120 - (void) credentialAtLoginTimeEventCreationLaunchAgentDir:(NSWindow*)alert returnCode:(int)returnCode contextInfo:(void *)contextInfo;
121 - (IBAction) krb5KredentialAtLoginTimeEvent:(id) sender;
122 - (IBAction) searchCellTextEvent:(id) sender;
123 - (void) clearCellServDBFiltering;
124 - (void) filterCellServDB:(NSString*)textToFilter;
125 - (DBCellElement*) getCurrentCellInDB;
126 - (DBCellElement*) getCellByIDX:(int) idx;
127 - (void) modifyCell:(DBCellElement*) cellElement;
128 - (void) modifyCellByIDX:(int) idx;
129 - (void) showMessage:(NSString*) message;
130 - (void) manageButtonState:(int) rowSelected;
131 - (void) setAfsStatus;
132 - (void) refreshTokens:(NSTimer*)theTimer;
133 - (void) repairHelperTool;
134 - (void) writePreferenceFile;
135 - (void) readPreferenceFile;
136 - (void) refreshGui:(NSNotification *)notification;
137 - (void) afsVolumeMountChange:(NSNotification *)notification;
140 @interface AFSCommanderPref (NSTableDataSource)
141 - (id) getTableTokensListValue:(int) colId row:(int)row;
142 - (id) getTableCelListValue:(int) colId row:(int)row;