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
15 #include <afs/param.h>
19 #include "add_submount_dlg.h"
20 #include "submount_info.h"
27 static char THIS_FILE
[] = __FILE__
;
30 /////////////////////////////////////////////////////////////////////////////
31 // CAddSubmtDlg dialog
34 CAddSubmtDlg::CAddSubmtDlg(CWnd
* pParent
/*=NULL*/)
37 InitModalIndirect (TaLocale_GetDialogResource (CAddSubmtDlg::IDD
), pParent
);
39 //{{AFX_DATA_INIT(CAddSubmtDlg)
40 m_strShareName
= _T("");
41 m_strPathName
= _T("");
49 void CAddSubmtDlg::DoDataExchange(CDataExchange
* pDX
)
51 CDialog::DoDataExchange(pDX
);
52 //{{AFX_DATA_MAP(CAddSubmtDlg)
53 DDX_Control(pDX
, IDOK
, m_Ok
);
54 DDX_Text(pDX
, IDC_SHARE_NAME
, m_strShareName
);
55 DDX_Text(pDX
, IDC_PATH_NAME
, m_strPathName
);
60 BEGIN_MESSAGE_MAP(CAddSubmtDlg
, CDialog
)
61 //{{AFX_MSG_MAP(CAddSubmtDlg)
62 ON_EN_CHANGE(IDC_SHARE_NAME
, OnChangeShareName
)
63 ON_EN_CHANGE(IDC_PATH_NAME
, OnChangePathName
)
64 ON_BN_CLICKED(IDHELP
, OnHelp
)
68 /////////////////////////////////////////////////////////////////////////////
69 // CAddSubmtDlg message handlers
71 BOOL
CAddSubmtDlg::OnInitDialog()
73 CDialog::OnInitDialog();
76 SetWindowText(GetMessageString(IDS_EDIT_PATH_NAME
));
77 ((CEdit
*)GetDlgItem(IDC_SHARE_NAME
))->EnableWindow(FALSE
);
80 return TRUE
; // return TRUE unless you set the focus to a control
81 // EXCEPTION: OCX Property Pages should return FALSE
84 void CAddSubmtDlg::CheckEnableOk()
88 m_Ok
.EnableWindow(!m_strShareName
.IsEmpty() && !m_strPathName
.IsEmpty());
91 void CAddSubmtDlg::OnChangeShareName()
96 void CAddSubmtDlg::OnChangePathName()
101 void CAddSubmtDlg::OnOK()
110 void CAddSubmtDlg::SetSubmtInfo(CSubmountInfo
*pInfo
)
114 m_strShareName
= pInfo
->GetShareName();
115 m_strPathName
= pInfo
->GetPathName();
118 CSubmountInfo
*CAddSubmtDlg::GetSubmtInfo()
123 SUBMT_INFO_STATUS status
;
128 status
= SIS_CHANGED
;
130 return new CSubmountInfo(m_strShareName
, m_strPathName
, status
);
133 void CAddSubmtDlg::OnHelp()
135 ShowHelp(m_hWnd
, (m_bAdd
? ADD_SUBMT_HELP_ID
: EDIT_PATH_NAME_HELP_ID
));