Don't enable fields when archive is read-only

"Edit attributes" on a read-only archive was enabling the file and
aux type fields inappropriately as part of the ProDOS vs. HFS file
type handling.
This commit is contained in:
Andy McFadden 2015-01-11 15:50:55 -08:00
parent 900b4c7757
commit 0d5bfa593f

View File

@ -306,7 +306,7 @@ void EditPropsDialog::DoDataExchange(CDataExchange* pDX)
DDX_Text(pDX, IDC_PROPS_HFS_FILETYPE, tmpStr); DDX_Text(pDX, IDC_PROPS_HFS_FILETYPE, tmpStr);
tmpStr = creator; tmpStr = creator;
DDX_Text(pDX, IDC_PROPS_HFS_AUXTYPE, tmpStr); DDX_Text(pDX, IDC_PROPS_HFS_AUXTYPE, tmpStr);
tmpStr = "0000"; tmpStr = L"0000";
DDX_Text(pDX, IDC_PROPS_AUXTYPE, tmpStr); DDX_Text(pDX, IDC_PROPS_AUXTYPE, tmpStr);
CButton* pButton = (CButton*) GetDlgItem(IDC_PROPS_HFS_MODE); CButton* pButton = (CButton*) GetDlgItem(IDC_PROPS_HFS_MODE);
@ -381,12 +381,14 @@ void EditPropsDialog::UpdateHFSMode(void)
LOGI("Switching to HFS mode"); LOGI("Switching to HFS mode");
//fHFSMode = true; //fHFSMode = true;
pWnd = GetDlgItem(IDC_PROPS_HFS_FILETYPE); if (!fReadOnly) {
pWnd->EnableWindow(TRUE); pWnd = GetDlgItem(IDC_PROPS_HFS_FILETYPE);
pWnd = GetDlgItem(IDC_PROPS_HFS_AUXTYPE); pWnd->EnableWindow(TRUE);
pWnd->EnableWindow(TRUE); pWnd = GetDlgItem(IDC_PROPS_HFS_AUXTYPE);
pWnd = GetDlgItem(IDC_PROPS_HFS_LABEL); pWnd->EnableWindow(TRUE);
pWnd->EnableWindow(TRUE); pWnd = GetDlgItem(IDC_PROPS_HFS_LABEL);
pWnd->EnableWindow(TRUE);
}
/* point the file type at something safe */ /* point the file type at something safe */
pCombo = (CComboBox*) GetDlgItem(IDC_PROPS_FILETYPE); pCombo = (CComboBox*) GetDlgItem(IDC_PROPS_FILETYPE);
@ -403,10 +405,12 @@ void EditPropsDialog::UpdateHFSMode(void)
/* switch to ProDOS mode */ /* switch to ProDOS mode */
LOGI("Switching to ProDOS mode"); LOGI("Switching to ProDOS mode");
//fHFSMode = false; //fHFSMode = false;
pCombo = (CComboBox*) GetDlgItem(IDC_PROPS_FILETYPE); if (!fReadOnly) {
pCombo->EnableWindow(TRUE); pCombo = (CComboBox*) GetDlgItem(IDC_PROPS_FILETYPE);
pWnd = GetDlgItem(IDC_PROPS_AUXTYPE); pCombo->EnableWindow(TRUE);
pWnd->EnableWindow(TRUE); pWnd = GetDlgItem(IDC_PROPS_AUXTYPE);
pWnd->EnableWindow(TRUE);
}
pWnd = GetDlgItem(IDC_PROPS_HFS_FILETYPE); pWnd = GetDlgItem(IDC_PROPS_HFS_FILETYPE);
pWnd->EnableWindow(FALSE); pWnd->EnableWindow(FALSE);