Update NEWS for 1.6.22
[pkg-k5-afs_openafs.git] / src / WINNT / client_exp / server_status_dlg.cpp
blob5a6d971aa8eac7180123f39dd3d09af3f8f2c476
1 /*
2 * Copyright 2000, International Business Machines Corporation and others.
3 * All Rights Reserved.
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
8 */
10 #include "stdafx.h"
11 #include <winsock2.h>
12 #include <ws2tcpip.h>
14 extern "C" {
15 #include <afs/param.h>
16 #include <afs/stds.h>
19 #include "server_status_dlg.h"
20 #include "gui2fs.h"
22 #ifdef _DEBUG
23 #define new DEBUG_NEW
24 #undef THIS_FILE
25 static char THIS_FILE[] = __FILE__;
26 #endif
29 /////////////////////////////////////////////////////////////////////////////
30 // CServerStatusDlg property Dlg
32 IMPLEMENT_DYNCREATE(CServerStatusDlg, CDialog)
34 CServerStatusDlg::CServerStatusDlg() : CDialog()
36 InitModalIndirect (TaLocale_GetDialogResource (CServerStatusDlg::IDD));
38 //{{AFX_DATA_INIT(CServerStatusDlg)
39 m_bFast = FALSE;
40 m_nCell = LOCAL_CELL;
41 //}}AFX_DATA_INIT
44 CServerStatusDlg::~CServerStatusDlg()
48 void CServerStatusDlg::DoDataExchange(CDataExchange* pDX)
50 CDialog::DoDataExchange(pDX);
51 //{{AFX_DATA_MAP(CServerStatusDlg)
52 DDX_Control(pDX, IDC_SHOWSTATUS, m_ShowStatus);
53 DDX_Control(pDX, IDC_CELL_NAME, m_CellName);
54 DDX_Check(pDX, IDC_DONTPROBESERVERS, m_bFast);
55 DDX_Radio(pDX, IDC_LOCALCELL, m_nCell);
56 //}}AFX_DATA_MAP
59 BEGIN_MESSAGE_MAP(CServerStatusDlg, CDialog)
60 //{{AFX_MSG_MAP(CServerStatusDlg)
61 ON_BN_CLICKED(IDC_SHOWSTATUS, OnShowStatus)
62 ON_BN_CLICKED(IDC_SPECIFIEDCELL, OnSpecifiedCell)
63 ON_BN_CLICKED(IDC_LOCALCELL, OnLocalCell)
64 ON_BN_CLICKED(IDC_ALL_CELLS, OnAllCells)
65 ON_EN_CHANGE(IDC_CELL_NAME, OnChangeCellName)
66 ON_BN_CLICKED(IDHELP, OnHelp)
67 //}}AFX_MSG_MAP
68 END_MESSAGE_MAP()
70 /////////////////////////////////////////////////////////////////////////////
71 // CServerStatusDlg message handlers
72 BOOL CServerStatusDlg::Save()
74 return FALSE;
77 BOOL CServerStatusDlg::OnInitDialog()
79 CDialog::OnInitDialog();
81 m_CellName.EnableWindow(FALSE);
82 m_nCell = LOCAL_CELL;
84 UpdateData(FALSE);
86 return TRUE; // return TRUE unless you set the focus to a control
87 // EXCEPTION: OCX Property Pages should return FALSE
90 void CServerStatusDlg::OnShowStatus()
92 UpdateData(TRUE);
94 CheckServers(GetCellNameText(), (WHICH_CELLS)m_nCell, m_bFast);
97 void CServerStatusDlg::OnSpecifiedCell()
99 m_nCell = SPECIFIC_CELL;
100 m_CellName.EnableWindow(TRUE);
101 CheckEnableShowStatus();
104 void CServerStatusDlg::OnLocalCell()
106 m_nCell = LOCAL_CELL;
107 m_CellName.EnableWindow(FALSE);
108 m_ShowStatus.EnableWindow(TRUE);
111 void CServerStatusDlg::OnAllCells()
113 m_nCell = ALL_CELLS;
114 m_CellName.EnableWindow(FALSE);
115 m_ShowStatus.EnableWindow(TRUE);
118 void CServerStatusDlg::CheckEnableShowStatus()
120 m_ShowStatus.EnableWindow(GetCellNameText().GetLength() > 0);
123 void CServerStatusDlg::OnChangeCellName()
125 CheckEnableShowStatus();
128 CString CServerStatusDlg::GetCellNameText()
130 CString strCellName;
132 m_CellName.GetWindowText(strCellName);
134 return strCellName;
137 void CServerStatusDlg::OnHelp()
139 ShowHelp(m_hWnd, SERVER_STATUS_HELP_ID);