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
11 #include <afs/param.h>
16 #include "add_submount_dlg.h"
17 #include "submount_info.h"
24 static char THIS_FILE[] = __FILE__;
27 /////////////////////////////////////////////////////////////////////////////
28 // CAddSubmtDlg dialog
31 CAddSubmtDlg::CAddSubmtDlg(CWnd* pParent /*=NULL*/)
34 InitModalIndirect (TaLocale_GetDialogResource (CAddSubmtDlg::IDD), pParent);
36 //{{AFX_DATA_INIT(CAddSubmtDlg)
37 m_strShareName = _T("");
38 m_strPathName = _T("");
46 void CAddSubmtDlg::DoDataExchange(CDataExchange* pDX)
48 CDialog::DoDataExchange(pDX);
49 //{{AFX_DATA_MAP(CAddSubmtDlg)
50 DDX_Control(pDX, IDOK, m_Ok);
51 DDX_Text(pDX, IDC_SHARE_NAME, m_strShareName);
52 DDX_Text(pDX, IDC_PATH_NAME, m_strPathName);
57 BEGIN_MESSAGE_MAP(CAddSubmtDlg, CDialog)
58 //{{AFX_MSG_MAP(CAddSubmtDlg)
59 ON_EN_CHANGE(IDC_SHARE_NAME, OnChangeShareName)
60 ON_EN_CHANGE(IDC_PATH_NAME, OnChangePathName)
61 ON_BN_CLICKED(IDHELP, OnHelp)
65 /////////////////////////////////////////////////////////////////////////////
66 // CAddSubmtDlg message handlers
68 BOOL CAddSubmtDlg::OnInitDialog()
70 CDialog::OnInitDialog();
73 SetWindowText(GetMessageString(IDS_EDIT_PATH_NAME));
74 ((CEdit *)GetDlgItem(IDC_SHARE_NAME))->EnableWindow(FALSE);
77 return TRUE; // return TRUE unless you set the focus to a control
78 // EXCEPTION: OCX Property Pages should return FALSE
81 void CAddSubmtDlg::CheckEnableOk()
85 m_Ok.EnableWindow(!m_strShareName.IsEmpty() && !m_strPathName.IsEmpty());
88 void CAddSubmtDlg::OnChangeShareName()
93 void CAddSubmtDlg::OnChangePathName()
98 void CAddSubmtDlg::OnOK()
107 void CAddSubmtDlg::SetSubmtInfo(CSubmountInfo *pInfo)
111 m_strShareName = pInfo->GetShareName();
112 m_strPathName = pInfo->GetPathName();
115 CSubmountInfo *CAddSubmtDlg::GetSubmtInfo()
120 SUBMT_INFO_STATUS status;
125 status = SIS_CHANGED;
127 return new CSubmountInfo(m_strShareName, m_strPathName, status);
130 void CAddSubmtDlg::OnHelp()
132 ShowHelp(m_hWnd, (m_bAdd ? ADD_SUBMT_HELP_ID : EDIT_PATH_NAME_HELP_ID));