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 NSButton *backgrounderActivationCheck;
50 IBOutlet NSBox *groupsBox;
52 //id installationPathTextField;
55 //id cellNameTextEdit;
59 //id refreshConfigurationButton;
60 id saveConfigurationButton;
66 id ipConfigurationSheet;
67 id ipConfControllerCommander;
71 id credentialCommander;
80 IBOutlet LynkCreationController *lynkCreationController;
83 IBOutlet NSButton *checkEnableLink;
84 IBOutlet NSButton *buttonAddLink;
85 IBOutlet NSButton *buttonRemoveLink;
88 AFSPropertyManager *afsProperty; //AFS Property managment class
89 NSMutableArray *filteredCellDB; //Filtered CellServDB
91 NSTimer *timerForCheckTokensList;
95 - (void) mainViewDidLoad;
96 - (void) willUnselect;
98 - (id) initWithBundle:(NSBundle *)bundle;
102 - (IBAction) refreshConfiguration:(id) sender;
103 - (void) fillCacheParamView;
104 - (void) updateCacheParamFromView;
105 - (IBAction) showCellIP:(id) sender;
106 - (IBAction) addRemoveCell:(id) sender;
107 - (IBAction) addLink:(id) sender;
108 - (IBAction) removeLink:(id) sender;
109 - (IBAction) enableLink:(id) sender;
110 - (IBAction) saveConfiguration:(id) sender;
111 - (IBAction) saveCacheManagerParam:(id) sender;
112 - (IBAction) startStopAfs:(id) sender;
113 - (IBAction) info:(id) sender;
114 - (IBAction) tableDoubleAction:(id) sender;
115 - (IBAction) getNewToken:(id) sender;
116 - (IBAction) unlog:(id) sender;
117 - (IBAction) afsMenuActivationEvent:(id) sender;
118 - (IBAction) aklogSwitchEvent:(id) sender;
119 - (IBAction) credentialAtLoginTimeEvent:(id) sender;
120 - (IBAction) afsStartupSwitchEvent:(id) sender;
121 - (IBAction) krb5KredentialAtLoginTimeEvent:(id) sender;
122 - (IBAction) searchCellTextEvent:(id) sender;
123 - (IBAction) manageBackgrounderActivation:(id)sender;
124 - (void) credentialAtLoginTimeEventCreationLaunchAgentDir:(NSWindow*)alert returnCode:(int)returnCode contextInfo:(void *)contextInfo;
125 - (void) clearCellServDBFiltering;
126 - (void) filterCellServDB:(NSString*)textToFilter;
127 - (DBCellElement*) getCurrentCellInDB;
128 - (DBCellElement*) getCellByIDX:(int) idx;
129 - (void) modifyCell:(DBCellElement*) cellElement;
130 - (void) modifyCellByIDX:(int) idx;
131 - (void) showMessage:(NSString*) message;
132 - (void) manageButtonState:(int) rowSelected;
133 - (void) setAfsStatus;
134 - (void) refreshTokens:(NSTimer*)theTimer;
135 - (void) repairHelperTool;
136 - (void) writePreferenceFile;
137 - (void) readPreferenceFile;
138 - (void) refreshGui:(NSNotification *)notification;
139 - (void) refreshTokensNotify:(NSNotification*)notification;
140 - (void) afsVolumeMountChange:(NSNotification *)notification;
141 - (void)tabView:(NSTabView *)tabView willSelectTabViewItem: (NSTabViewItem *)tabViewItem;
144 @interface AFSCommanderPref (NSTableDataSource)
145 - (id) getTableTokensListValue:(int) colId row:(int)row;
146 - (id) getTableCelListValue:(int) colId row:(int)row;