This is Panels.m in view mode; [Download] [Up]
/* SambaManger. A graphical frontend to configure the NetInfo enhanced samba. Copyright (C) 1998 Robert Frank This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Robert Frank, frank@ifi.unibas.ch */ #import "Panels.h" static Panels *panelInstance = nil; @implementation Panels + initialize // Called once by the run time system { if (panelInstance == nil) { self = panelInstance = [Panels alloc]; [super init]; if (![NXApp loadNibSection:"Panels.nib" owner:self]) return [super free]; } return panelInstance; } + new { return panelInstance; } // ************************************************************************ // Actions for/from the select user or group panel - (int)userOrGroup { int exitCode = [NXApp runModalFor:panelUserGroup]; [panelUserGroup close]; if (exitCode == NX_RUNABORTED) return PS_NONE; return exitCode; } - (int)netgroupOrHost { int exitCode = [NXApp runModalFor:panelNetgroupHost]; [panelNetgroupHost close]; if (exitCode == NX_RUNABORTED) return PS_NONE; return exitCode; } - userOrGroupCancel:sender { [NXApp abortModal]; return self; } - userOrGroupGroup:sender { [NXApp stopModal:PS_GROUP]; return self; } - userOrGroupUser:sender { [NXApp stopModal:PS_USER]; return self; } // ************************************************************************ // Actions for/from the select service panel - (int)selectService { int exitCode = [NXApp runModalFor:panelServices]; [panelServices close]; if (exitCode == NX_RUNSTOPPED) return [[buttonChoice target] indexOfItem:[buttonChoice title]]; return -1; } - serviceCreate:sender { [NXApp stopModal]; return self; } - serviceCancel:sender { [NXApp abortModal]; return self; } // ************************************************************************ // Actions for/from the browser/netgroups panel - (const char *)showNetgroups:(ni_namelist *)netgroupList { int exitCode; [browser setDelegate:self]; [browser setTarget:self]; [browser setDoubleAction:@selector(serviceCreate:)]; values = netgroupList; [browser loadColumnZero]; exitCode = [NXApp runModalFor:panelBroswer]; [panelBroswer close]; if (exitCode == NX_RUNSTOPPED) return [[browser selectedCell] stringValue]; return NULL; } // The browser delegate: - (int)browser:sender fillMatrix:matrix inColumn:(int)column { int i = 0; id cell; if (values->ni_namelist_len) for (i = 0; i < values->ni_namelist_len; i++) { [matrix addRow]; cell = [matrix cellAt:i :0]; [cell setStringValue:values->ni_namelist_val[i]]; [cell setLoaded:YES]; [cell setLeaf:YES]; } return i; } @end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.