2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
14 #include <afs/param.h>
23 * SERVER-VIEW COLUMNS ________________________________________________________
27 void Server_SetDefaultView_Horz (LPVIEWINFO lpviHorz
)
29 lpviHorz
->lvsView
= FLS_VIEW_LIST
;
30 lpviHorz
->nColsAvail
= nSERVERCOLUMNS
;
32 for (size_t iCol
= 0; iCol
< nSERVERCOLUMNS
; ++iCol
)
34 lpviHorz
->cxColumns
[ iCol
] = SERVERCOLUMNS
[ iCol
].cxWidth
;
35 lpviHorz
->idsColumns
[ iCol
] = SERVERCOLUMNS
[ iCol
].idsColumn
;
38 lpviHorz
->iSort
= svrcolNAME
;
40 lpviHorz
->nColsShown
= 3;
41 lpviHorz
->aColumns
[0] = (int)svrcolNAME
;
42 lpviHorz
->aColumns
[1] = (int)svrcolADDRESS
;
43 lpviHorz
->aColumns
[2] = (int)svrcolSTATUS
;
47 void Server_SetDefaultView_Vert (LPVIEWINFO lpviVert
)
49 lpviVert
->lvsView
= FLS_VIEW_LARGE
;
50 lpviVert
->nColsAvail
= nSERVERCOLUMNS
;
52 for (size_t iCol
= 0; iCol
< nSERVERCOLUMNS
; ++iCol
)
54 lpviVert
->cxColumns
[ iCol
] = SERVERCOLUMNS
[ iCol
].cxWidth
;
55 lpviVert
->idsColumns
[ iCol
] = SERVERCOLUMNS
[ iCol
].idsColumn
;
58 lpviVert
->iSort
= svrcolNAME
;
60 lpviVert
->nColsShown
= 3;
61 lpviVert
->aColumns
[0] = (int)svrcolNAME
;
62 lpviVert
->aColumns
[1] = (int)svrcolADDRESS
;
63 lpviVert
->aColumns
[2] = (int)svrcolSTATUS
;
68 * ROUTINES ___________________________________________________________________
72 size_t Server_GetAlertCount (LPSERVER lpServer
)
74 return Alert_GetCount (lpServer
->GetIdentifier());
78 LPTSTR
Server_GetColumnText (LPIDENT lpi
, SERVERCOLUMN svrcol
)
80 static TCHAR aszBuffer
[ nSERVERCOLUMNS
][ cchRESOURCE
];
81 static size_t iBufferNext
= 0;
82 LPTSTR pszBuffer
= aszBuffer
[ iBufferNext
++ ];
83 if (iBufferNext
== nSERVERCOLUMNS
)
85 *pszBuffer
= TEXT('\0');
87 LPSERVERSTATUS lpss
= NULL
;
89 if ((lpsp
= (LPSERVER_PREF
)lpi
->GetUserParam()) != NULL
)
97 lpi
->GetServerName (pszBuffer
);
102 FormatSockAddr (pszBuffer
, TEXT("%a"), &lpss
->aAddresses
[0]);
108 if ((pszDesc
= Alert_GetQuickDescription (lpi
)) == NULL
)
109 GetString (pszBuffer
, IDS_STATUS_NOALERTS
);
112 lstrcpy (pszBuffer
, pszDesc
);
113 FreeString (pszDesc
);