Add CheckedLoadString
The static analyzer was annoyed that the return value from calls to CString::LoadString() was being ignored. This adds a wrapper function that checks the value and logs a failure message if the string can't be found.
This commit is contained in:
parent
9a7283fa49
commit
d42b9c6dc0
|
@ -763,7 +763,7 @@ bool AcuArchive::TestSelection(CWnd* pMsgWnd, SelectionSet* pSelSet)
|
||||||
if (nerr != kNuErrNone) {
|
if (nerr != kNuErrNone) {
|
||||||
if (nerr == kNuErrAborted) {
|
if (nerr == kNuErrAborted) {
|
||||||
CString title;
|
CString title;
|
||||||
title.LoadString(IDS_MB_APP_NAME);
|
CheckedLoadString(&title, IDS_MB_APP_NAME);
|
||||||
errMsg = "Cancelled.";
|
errMsg = "Cancelled.";
|
||||||
pMsgWnd->MessageBox(errMsg, title, MB_OK);
|
pMsgWnd->MessageBox(errMsg, title, MB_OK);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -87,7 +87,7 @@ BOOL AboutDialog::OnInitDialog(void)
|
||||||
pStatic->GetWindowText(tmpStr);
|
pStatic->GetWindowText(tmpStr);
|
||||||
newVersion.Format(tmpStr, versionStr);
|
newVersion.Format(tmpStr, versionStr);
|
||||||
} else {
|
} else {
|
||||||
newVersion.LoadString(IDS_ASPI_NOT_LOADED);
|
CheckedLoadString(&newVersion, IDS_ASPI_NOT_LOADED);
|
||||||
}
|
}
|
||||||
pStatic->SetWindowText(newVersion);
|
pStatic->SetWindowText(newVersion);
|
||||||
|
|
||||||
|
|
|
@ -41,12 +41,12 @@ BOOL ActionProgressDialog::OnInitDialog(void)
|
||||||
CString tmpStr;
|
CString tmpStr;
|
||||||
pWnd = GetDlgItem(IDC_PROG_VERB);
|
pWnd = GetDlgItem(IDC_PROG_VERB);
|
||||||
ASSERT(pWnd != NULL);
|
ASSERT(pWnd != NULL);
|
||||||
tmpStr.LoadString(IDS_NOW_EXPANDING);
|
CheckedLoadString(&tmpStr, IDS_NOW_EXPANDING);
|
||||||
pWnd->SetWindowText(tmpStr);
|
pWnd->SetWindowText(tmpStr);
|
||||||
|
|
||||||
pWnd = GetDlgItem(IDC_PROG_TOFROM);
|
pWnd = GetDlgItem(IDC_PROG_TOFROM);
|
||||||
ASSERT(pWnd != NULL);
|
ASSERT(pWnd != NULL);
|
||||||
tmpStr.LoadString(IDS_NOW_COMPRESSING);
|
CheckedLoadString(&tmpStr, IDS_NOW_COMPRESSING);
|
||||||
pWnd->SetWindowText(tmpStr);
|
pWnd->SetWindowText(tmpStr);
|
||||||
} else if (fAction == kActionAdd || fAction == kActionAddDisk ||
|
} else if (fAction == kActionAdd || fAction == kActionAddDisk ||
|
||||||
fAction == kActionConvFile || fAction == kActionConvDisk)
|
fAction == kActionConvFile || fAction == kActionConvDisk)
|
||||||
|
@ -54,18 +54,18 @@ BOOL ActionProgressDialog::OnInitDialog(void)
|
||||||
CString tmpStr;
|
CString tmpStr;
|
||||||
pWnd = GetDlgItem(IDC_PROG_VERB);
|
pWnd = GetDlgItem(IDC_PROG_VERB);
|
||||||
ASSERT(pWnd != NULL);
|
ASSERT(pWnd != NULL);
|
||||||
tmpStr.LoadString(IDS_NOW_ADDING);
|
CheckedLoadString(&tmpStr, IDS_NOW_ADDING);
|
||||||
pWnd->SetWindowText(tmpStr);
|
pWnd->SetWindowText(tmpStr);
|
||||||
|
|
||||||
pWnd = GetDlgItem(IDC_PROG_TOFROM);
|
pWnd = GetDlgItem(IDC_PROG_TOFROM);
|
||||||
ASSERT(pWnd != NULL);
|
ASSERT(pWnd != NULL);
|
||||||
tmpStr.LoadString(IDS_ADDING_AS);
|
CheckedLoadString(&tmpStr, IDS_ADDING_AS);
|
||||||
pWnd->SetWindowText(tmpStr);
|
pWnd->SetWindowText(tmpStr);
|
||||||
} else if (fAction == kActionDelete) {
|
} else if (fAction == kActionDelete) {
|
||||||
CString tmpStr;
|
CString tmpStr;
|
||||||
pWnd = GetDlgItem(IDC_PROG_VERB);
|
pWnd = GetDlgItem(IDC_PROG_VERB);
|
||||||
ASSERT(pWnd != NULL);
|
ASSERT(pWnd != NULL);
|
||||||
tmpStr.LoadString(IDS_NOW_DELETING);
|
CheckedLoadString(&tmpStr, IDS_NOW_DELETING);
|
||||||
pWnd->SetWindowText(tmpStr);
|
pWnd->SetWindowText(tmpStr);
|
||||||
|
|
||||||
pWnd = GetDlgItem(IDC_PROG_TOFROM);
|
pWnd = GetDlgItem(IDC_PROG_TOFROM);
|
||||||
|
@ -77,7 +77,7 @@ BOOL ActionProgressDialog::OnInitDialog(void)
|
||||||
CString tmpStr;
|
CString tmpStr;
|
||||||
pWnd = GetDlgItem(IDC_PROG_VERB);
|
pWnd = GetDlgItem(IDC_PROG_VERB);
|
||||||
ASSERT(pWnd != NULL);
|
ASSERT(pWnd != NULL);
|
||||||
tmpStr.LoadString(IDS_NOW_TESTING);
|
CheckedLoadString(&tmpStr, IDS_NOW_TESTING);
|
||||||
pWnd->SetWindowText(tmpStr);
|
pWnd->SetWindowText(tmpStr);
|
||||||
|
|
||||||
pWnd = GetDlgItem(IDC_PROG_TOFROM);
|
pWnd = GetDlgItem(IDC_PROG_TOFROM);
|
||||||
|
|
|
@ -305,7 +305,7 @@ void MainWindow::OnActionsAddDisks(void)
|
||||||
|
|
||||||
LOGI("Add disks!");
|
LOGI("Add disks!");
|
||||||
|
|
||||||
failed.LoadString(IDS_FAILED);
|
CheckedLoadString(&failed, IDS_FAILED);
|
||||||
|
|
||||||
openFilters = kOpenDiskImage;
|
openFilters = kOpenDiskImage;
|
||||||
openFilters += kOpenAll;
|
openFilters += kOpenAll;
|
||||||
|
@ -763,7 +763,7 @@ bool MainWindow::ExtractEntry(GenericEntry* pEntry, int thread,
|
||||||
ReformatHolder holder;
|
ReformatHolder holder;
|
||||||
CString outputPath;
|
CString outputPath;
|
||||||
CString failed, errMsg;
|
CString failed, errMsg;
|
||||||
failed.LoadString(IDS_FAILED);
|
CheckedLoadString(&failed, IDS_FAILED);
|
||||||
bool writeFailed = false;
|
bool writeFailed = false;
|
||||||
bool extractAs2MG = false;
|
bool extractAs2MG = false;
|
||||||
char* reformatText = NULL;
|
char* reformatText = NULL;
|
||||||
|
@ -1154,7 +1154,7 @@ bool MainWindow::ExtractEntry(GenericEntry* pEntry, int thread,
|
||||||
if (result != IDOK) {
|
if (result != IDOK) {
|
||||||
if (result == IDCANCEL) {
|
if (result == IDCANCEL) {
|
||||||
CString msg;
|
CString msg;
|
||||||
msg.LoadString(IDS_OPERATION_CANCELLED);
|
CheckedLoadString(&msg, IDS_OPERATION_CANCELLED);
|
||||||
fpActionProgress->MessageBox(msg,
|
fpActionProgress->MessageBox(msg,
|
||||||
L"CiderPress", MB_OK | MB_ICONEXCLAMATION);
|
L"CiderPress", MB_OK | MB_ICONEXCLAMATION);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1198,7 +1198,7 @@ int MainWindow::OpenOutputFile(CString* pOutputPath, const PathProposal& pathPro
|
||||||
CString msg;
|
CString msg;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
|
||||||
failed.LoadString(IDS_FAILED);
|
CheckedLoadString(&failed, IDS_FAILED);
|
||||||
|
|
||||||
*pFp = NULL;
|
*pFp = NULL;
|
||||||
|
|
||||||
|
@ -1441,7 +1441,7 @@ void MainWindow::OnActionsDelete(void)
|
||||||
|
|
||||||
CString appName, msg;
|
CString appName, msg;
|
||||||
|
|
||||||
appName.LoadString(IDS_MB_APP_NAME);
|
CheckedLoadString(&appName, IDS_MB_APP_NAME);
|
||||||
msg.Format(L"Delete %d file%ls?", selSet.GetNumEntries(),
|
msg.Format(L"Delete %d file%ls?", selSet.GetNumEntries(),
|
||||||
selSet.GetNumEntries() == 1 ? L"" : L"s");
|
selSet.GetNumEntries() == 1 ? L"" : L"s");
|
||||||
if (MessageBox(msg, appName, MB_OKCANCEL | MB_ICONQUESTION) != IDOK)
|
if (MessageBox(msg, appName, MB_OKCANCEL | MB_ICONQUESTION) != IDOK)
|
||||||
|
@ -1541,8 +1541,8 @@ void MainWindow::OnActionsEditComment(void)
|
||||||
CString question, title;
|
CString question, title;
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
question.LoadString(IDS_NO_COMMENT_ADD);
|
CheckedLoadString(&question, IDS_NO_COMMENT_ADD);
|
||||||
title.LoadString(IDS_EDIT_COMMENT);
|
CheckedLoadString(&title, IDS_EDIT_COMMENT);
|
||||||
result = MessageBox(question, title, MB_OKCANCEL | MB_ICONQUESTION);
|
result = MessageBox(question, title, MB_OKCANCEL | MB_ICONQUESTION);
|
||||||
if (result == IDCANCEL)
|
if (result == IDCANCEL)
|
||||||
return;
|
return;
|
||||||
|
@ -1753,7 +1753,7 @@ void MainWindow::OnActionsRecompress(void)
|
||||||
CalcTotalSize(&afterUncomp, &afterComp);
|
CalcTotalSize(&afterUncomp, &afterComp);
|
||||||
ASSERT(beforeUncomp == afterUncomp);
|
ASSERT(beforeUncomp == afterUncomp);
|
||||||
|
|
||||||
appName.LoadString(IDS_MB_APP_NAME);
|
CheckedLoadString(&appName, IDS_MB_APP_NAME);
|
||||||
msg.Format(L"Total uncompressed size of all files:\t%.1fK\r\n"
|
msg.Format(L"Total uncompressed size of all files:\t%.1fK\r\n"
|
||||||
L"Total size before recompress:\t\t%.1fK\r\n"
|
L"Total size before recompress:\t\t%.1fK\r\n"
|
||||||
L"Total size after recompress:\t\t%.1fK\r\n"
|
L"Total size after recompress:\t\t%.1fK\r\n"
|
||||||
|
|
|
@ -862,7 +862,7 @@ bool BnyArchive::TestSelection(CWnd* pMsgWnd, SelectionSet* pSelSet)
|
||||||
if (nerr != kNuErrNone) {
|
if (nerr != kNuErrNone) {
|
||||||
if (nerr == kNuErrAborted) {
|
if (nerr == kNuErrAborted) {
|
||||||
CString title;
|
CString title;
|
||||||
title.LoadString(IDS_MB_APP_NAME);
|
CheckedLoadString(&title, IDS_MB_APP_NAME);
|
||||||
errMsg = "Cancelled.";
|
errMsg = "Cancelled.";
|
||||||
pMsgWnd->MessageBox(errMsg, title, MB_OK);
|
pMsgWnd->MessageBox(errMsg, title, MB_OK);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -607,7 +607,7 @@ void ImportBASDialog::OnOK(void)
|
||||||
pEdit->GetWindowText(fileName);
|
pEdit->GetWindowText(fileName);
|
||||||
if (fileName.IsEmpty()) {
|
if (fileName.IsEmpty()) {
|
||||||
CString appName;
|
CString appName;
|
||||||
appName.LoadString(IDS_MB_APP_NAME);
|
CheckedLoadString(&appName, IDS_MB_APP_NAME);
|
||||||
|
|
||||||
MessageBox(L"You must specify a filename.",
|
MessageBox(L"You must specify a filename.",
|
||||||
appName, MB_OK);
|
appName, MB_OK);
|
||||||
|
|
|
@ -48,7 +48,7 @@ void CassImpTargetDialog::DoDataExchange(CDataExchange* pDX)
|
||||||
|
|
||||||
if (pDX->m_bSaveAndValidate) {
|
if (pDX->m_bSaveAndValidate) {
|
||||||
CString appName;
|
CString appName;
|
||||||
appName.LoadString(IDS_MB_APP_NAME);
|
CheckedLoadString(&appName, IDS_MB_APP_NAME);
|
||||||
|
|
||||||
if (fFileTypeIndex == kTypeBIN) {
|
if (fFileTypeIndex == kTypeBIN) {
|
||||||
if (GetStartAddr() < 0) {
|
if (GetStartAddr() < 0) {
|
||||||
|
|
|
@ -55,7 +55,7 @@ void ChooseAddTargetDialog::DoDataExchange(CDataExchange* pDX)
|
||||||
if (pDX->m_bSaveAndValidate) {
|
if (pDX->m_bSaveAndValidate) {
|
||||||
CTreeCtrl* pTree = (CTreeCtrl*) GetDlgItem(IDC_ADD_TARGET_TREE);
|
CTreeCtrl* pTree = (CTreeCtrl*) GetDlgItem(IDC_ADD_TARGET_TREE);
|
||||||
CString errMsg, appName;
|
CString errMsg, appName;
|
||||||
appName.LoadString(IDS_MB_APP_NAME);
|
CheckedLoadString(&appName, IDS_MB_APP_NAME);
|
||||||
|
|
||||||
/* shortcut for simple disk images */
|
/* shortcut for simple disk images */
|
||||||
if (pTree->GetCount() == 1 && fpChosenDiskFS != NULL)
|
if (pTree->GetCount() == 1 && fpChosenDiskFS != NULL)
|
||||||
|
|
|
@ -109,7 +109,7 @@ void ChooseDirDialog::OnExpandTree(void)
|
||||||
fShellTree.TunnelTree(str, &msg);
|
fShellTree.TunnelTree(str, &msg);
|
||||||
if (!msg.IsEmpty()) {
|
if (!msg.IsEmpty()) {
|
||||||
CString failed;
|
CString failed;
|
||||||
failed.LoadString(IDS_FAILED);
|
CheckedLoadString(&failed, IDS_FAILED);
|
||||||
MessageBox(msg, failed, MB_OK | MB_ICONERROR);
|
MessageBox(msg, failed, MB_OK | MB_ICONERROR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,7 +112,7 @@ void MainWindow::OnEditCopy(void)
|
||||||
/* associate a number with the format name */
|
/* associate a number with the format name */
|
||||||
myFormat = RegisterClipboardFormat(kClipboardFmtName);
|
myFormat = RegisterClipboardFormat(kClipboardFmtName);
|
||||||
if (myFormat == 0) {
|
if (myFormat == 0) {
|
||||||
errStr.LoadString(IDS_CLIPBOARD_REGFAILED);
|
CheckedLoadString(&errStr, IDS_CLIPBOARD_REGFAILED);
|
||||||
ShowFailureMsg(this, errStr, IDS_FAILED);
|
ShowFailureMsg(this, errStr, IDS_FAILED);
|
||||||
goto bail;
|
goto bail;
|
||||||
}
|
}
|
||||||
|
@ -120,7 +120,7 @@ void MainWindow::OnEditCopy(void)
|
||||||
|
|
||||||
/* open & empty the clipboard, even if we fail later */
|
/* open & empty the clipboard, even if we fail later */
|
||||||
if (OpenClipboard() == false) {
|
if (OpenClipboard() == false) {
|
||||||
errStr.LoadString(IDS_CLIPBOARD_OPENFAILED);
|
CheckedLoadString(&errStr, IDS_CLIPBOARD_OPENFAILED);
|
||||||
ShowFailureMsg(this, errStr, IDS_FAILED);
|
ShowFailureMsg(this, errStr, IDS_FAILED);
|
||||||
goto bail;
|
goto bail;
|
||||||
}
|
}
|
||||||
|
@ -137,7 +137,7 @@ void MainWindow::OnEditCopy(void)
|
||||||
selSet.CreateFromSelection(fpContentList,
|
selSet.CreateFromSelection(fpContentList,
|
||||||
GenericEntry::kAnyThread | GenericEntry::kAllowDirectory);
|
GenericEntry::kAnyThread | GenericEntry::kAllowDirectory);
|
||||||
if (selSet.GetNumEntries() == 0) {
|
if (selSet.GetNumEntries() == 0) {
|
||||||
errStr.LoadString(IDS_CLIPBOARD_NOITEMS);
|
CheckedLoadString(&errStr, IDS_CLIPBOARD_NOITEMS);
|
||||||
MessageBox(errStr, L"No match", MB_OK | MB_ICONEXCLAMATION);
|
MessageBox(errStr, L"No match", MB_OK | MB_ICONEXCLAMATION);
|
||||||
goto bail;
|
goto bail;
|
||||||
}
|
}
|
||||||
|
@ -155,7 +155,7 @@ void MainWindow::OnEditCopy(void)
|
||||||
hGlobal = ::GlobalAlloc(GHND | GMEM_SHARE, neededLen);
|
hGlobal = ::GlobalAlloc(GHND | GMEM_SHARE, neededLen);
|
||||||
if (hGlobal == NULL) {
|
if (hGlobal == NULL) {
|
||||||
LOGI("Failed allocating %d bytes", neededLen);
|
LOGI("Failed allocating %d bytes", neededLen);
|
||||||
errStr.LoadString(IDS_CLIPBOARD_ALLOCFAILED);
|
CheckedLoadString(&errStr, IDS_CLIPBOARD_ALLOCFAILED);
|
||||||
ShowFailureMsg(this, errStr, IDS_FAILED);
|
ShowFailureMsg(this, errStr, IDS_FAILED);
|
||||||
goto bail;
|
goto bail;
|
||||||
}
|
}
|
||||||
|
@ -428,7 +428,7 @@ CString MainWindow::CopyToCollection(GenericEntry* pEntry, void** pBuf,
|
||||||
uint8_t* buf = (uint8_t*) *pBuf;
|
uint8_t* buf = (uint8_t*) *pBuf;
|
||||||
long remLen = *pBufLen;
|
long remLen = *pBufLen;
|
||||||
|
|
||||||
errStr.LoadString(IDS_CLIPBOARD_WRITEFAILURE);
|
CheckedLoadString(&errStr, IDS_CLIPBOARD_WRITEFAILURE);
|
||||||
|
|
||||||
if (pEntry->GetRecordKind() == GenericEntry::kRecordKindVolumeDir) {
|
if (pEntry->GetRecordKind() == GenericEntry::kRecordKindVolumeDir) {
|
||||||
LOGI("Not copying volume dir to collection");
|
LOGI("Not copying volume dir to collection");
|
||||||
|
@ -518,7 +518,7 @@ CString MainWindow::CopyToCollection(GenericEntry* pEntry, void** pBuf,
|
||||||
result = pEntry->ExtractThreadToBuffer(which, &bufCopy, &lenCopy,
|
result = pEntry->ExtractThreadToBuffer(which, &bufCopy, &lenCopy,
|
||||||
&extractErrStr);
|
&extractErrStr);
|
||||||
if (result == IDCANCEL) {
|
if (result == IDCANCEL) {
|
||||||
errStr.LoadString(IDS_CANCELLED);
|
CheckedLoadString(&errStr, IDS_CANCELLED);
|
||||||
return errStr;
|
return errStr;
|
||||||
} else if (result != IDOK) {
|
} else if (result != IDOK) {
|
||||||
LOGW("ExtractThreadToBuffer (data) failed: %ls",
|
LOGW("ExtractThreadToBuffer (data) failed: %ls",
|
||||||
|
@ -542,7 +542,7 @@ CString MainWindow::CopyToCollection(GenericEntry* pEntry, void** pBuf,
|
||||||
result = pEntry->ExtractThreadToBuffer(which, &bufCopy, &lenCopy,
|
result = pEntry->ExtractThreadToBuffer(which, &bufCopy, &lenCopy,
|
||||||
&extractErrStr);
|
&extractErrStr);
|
||||||
if (result == IDCANCEL) {
|
if (result == IDCANCEL) {
|
||||||
errStr.LoadString(IDS_CANCELLED);
|
CheckedLoadString(&errStr, IDS_CANCELLED);
|
||||||
return errStr;
|
return errStr;
|
||||||
} else if (result != IDOK) {
|
} else if (result != IDOK) {
|
||||||
LOGI("ExtractThreadToBuffer (rsrc) failed: %ls",
|
LOGI("ExtractThreadToBuffer (rsrc) failed: %ls",
|
||||||
|
@ -655,14 +655,14 @@ void MainWindow::DoPaste(bool pasteJunkPaths)
|
||||||
|
|
||||||
myFormat = RegisterClipboardFormat(kClipboardFmtName);
|
myFormat = RegisterClipboardFormat(kClipboardFmtName);
|
||||||
if (myFormat == 0) {
|
if (myFormat == 0) {
|
||||||
errStr.LoadString(IDS_CLIPBOARD_REGFAILED);
|
CheckedLoadString(&errStr, IDS_CLIPBOARD_REGFAILED);
|
||||||
ShowFailureMsg(this, errStr, IDS_FAILED);
|
ShowFailureMsg(this, errStr, IDS_FAILED);
|
||||||
goto bail;
|
goto bail;
|
||||||
}
|
}
|
||||||
LOGI("myFormat = %u", myFormat);
|
LOGI("myFormat = %u", myFormat);
|
||||||
|
|
||||||
if (OpenClipboard() == false) {
|
if (OpenClipboard() == false) {
|
||||||
errStr.LoadString(IDS_CLIPBOARD_OPENFAILED);
|
CheckedLoadString(&errStr, IDS_CLIPBOARD_OPENFAILED);
|
||||||
ShowFailureMsg(this, errStr, IDS_FAILED);
|
ShowFailureMsg(this, errStr, IDS_FAILED);
|
||||||
goto bail;;
|
goto bail;;
|
||||||
}
|
}
|
||||||
|
@ -686,7 +686,7 @@ void MainWindow::DoPaste(bool pasteJunkPaths)
|
||||||
|
|
||||||
/* impossible unless OnUpdateEditPaste was bypassed */
|
/* impossible unless OnUpdateEditPaste was bypassed */
|
||||||
if (!IsClipboardFormatAvailable(myFormat)) {
|
if (!IsClipboardFormatAvailable(myFormat)) {
|
||||||
errStr.LoadString(IDS_CLIPBOARD_NOTFOUND);
|
CheckedLoadString(&errStr, IDS_CLIPBOARD_NOTFOUND);
|
||||||
ShowFailureMsg(this, errStr, IDS_FAILED);
|
ShowFailureMsg(this, errStr, IDS_FAILED);
|
||||||
goto bail;
|
goto bail;
|
||||||
}
|
}
|
||||||
|
@ -730,7 +730,7 @@ CString MainWindow::ProcessClipboard(const void* vbuf, long bufLen,
|
||||||
bool xferPrepped = false;
|
bool xferPrepped = false;
|
||||||
|
|
||||||
/* set a standard error message */
|
/* set a standard error message */
|
||||||
errMsg.LoadString(IDS_CLIPBOARD_READFAILURE);
|
CheckedLoadString(&errMsg, IDS_CLIPBOARD_READFAILURE);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Pull the header out.
|
* Pull the header out.
|
||||||
|
|
|
@ -72,14 +72,15 @@ void ConvDiskOptionsDialog::DoDataExchange(CDataExchange* pDX)
|
||||||
if (fVolName.IsEmpty() || fVolName.GetLength() > kProDOSVolNameMax) {
|
if (fVolName.IsEmpty() || fVolName.GetLength() > kProDOSVolNameMax) {
|
||||||
errMsg = "You must specify a volume name 1-15 characters long.";
|
errMsg = "You must specify a volume name 1-15 characters long.";
|
||||||
} else {
|
} else {
|
||||||
if (!IsValidVolumeName_ProDOS(fVolName))
|
if (!IsValidVolumeName_ProDOS(fVolName)) {
|
||||||
errMsg.LoadString(IDS_VALID_VOLNAME_PRODOS);
|
CheckedLoadString(&errMsg, IDS_VALID_VOLNAME_PRODOS);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!errMsg.IsEmpty()) {
|
if (!errMsg.IsEmpty()) {
|
||||||
CString appName;
|
CString appName;
|
||||||
appName.LoadString(IDS_MB_APP_NAME);
|
CheckedLoadString(&appName, IDS_MB_APP_NAME);
|
||||||
MessageBox(errMsg, appName, MB_OK);
|
MessageBox(errMsg, appName, MB_OK);
|
||||||
pDX->Fail();
|
pDX->Fail();
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,13 +82,15 @@ void CreateImageDialog::DoDataExchange(CDataExchange* pDX)
|
||||||
if (fDiskFormatIdx == kFmtDOS32) {
|
if (fDiskFormatIdx == kFmtDOS32) {
|
||||||
CString tmpStr;
|
CString tmpStr;
|
||||||
tmpStr.Format(L"%d", fDOSVolumeNum);
|
tmpStr.Format(L"%d", fDOSVolumeNum);
|
||||||
if (!IsValidVolumeName_DOS(tmpStr))
|
if (!IsValidVolumeName_DOS(tmpStr)) {
|
||||||
errMsg.LoadString(IDS_VALID_VOLNAME_DOS);
|
CheckedLoadString(&errMsg, IDS_VALID_VOLNAME_DOS);
|
||||||
|
}
|
||||||
} else if (fDiskFormatIdx == kFmtDOS33) {
|
} else if (fDiskFormatIdx == kFmtDOS33) {
|
||||||
CString tmpStr;
|
CString tmpStr;
|
||||||
tmpStr.Format(L"%d", fDOSVolumeNum);
|
tmpStr.Format(L"%d", fDOSVolumeNum);
|
||||||
if (!IsValidVolumeName_DOS(tmpStr))
|
if (!IsValidVolumeName_DOS(tmpStr)) {
|
||||||
errMsg.LoadString(IDS_VALID_VOLNAME_DOS);
|
CheckedLoadString(&errMsg, IDS_VALID_VOLNAME_DOS);
|
||||||
|
}
|
||||||
|
|
||||||
// only needed in "extended" mode -- this stuff is too painful to
|
// only needed in "extended" mode -- this stuff is too painful to
|
||||||
// inflict on the average user
|
// inflict on the average user
|
||||||
|
@ -115,8 +117,9 @@ void CreateImageDialog::DoDataExchange(CDataExchange* pDX)
|
||||||
{
|
{
|
||||||
errMsg = L"You must specify a volume name 1-15 characters long.";
|
errMsg = L"You must specify a volume name 1-15 characters long.";
|
||||||
} else {
|
} else {
|
||||||
if (!IsValidVolumeName_ProDOS(fVolName_ProDOS))
|
if (!IsValidVolumeName_ProDOS(fVolName_ProDOS)) {
|
||||||
errMsg.LoadString(IDS_VALID_VOLNAME_PRODOS);
|
CheckedLoadString(&errMsg, IDS_VALID_VOLNAME_PRODOS);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (fDiskFormatIdx == kFmtPascal) {
|
} else if (fDiskFormatIdx == kFmtPascal) {
|
||||||
if (fVolName_Pascal.IsEmpty() ||
|
if (fVolName_Pascal.IsEmpty() ||
|
||||||
|
@ -124,8 +127,9 @@ void CreateImageDialog::DoDataExchange(CDataExchange* pDX)
|
||||||
{
|
{
|
||||||
errMsg = L"You must specify a volume name 1-7 characters long.";
|
errMsg = L"You must specify a volume name 1-7 characters long.";
|
||||||
} else {
|
} else {
|
||||||
if (!IsValidVolumeName_Pascal(fVolName_Pascal))
|
if (!IsValidVolumeName_Pascal(fVolName_Pascal)) {
|
||||||
errMsg.LoadString(IDS_VALID_VOLNAME_PASCAL);
|
CheckedLoadString(&errMsg, IDS_VALID_VOLNAME_PASCAL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (fDiskFormatIdx == kFmtHFS) {
|
} else if (fDiskFormatIdx == kFmtHFS) {
|
||||||
if (fNumBlocks < 1600 || fNumBlocks > 4194303) {
|
if (fNumBlocks < 1600 || fNumBlocks > 4194303) {
|
||||||
|
@ -136,8 +140,9 @@ void CreateImageDialog::DoDataExchange(CDataExchange* pDX)
|
||||||
{
|
{
|
||||||
errMsg = L"You must specify a volume name 1-27 characters long.";
|
errMsg = L"You must specify a volume name 1-27 characters long.";
|
||||||
} else {
|
} else {
|
||||||
if (!IsValidVolumeName_HFS(fVolName_HFS))
|
if (!IsValidVolumeName_HFS(fVolName_HFS)) {
|
||||||
errMsg.LoadString(IDS_VALID_VOLNAME_HFS);
|
CheckedLoadString(&errMsg, IDS_VALID_VOLNAME_HFS);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (fDiskFormatIdx == kFmtBlank) {
|
} else if (fDiskFormatIdx == kFmtBlank) {
|
||||||
if (fNumBlocks < 1 || fNumBlocks > kMaxBlankBlocks)
|
if (fNumBlocks < 1 || fNumBlocks > kMaxBlankBlocks)
|
||||||
|
@ -152,7 +157,7 @@ void CreateImageDialog::DoDataExchange(CDataExchange* pDX)
|
||||||
|
|
||||||
if (!errMsg.IsEmpty()) {
|
if (!errMsg.IsEmpty()) {
|
||||||
CString appName;
|
CString appName;
|
||||||
appName.LoadString(IDS_MB_APP_NAME);
|
CheckedLoadString(&appName, IDS_MB_APP_NAME);
|
||||||
MessageBox(errMsg, appName, MB_OK);
|
MessageBox(errMsg, appName, MB_OK);
|
||||||
pDX->Fail();
|
pDX->Fail();
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,8 +34,7 @@ void CreateSubdirDialog::DoDataExchange(CDataExchange* pDX)
|
||||||
{
|
{
|
||||||
CString msg, failed;
|
CString msg, failed;
|
||||||
|
|
||||||
msg = "";
|
CheckedLoadString(&failed, IDS_MB_APP_NAME);
|
||||||
failed.LoadString(IDS_MB_APP_NAME);
|
|
||||||
|
|
||||||
/* put fNewName last so it gets the focus after failure */
|
/* put fNewName last so it gets the focus after failure */
|
||||||
DDX_Text(pDX, IDC_CREATESUBDIR_BASE, fBasePath);
|
DDX_Text(pDX, IDC_CREATESUBDIR_BASE, fBasePath);
|
||||||
|
@ -44,7 +43,7 @@ void CreateSubdirDialog::DoDataExchange(CDataExchange* pDX)
|
||||||
/* validate the path field */
|
/* validate the path field */
|
||||||
if (pDX->m_bSaveAndValidate) {
|
if (pDX->m_bSaveAndValidate) {
|
||||||
if (fNewName.IsEmpty()) {
|
if (fNewName.IsEmpty()) {
|
||||||
msg = "You must specify a new name.";
|
msg = L"You must specify a new name.";
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -845,7 +845,7 @@ CString DiskArchive::Close(void)
|
||||||
|
|
||||||
msg.Format(L"Failed while closing disk image: %hs.",
|
msg.Format(L"Failed while closing disk image: %hs.",
|
||||||
DiskImgLib::DIStrError(dierr));
|
DiskImgLib::DIStrError(dierr));
|
||||||
failed.LoadString(IDS_FAILED);
|
CheckedLoadString(&failed, IDS_FAILED);
|
||||||
LOGE("During close: %ls", (LPCWSTR) msg);
|
LOGE("During close: %ls", (LPCWSTR) msg);
|
||||||
|
|
||||||
pMainWin->MessageBox(msg, failed, MB_OK);
|
pMainWin->MessageBox(msg, failed, MB_OK);
|
||||||
|
@ -1215,7 +1215,7 @@ bool DiskArchive::BulkAdd(ActionProgressDialog* pActionProgress,
|
||||||
|
|
||||||
if (fpAddDataHead == NULL) {
|
if (fpAddDataHead == NULL) {
|
||||||
CString title;
|
CString title;
|
||||||
title.LoadString(IDS_MB_APP_NAME);
|
CheckedLoadString(&title, IDS_MB_APP_NAME);
|
||||||
errMsg = L"No files added.\n";
|
errMsg = L"No files added.\n";
|
||||||
pActionProgress->MessageBox(errMsg, title, MB_OK | MB_ICONWARNING);
|
pActionProgress->MessageBox(errMsg, title, MB_OK | MB_ICONWARNING);
|
||||||
} else {
|
} else {
|
||||||
|
@ -2399,20 +2399,20 @@ CString DiskArchive::TestPathName(const GenericEntry* pGenericEntry,
|
||||||
switch (format) {
|
switch (format) {
|
||||||
case DiskImg::kFormatProDOS:
|
case DiskImg::kFormatProDOS:
|
||||||
if (!DiskFSProDOS::IsValidFileName(newNameA))
|
if (!DiskFSProDOS::IsValidFileName(newNameA))
|
||||||
errMsg.LoadString(IDS_VALID_FILENAME_PRODOS);
|
CheckedLoadString(&errMsg, IDS_VALID_FILENAME_PRODOS);
|
||||||
break;
|
break;
|
||||||
case DiskImg::kFormatDOS33:
|
case DiskImg::kFormatDOS33:
|
||||||
case DiskImg::kFormatDOS32:
|
case DiskImg::kFormatDOS32:
|
||||||
if (!DiskFSDOS33::IsValidFileName(newNameA))
|
if (!DiskFSDOS33::IsValidFileName(newNameA))
|
||||||
errMsg.LoadString(IDS_VALID_FILENAME_DOS);
|
CheckedLoadString(&errMsg, IDS_VALID_FILENAME_DOS);
|
||||||
break;
|
break;
|
||||||
case DiskImg::kFormatPascal:
|
case DiskImg::kFormatPascal:
|
||||||
if (!DiskFSPascal::IsValidFileName(newNameA))
|
if (!DiskFSPascal::IsValidFileName(newNameA))
|
||||||
errMsg.LoadString(IDS_VALID_FILENAME_PASCAL);
|
CheckedLoadString(&errMsg, IDS_VALID_FILENAME_PASCAL);
|
||||||
break;
|
break;
|
||||||
case DiskImg::kFormatMacHFS:
|
case DiskImg::kFormatMacHFS:
|
||||||
if (!DiskFSHFS::IsValidFileName(newNameA))
|
if (!DiskFSHFS::IsValidFileName(newNameA))
|
||||||
errMsg.LoadString(IDS_VALID_FILENAME_HFS);
|
CheckedLoadString(&errMsg, IDS_VALID_FILENAME_HFS);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
errMsg = L"Not supported by TestPathName!";
|
errMsg = L"Not supported by TestPathName!";
|
||||||
|
@ -2468,23 +2468,24 @@ CString DiskArchive::TestVolumeName(const DiskFS* pDiskFS,
|
||||||
switch (format) {
|
switch (format) {
|
||||||
case DiskImg::kFormatProDOS:
|
case DiskImg::kFormatProDOS:
|
||||||
if (!DiskFSProDOS::IsValidVolumeName(newNameA))
|
if (!DiskFSProDOS::IsValidVolumeName(newNameA))
|
||||||
errMsg.LoadString(IDS_VALID_VOLNAME_PRODOS);
|
CheckedLoadString(&errMsg, IDS_VALID_VOLNAME_PRODOS);
|
||||||
break;
|
break;
|
||||||
case DiskImg::kFormatDOS33:
|
case DiskImg::kFormatDOS33:
|
||||||
case DiskImg::kFormatDOS32:
|
case DiskImg::kFormatDOS32:
|
||||||
if (!DiskFSDOS33::IsValidVolumeName(newNameA))
|
if (!DiskFSDOS33::IsValidVolumeName(newNameA))
|
||||||
errMsg.LoadString(IDS_VALID_VOLNAME_DOS);
|
CheckedLoadString(&errMsg, IDS_VALID_VOLNAME_DOS);
|
||||||
break;
|
break;
|
||||||
case DiskImg::kFormatPascal:
|
case DiskImg::kFormatPascal:
|
||||||
if (!DiskFSPascal::IsValidVolumeName(newNameA))
|
if (!DiskFSPascal::IsValidVolumeName(newNameA))
|
||||||
errMsg.LoadString(IDS_VALID_VOLNAME_PASCAL);
|
CheckedLoadString(&errMsg, IDS_VALID_VOLNAME_PASCAL);
|
||||||
break;
|
break;
|
||||||
case DiskImg::kFormatMacHFS:
|
case DiskImg::kFormatMacHFS:
|
||||||
if (!DiskFSHFS::IsValidVolumeName(newNameA))
|
if (!DiskFSHFS::IsValidVolumeName(newNameA))
|
||||||
errMsg.LoadString(IDS_VALID_VOLNAME_HFS);
|
CheckedLoadString(&errMsg, IDS_VALID_VOLNAME_HFS);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
errMsg = L"Not supported by TestVolumeName!";
|
errMsg = L"Not supported by TestVolumeName!";
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return errMsg;
|
return errMsg;
|
||||||
|
|
|
@ -48,7 +48,7 @@ void DiskConvertDialog::Init(const DiskImg* pDiskImg)
|
||||||
fConvertIdx = kConvProDOSRaw;
|
fConvertIdx = kConvProDOSRaw;
|
||||||
} else if (diskSizeInSectors == 35*16) {
|
} else if (diskSizeInSectors == 35*16) {
|
||||||
/* 140K disk image */
|
/* 140K disk image */
|
||||||
fDiskDescription.LoadString(IDS_CDESC_140K);
|
CheckedLoadString(&fDiskDescription, IDS_CDESC_140K);
|
||||||
fAllowUnadornedDOS = true;
|
fAllowUnadornedDOS = true;
|
||||||
fAllowUnadornedProDOS = true;
|
fAllowUnadornedProDOS = true;
|
||||||
fAllowProDOS2MG = true;
|
fAllowProDOS2MG = true;
|
||||||
|
@ -66,7 +66,7 @@ void DiskConvertDialog::Init(const DiskImg* pDiskImg)
|
||||||
pDiskImg->GetFileFormat() == DiskImg::kFileFormatFDI))
|
pDiskImg->GetFileFormat() == DiskImg::kFileFormatFDI))
|
||||||
{
|
{
|
||||||
/* 40-track TrackStar or FDI image; allow conversion to 35-track formats */
|
/* 40-track TrackStar or FDI image; allow conversion to 35-track formats */
|
||||||
fDiskDescription.LoadString(IDS_CDESC_40TRACK);
|
CheckedLoadString(&fDiskDescription, IDS_CDESC_40TRACK);
|
||||||
ASSERT(pDiskImg->GetHasBlocks());
|
ASSERT(pDiskImg->GetHasBlocks());
|
||||||
fAllowUnadornedDOS = true;
|
fAllowUnadornedDOS = true;
|
||||||
fAllowUnadornedProDOS = true;
|
fAllowUnadornedProDOS = true;
|
||||||
|
@ -79,13 +79,13 @@ void DiskConvertDialog::Init(const DiskImg* pDiskImg)
|
||||||
fConvertIdx = kConvDOSRaw;
|
fConvertIdx = kConvDOSRaw;
|
||||||
} else if (diskSizeInSectors == 35*13) {
|
} else if (diskSizeInSectors == 35*13) {
|
||||||
/* 13-sector 5.25" floppy */
|
/* 13-sector 5.25" floppy */
|
||||||
fDiskDescription.LoadString(IDS_CDEC_140K_13);
|
CheckedLoadString(&fDiskDescription, IDS_CDEC_140K_13);
|
||||||
fAllowUnadornedNibble = true;
|
fAllowUnadornedNibble = true;
|
||||||
fAllowD13 = true;
|
fAllowD13 = true;
|
||||||
fConvertIdx = kConvNibbleRaw;
|
fConvertIdx = kConvNibbleRaw;
|
||||||
} else if (diskSizeInSectors == kMagicNibbles) {
|
} else if (diskSizeInSectors == kMagicNibbles) {
|
||||||
/* blob of nibbles with no recognizable format; allow self-convert */
|
/* blob of nibbles with no recognizable format; allow self-convert */
|
||||||
fDiskDescription.LoadString(IDS_CDEC_RAWNIB);
|
CheckedLoadString(&fDiskDescription, IDS_CDEC_RAWNIB);
|
||||||
if (pDiskImg->GetPhysicalFormat() == DiskImg::kPhysicalFormatNib525_6656)
|
if (pDiskImg->GetPhysicalFormat() == DiskImg::kPhysicalFormatNib525_6656)
|
||||||
{
|
{
|
||||||
fAllowUnadornedNibble = true;
|
fAllowUnadornedNibble = true;
|
||||||
|
@ -105,7 +105,7 @@ void DiskConvertDialog::Init(const DiskImg* pDiskImg)
|
||||||
}
|
}
|
||||||
} else if (diskSizeInSectors == 3200) {
|
} else if (diskSizeInSectors == 3200) {
|
||||||
/* 800K disk image */
|
/* 800K disk image */
|
||||||
fDiskDescription.LoadString(IDS_CDESC_800K);
|
CheckedLoadString(&fDiskDescription, IDS_CDESC_800K);
|
||||||
fAllowUnadornedDOS = true;
|
fAllowUnadornedDOS = true;
|
||||||
fAllowUnadornedProDOS = true;
|
fAllowUnadornedProDOS = true;
|
||||||
fAllowProDOS2MG = true;
|
fAllowProDOS2MG = true;
|
||||||
|
|
|
@ -322,9 +322,9 @@ int DiskEditDialog::ReadSpinner(int id, long* pVal)
|
||||||
long val = pSpin->GetPos();
|
long val = pSpin->GetPos();
|
||||||
if (val & 0xff000000) {
|
if (val & 0xff000000) {
|
||||||
/* error */
|
/* error */
|
||||||
CString msg;
|
CString msg, err;
|
||||||
CString err;
|
|
||||||
err.LoadString(IDS_ERROR);
|
CheckedLoadString(&err, IDS_ERROR);
|
||||||
int lower, upper;
|
int lower, upper;
|
||||||
pSpin->GetRange32(lower, upper);
|
pSpin->GetRange32(lower, upper);
|
||||||
msg.Format(L"Please enter a value between %d and %d (0x%x and 0x%x).",
|
msg.Format(L"Please enter a value between %d and %d (0x%x and 0x%x).",
|
||||||
|
@ -514,7 +514,7 @@ DIError DiskEditDialog::OpenFile(const WCHAR* fileName, bool openRsrc,
|
||||||
CString msg, failed;
|
CString msg, failed;
|
||||||
|
|
||||||
msg.Format(IDS_DEFILE_FIND_FAILED, fileName);
|
msg.Format(IDS_DEFILE_FIND_FAILED, fileName);
|
||||||
failed.LoadString(IDS_FAILED);
|
CheckedLoadString(&failed, IDS_FAILED);
|
||||||
MessageBox(msg, failed, MB_OK | MB_ICONSTOP);
|
MessageBox(msg, failed, MB_OK | MB_ICONSTOP);
|
||||||
return kDIErrFileNotFound;
|
return kDIErrFileNotFound;
|
||||||
}
|
}
|
||||||
|
@ -526,7 +526,7 @@ DIError DiskEditDialog::OpenFile(const WCHAR* fileName, bool openRsrc,
|
||||||
|
|
||||||
msg.Format(IDS_DEFILE_OPEN_FAILED, fileName,
|
msg.Format(IDS_DEFILE_OPEN_FAILED, fileName,
|
||||||
DiskImgLib::DIStrError(dierr));
|
DiskImgLib::DIStrError(dierr));
|
||||||
failed.LoadString(IDS_FAILED);
|
CheckedLoadString(&failed, IDS_FAILED);
|
||||||
MessageBox(msg, failed, MB_OK | MB_ICONSTOP);
|
MessageBox(msg, failed, MB_OK | MB_ICONSTOP);
|
||||||
return dierr;
|
return dierr;
|
||||||
}
|
}
|
||||||
|
@ -656,7 +656,7 @@ int SectorEditDialog::LoadData(void)
|
||||||
//err.LoadString(IDS_ERROR);
|
//err.LoadString(IDS_ERROR);
|
||||||
//msg.Format(IDS_DISKEDIT_NOREADTS, fTrack, fSector);
|
//msg.Format(IDS_DISKEDIT_NOREADTS, fTrack, fSector);
|
||||||
//MessageBox(msg, err, MB_OK|MB_ICONSTOP);
|
//MessageBox(msg, err, MB_OK|MB_ICONSTOP);
|
||||||
fAlertMsg.LoadString(IDS_DISKEDITMSG_BADSECTOR);
|
CheckedLoadString(&fAlertMsg, IDS_DISKEDITMSG_BADSECTOR);
|
||||||
//return -1;
|
//return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -778,7 +778,7 @@ BOOL SectorFileEditDialog::OnInitDialog(void)
|
||||||
/* set the window title */
|
/* set the window title */
|
||||||
CString title;
|
CString title;
|
||||||
CString rsrcIndic;
|
CString rsrcIndic;
|
||||||
rsrcIndic.LoadString(IDS_INDIC_RSRC);
|
CheckedLoadString(&rsrcIndic, IDS_INDIC_RSRC);
|
||||||
title.Format(L"Disk Viewer - %hs%ls (%I64d bytes)",
|
title.Format(L"Disk Viewer - %hs%ls (%I64d bytes)",
|
||||||
(LPCSTR) fpFile->GetPathName(), // use fpFile version to get case
|
(LPCSTR) fpFile->GetPathName(), // use fpFile version to get case
|
||||||
fOpenRsrcFork ? (LPCWSTR)rsrcIndic : L"", (LONGLONG) fLength);
|
fOpenRsrcFork ? (LPCWSTR)rsrcIndic : L"", (LONGLONG) fLength);
|
||||||
|
@ -833,13 +833,13 @@ int SectorFileEditDialog::LoadData(void)
|
||||||
if (dierr == kDIErrInvalidIndex && fSectorIdx == 0) {
|
if (dierr == kDIErrInvalidIndex && fSectorIdx == 0) {
|
||||||
// no first sector; should only happen on CP/M
|
// no first sector; should only happen on CP/M
|
||||||
//FillWithPattern(fSectorData, sizeof(fSectorData), _T("EMPTY "));
|
//FillWithPattern(fSectorData, sizeof(fSectorData), _T("EMPTY "));
|
||||||
fAlertMsg.LoadString(IDS_DISKEDITMSG_EMPTY);
|
CheckedLoadString(&fAlertMsg, IDS_DISKEDITMSG_EMPTY);
|
||||||
} else if (dierr != kDIErrNone) {
|
} else if (dierr != kDIErrNone) {
|
||||||
CString msg, failed;
|
CString msg, failed;
|
||||||
failed.LoadString(IDS_FAILED);
|
CheckedLoadString(&failed, IDS_FAILED);
|
||||||
msg.Format(IDS_DISKEDIT_FIRDFAILED, DiskImgLib::DIStrError(dierr));
|
msg.Format(IDS_DISKEDIT_FIRDFAILED, DiskImgLib::DIStrError(dierr));
|
||||||
MessageBox(msg, failed, MB_OK);
|
MessageBox(msg, failed, MB_OK);
|
||||||
fAlertMsg.LoadString(IDS_FAILED);
|
CheckedLoadString(&fAlertMsg, IDS_FAILED);
|
||||||
// TO DO: mark contents as invalid, so editing fails
|
// TO DO: mark contents as invalid, so editing fails
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
|
@ -858,7 +858,7 @@ int SectorFileEditDialog::LoadData(void)
|
||||||
//err.LoadString(IDS_ERROR);
|
//err.LoadString(IDS_ERROR);
|
||||||
//msg.Format(IDS_DISKEDIT_NOREADTS, fTrack, fSector);
|
//msg.Format(IDS_DISKEDIT_NOREADTS, fTrack, fSector);
|
||||||
//MessageBox(msg, err, MB_OK|MB_ICONSTOP);
|
//MessageBox(msg, err, MB_OK|MB_ICONSTOP);
|
||||||
fAlertMsg.LoadString(IDS_DISKEDITMSG_BADSECTOR);
|
CheckedLoadString(&fAlertMsg, IDS_DISKEDITMSG_BADSECTOR);
|
||||||
//return -1;
|
//return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1033,7 +1033,7 @@ int BlockEditDialog::LoadData(void)
|
||||||
//err.LoadString(IDS_ERROR);
|
//err.LoadString(IDS_ERROR);
|
||||||
//msg.Format(IDS_DISKEDIT_NOREADBLOCK, fBlock);
|
//msg.Format(IDS_DISKEDIT_NOREADBLOCK, fBlock);
|
||||||
//MessageBox(msg, err, MB_OK|MB_ICONSTOP);
|
//MessageBox(msg, err, MB_OK|MB_ICONSTOP);
|
||||||
fAlertMsg.LoadString(IDS_DISKEDITMSG_BADBLOCK);
|
CheckedLoadString(&fAlertMsg, IDS_DISKEDITMSG_BADBLOCK);
|
||||||
//return -1;
|
//return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1132,7 +1132,7 @@ BOOL BlockFileEditDialog::OnInitDialog(void)
|
||||||
/* set the window title */
|
/* set the window title */
|
||||||
CString title;
|
CString title;
|
||||||
CString rsrcIndic;
|
CString rsrcIndic;
|
||||||
rsrcIndic.LoadString(IDS_INDIC_RSRC);
|
CheckedLoadString(&rsrcIndic, IDS_INDIC_RSRC);
|
||||||
title.Format(L"Disk Viewer - %hs%ls (%I64d bytes)",
|
title.Format(L"Disk Viewer - %hs%ls (%I64d bytes)",
|
||||||
(LPCSTR) fpFile->GetPathName(), // use fpFile version to get case
|
(LPCSTR) fpFile->GetPathName(), // use fpFile version to get case
|
||||||
fOpenRsrcFork ? (LPCWSTR)rsrcIndic : L"", (LONGLONG) fLength);
|
fOpenRsrcFork ? (LPCWSTR)rsrcIndic : L"", (LONGLONG) fLength);
|
||||||
|
@ -1186,13 +1186,13 @@ int BlockFileEditDialog::LoadData(void)
|
||||||
if (dierr == kDIErrInvalidIndex && fBlockIdx == 0) {
|
if (dierr == kDIErrInvalidIndex && fBlockIdx == 0) {
|
||||||
// no first sector; should only happen on CP/M
|
// no first sector; should only happen on CP/M
|
||||||
//FillWithPattern(fBlockData, sizeof(fBlockData), _T("EMPTY "));
|
//FillWithPattern(fBlockData, sizeof(fBlockData), _T("EMPTY "));
|
||||||
fAlertMsg.LoadString(IDS_DISKEDITMSG_EMPTY);
|
CheckedLoadString(&fAlertMsg, IDS_DISKEDITMSG_EMPTY);
|
||||||
} else if (dierr != kDIErrNone) {
|
} else if (dierr != kDIErrNone) {
|
||||||
CString msg, failed;
|
CString msg, failed;
|
||||||
failed.LoadString(IDS_FAILED);
|
CheckedLoadString(&failed, IDS_FAILED);
|
||||||
msg.Format(IDS_DISKEDIT_FIRDFAILED, DiskImgLib::DIStrError(dierr));
|
msg.Format(IDS_DISKEDIT_FIRDFAILED, DiskImgLib::DIStrError(dierr));
|
||||||
MessageBox(msg, failed, MB_OK);
|
MessageBox(msg, failed, MB_OK);
|
||||||
fAlertMsg.LoadString(IDS_FAILED);
|
CheckedLoadString(&fAlertMsg, IDS_FAILED);
|
||||||
// TO DO: mark contents as invalid, so editing fails
|
// TO DO: mark contents as invalid, so editing fails
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1210,7 +1210,7 @@ int BlockFileEditDialog::LoadData(void)
|
||||||
//err.LoadString(IDS_ERROR);
|
//err.LoadString(IDS_ERROR);
|
||||||
//msg.Format(IDS_DISKEDIT_NOREADBLOCK, fBlock);
|
//msg.Format(IDS_DISKEDIT_NOREADBLOCK, fBlock);
|
||||||
//MessageBox(msg, err, MB_OK|MB_ICONSTOP);
|
//MessageBox(msg, err, MB_OK|MB_ICONSTOP);
|
||||||
fAlertMsg.LoadString(IDS_DISKEDITMSG_BADBLOCK);
|
CheckedLoadString(&fAlertMsg, IDS_DISKEDITMSG_BADBLOCK);
|
||||||
//return -1;
|
//return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1374,7 +1374,7 @@ int NibbleEditDialog::LoadData(void)
|
||||||
&fNibbleDataLen);
|
&fNibbleDataLen);
|
||||||
if (dierr != kDIErrNone) {
|
if (dierr != kDIErrNone) {
|
||||||
LOGI("NED track read failed: %hs", DiskImgLib::DIStrError(dierr));
|
LOGI("NED track read failed: %hs", DiskImgLib::DIStrError(dierr));
|
||||||
fAlertMsg.LoadString(IDS_DISKEDITMSG_BADTRACK);
|
CheckedLoadString(&fAlertMsg, IDS_DISKEDITMSG_BADTRACK);
|
||||||
}
|
}
|
||||||
|
|
||||||
DisplayData();
|
DisplayData();
|
||||||
|
|
|
@ -39,8 +39,8 @@ void EditCommentDialog::OnDelete(void)
|
||||||
CString question, title;
|
CString question, title;
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
title.LoadString(IDS_EDIT_COMMENT);
|
CheckedLoadString(&title, IDS_EDIT_COMMENT);
|
||||||
question.LoadString(IDS_DEL_COMMENT_OK);
|
CheckedLoadString(&question, IDS_DEL_COMMENT_OK);
|
||||||
result = MessageBox(question, title, MB_OKCANCEL | MB_ICONQUESTION);
|
result = MessageBox(question, title, MB_OKCANCEL | MB_ICONQUESTION);
|
||||||
if (result == IDCANCEL)
|
if (result == IDCANCEL)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -199,7 +199,7 @@ void EditPropsDialog::DoDataExchange(CDataExchange* pDX)
|
||||||
CButton *pButton;
|
CButton *pButton;
|
||||||
bool typeChanged = false;
|
bool typeChanged = false;
|
||||||
|
|
||||||
appName.LoadString(IDS_MB_APP_NAME);
|
CheckedLoadString(&appName, IDS_MB_APP_NAME);
|
||||||
|
|
||||||
pButton = (CButton*) GetDlgItem(IDC_PROPS_HFS_MODE);
|
pButton = (CButton*) GetDlgItem(IDC_PROPS_HFS_MODE);
|
||||||
if (pButton->GetCheck() == BST_CHECKED) {
|
if (pButton->GetCheck() == BST_CHECKED) {
|
||||||
|
@ -264,7 +264,7 @@ void EditPropsDialog::DoDataExchange(CDataExchange* pDX)
|
||||||
CString msg;
|
CString msg;
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
msg.LoadString(IDS_PROPS_DOS_TYPE_CHANGE);
|
CheckedLoadString(&msg, IDS_PROPS_DOS_TYPE_CHANGE);
|
||||||
result = MessageBox(msg, appName, MB_ICONQUESTION|MB_OKCANCEL);
|
result = MessageBox(msg, appName, MB_ICONQUESTION|MB_OKCANCEL);
|
||||||
if (result != IDOK) {
|
if (result != IDOK) {
|
||||||
pDX->Fail();
|
pDX->Fail();
|
||||||
|
|
|
@ -38,10 +38,10 @@ BOOL ExtractOptionsDialog::OnInitDialog(void)
|
||||||
|
|
||||||
/* set the count string using a string table entry */
|
/* set the count string using a string table entry */
|
||||||
if (fSelectedCount == 1) {
|
if (fSelectedCount == 1) {
|
||||||
countFmt.LoadString(IDS_EXT_SELECTED_COUNT);
|
CheckedLoadString(&countFmt, IDS_EXT_SELECTED_COUNT);
|
||||||
pWnd->SetWindowText(countFmt);
|
pWnd->SetWindowText(countFmt);
|
||||||
} else {
|
} else {
|
||||||
countFmt.LoadString(IDS_EXT_SELECTED_COUNTS_FMT);
|
CheckedLoadString(&countFmt, IDS_EXT_SELECTED_COUNTS_FMT);
|
||||||
selStr.Format((LPCWSTR) countFmt, fSelectedCount);
|
selStr.Format((LPCWSTR) countFmt, fSelectedCount);
|
||||||
pWnd->SetWindowText(selStr);
|
pWnd->SetWindowText(selStr);
|
||||||
|
|
||||||
|
|
16
app/Main.cpp
16
app/Main.cpp
|
@ -520,7 +520,7 @@ LONG MainWindow::OnLateInit(UINT, LONG)
|
||||||
CString appName;
|
CString appName;
|
||||||
CString niftyListFile;
|
CString niftyListFile;
|
||||||
|
|
||||||
appName.LoadString(IDS_MB_APP_NAME);
|
CheckedLoadString(&appName, IDS_MB_APP_NAME);
|
||||||
|
|
||||||
LOGI("----- late init begins -----");
|
LOGI("----- late init begins -----");
|
||||||
|
|
||||||
|
@ -1114,7 +1114,7 @@ void MainWindow::OnFileNewArchive(void)
|
||||||
errStr = pOpenArchive->New(filename, NULL);
|
errStr = pOpenArchive->New(filename, NULL);
|
||||||
if (!errStr.IsEmpty()) {
|
if (!errStr.IsEmpty()) {
|
||||||
CString failed;
|
CString failed;
|
||||||
failed.LoadString(IDS_FAILED);
|
CheckedLoadString(&failed, IDS_FAILED);
|
||||||
MessageBox(errStr, failed, MB_ICONERROR);
|
MessageBox(errStr, failed, MB_ICONERROR);
|
||||||
|
|
||||||
delete pOpenArchive;
|
delete pOpenArchive;
|
||||||
|
@ -1317,7 +1317,7 @@ void MainWindow::PrintListing(const ContentList* pContentList)
|
||||||
return;
|
return;
|
||||||
if (dc.Attach(dlg.GetPrinterDC()) != TRUE) {
|
if (dc.Attach(dlg.GetPrinterDC()) != TRUE) {
|
||||||
CString msg;
|
CString msg;
|
||||||
msg.LoadString(IDS_PRINTER_NOT_USABLE);
|
CheckedLoadString(&msg, IDS_PRINTER_NOT_USABLE);
|
||||||
ShowFailureMsg(this, msg, IDS_FAILED);
|
ShowFailureMsg(this, msg, IDS_FAILED);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1829,7 +1829,7 @@ int MainWindow::LoadArchive(const WCHAR* fileName, const WCHAR* extension,
|
||||||
int origFilterIndex = filterIndex;
|
int origFilterIndex = filterIndex;
|
||||||
CString errStr, appName;
|
CString errStr, appName;
|
||||||
|
|
||||||
appName.LoadString(IDS_MB_APP_NAME);
|
CheckedLoadString(&appName, IDS_MB_APP_NAME);
|
||||||
|
|
||||||
LOGI("LoadArchive: '%ls' ro=%d idx=%d", fileName, readOnly, filterIndex);
|
LOGI("LoadArchive: '%ls' ro=%d idx=%d", fileName, readOnly, filterIndex);
|
||||||
|
|
||||||
|
@ -2159,7 +2159,7 @@ void MainWindow::SetCPTitle(const WCHAR* pathname, GenericArchive* pOpenArchive)
|
||||||
CString appName;
|
CString appName;
|
||||||
CString archiveDescription;
|
CString archiveDescription;
|
||||||
|
|
||||||
appName.LoadString(IDS_MB_APP_NAME);
|
CheckedLoadString(&appName, IDS_MB_APP_NAME);
|
||||||
|
|
||||||
pOpenArchive->GetDescription(&archiveDescription);
|
pOpenArchive->GetDescription(&archiveDescription);
|
||||||
title.Format(L"%ls - %ls (%ls)", (LPCWSTR) appName, pathname,
|
title.Format(L"%ls - %ls (%ls)", (LPCWSTR) appName, pathname,
|
||||||
|
@ -2167,7 +2167,7 @@ void MainWindow::SetCPTitle(const WCHAR* pathname, GenericArchive* pOpenArchive)
|
||||||
|
|
||||||
if (fpOpenArchive->IsReadOnly()) {
|
if (fpOpenArchive->IsReadOnly()) {
|
||||||
CString readOnly;
|
CString readOnly;
|
||||||
readOnly.LoadString(IDS_READONLY);
|
CheckedLoadString(&readOnly, IDS_READONLY);
|
||||||
title += L" ";
|
title += L" ";
|
||||||
title += readOnly;
|
title += readOnly;
|
||||||
}
|
}
|
||||||
|
@ -2195,7 +2195,7 @@ void MainWindow::SetCPTitle(void)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
appName.LoadString(IDS_MB_APP_NAME);
|
CheckedLoadString(&appName, IDS_MB_APP_NAME);
|
||||||
title = appName + regName;
|
title = appName + regName;
|
||||||
SetWindowText(title);
|
SetWindowText(title);
|
||||||
}
|
}
|
||||||
|
@ -2211,7 +2211,7 @@ CString MainWindow::GetPrintTitle(void)
|
||||||
return title;
|
return title;
|
||||||
}
|
}
|
||||||
|
|
||||||
appName.LoadString(IDS_MB_APP_NAME);
|
CheckedLoadString(&appName, IDS_MB_APP_NAME);
|
||||||
|
|
||||||
fpOpenArchive->GetDescription(&archiveDescription);
|
fpOpenArchive->GetDescription(&archiveDescription);
|
||||||
title.Format(L"%ls - %ls (%ls)", (LPCWSTR) appName,
|
title.Format(L"%ls - %ls (%ls)", (LPCWSTR) appName,
|
||||||
|
|
|
@ -56,7 +56,7 @@ void NewFolderDialog::DoDataExchange(CDataExchange* pDX)
|
||||||
GetWin32ErrorString(dwerr, &errStr);
|
GetWin32ErrorString(dwerr, &errStr);
|
||||||
msg.Format(L"Unable to create folder '%ls': %ls",
|
msg.Format(L"Unable to create folder '%ls': %ls",
|
||||||
(LPCWSTR) fNewFolder, (LPCWSTR) errStr);
|
(LPCWSTR) fNewFolder, (LPCWSTR) errStr);
|
||||||
failed.LoadString(IDS_FAILED);
|
CheckedLoadString(&failed, IDS_FAILED);
|
||||||
MessageBox(msg, failed, MB_OK | MB_ICONERROR);
|
MessageBox(msg, failed, MB_OK | MB_ICONERROR);
|
||||||
pDX->Fail();
|
pDX->Fail();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -933,7 +933,7 @@ bool NufxArchive::BulkAdd(ActionProgressDialog* pActionProgress,
|
||||||
if (nerr != kNuErrNone) {
|
if (nerr != kNuErrNone) {
|
||||||
if (errMsg.IsEmpty())
|
if (errMsg.IsEmpty())
|
||||||
errMsg.Format(L"Failed while adding file '%ls': %hs.",
|
errMsg.Format(L"Failed while adding file '%ls': %hs.",
|
||||||
name, NuStrError(nerr));
|
(LPCWSTR) name, NuStrError(nerr));
|
||||||
if (nerr != kNuErrAborted) {
|
if (nerr != kNuErrAborted) {
|
||||||
ShowFailureMsg(fpMsgWnd, errMsg, IDS_FAILED);
|
ShowFailureMsg(fpMsgWnd, errMsg, IDS_FAILED);
|
||||||
}
|
}
|
||||||
|
@ -1086,7 +1086,7 @@ bool NufxArchive::AddDisk(ActionProgressDialog* pActionProgress,
|
||||||
}
|
}
|
||||||
if (numBadBlocks > 0) {
|
if (numBadBlocks > 0) {
|
||||||
CString appName, msg;
|
CString appName, msg;
|
||||||
appName.LoadString(IDS_MB_APP_NAME);
|
CheckedLoadString(&appName, IDS_MB_APP_NAME);
|
||||||
msg.Format(L"Skipped %ld unreadable block%ls.", numBadBlocks,
|
msg.Format(L"Skipped %ld unreadable block%ls.", numBadBlocks,
|
||||||
numBadBlocks == 1 ? L"" : L"s");
|
numBadBlocks == 1 ? L"" : L"s");
|
||||||
fpMsgWnd->MessageBox(msg, appName, MB_OK | MB_ICONWARNING);
|
fpMsgWnd->MessageBox(msg, appName, MB_OK | MB_ICONWARNING);
|
||||||
|
@ -1388,7 +1388,7 @@ bool NufxArchive::TestSelection(CWnd* pMsgWnd, SelectionSet* pSelSet)
|
||||||
if (nerr != kNuErrNone) {
|
if (nerr != kNuErrNone) {
|
||||||
if (nerr == kNuErrAborted) {
|
if (nerr == kNuErrAborted) {
|
||||||
CString title;
|
CString title;
|
||||||
title.LoadString(IDS_MB_APP_NAME);
|
CheckedLoadString(&title, IDS_MB_APP_NAME);
|
||||||
errMsg = "Cancelled.";
|
errMsg = "Cancelled.";
|
||||||
pMsgWnd->MessageBox(errMsg, title, MB_OK);
|
pMsgWnd->MessageBox(errMsg, title, MB_OK);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -594,8 +594,8 @@ void OpenVolumeDialog::OnOK(void)
|
||||||
|
|
||||||
if (pListView->GetSelectedCount() != 1) {
|
if (pListView->GetSelectedCount() != 1) {
|
||||||
CString msg, failed;
|
CString msg, failed;
|
||||||
failed.LoadString(IDS_FAILED);
|
CheckedLoadString(&failed, IDS_FAILED);
|
||||||
msg.LoadString(IDS_VOLUME_SELECT_ONE);
|
CheckedLoadString(&msg, IDS_VOLUME_SELECT_ONE);
|
||||||
MessageBox(msg, failed, MB_OK);
|
MessageBox(msg, failed, MB_OK);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -653,8 +653,8 @@ void OpenVolumeDialog::OnOK(void)
|
||||||
if (formatID != 0) {
|
if (formatID != 0) {
|
||||||
CString msg, notAllowed;
|
CString msg, notAllowed;
|
||||||
|
|
||||||
notAllowed.LoadString(IDS_NOT_ALLOWED);
|
CheckedLoadString(¬Allowed, IDS_NOT_ALLOWED);
|
||||||
msg.LoadString(formatID);
|
CheckedLoadString(&msg, formatID);
|
||||||
MessageBox(msg, notAllowed, MB_OK);
|
MessageBox(msg, notAllowed, MB_OK);
|
||||||
} else {
|
} else {
|
||||||
Preferences* pPreferences = GET_PREFERENCES_WR();
|
Preferences* pPreferences = GET_PREFERENCES_WR();
|
||||||
|
|
|
@ -385,7 +385,7 @@ void PrefsFilesPage::DoDataExchange(CDataExchange* pDX)
|
||||||
if (pDX->m_bSaveAndValidate) {
|
if (pDX->m_bSaveAndValidate) {
|
||||||
if (fTempPath.IsEmpty()) {
|
if (fTempPath.IsEmpty()) {
|
||||||
CString appName;
|
CString appName;
|
||||||
appName.LoadString(IDS_MB_APP_NAME);
|
CheckedLoadString(&appName, IDS_MB_APP_NAME);
|
||||||
MessageBox(L"You must specify a path for temp files",
|
MessageBox(L"You must specify a path for temp files",
|
||||||
appName, MB_OK);
|
appName, MB_OK);
|
||||||
pDX->Fail();
|
pDX->Fail();
|
||||||
|
|
|
@ -209,7 +209,7 @@ int PrintContentList::StartPrint(void)
|
||||||
|
|
||||||
// set up the print job
|
// set up the print job
|
||||||
CString printTitle;
|
CString printTitle;
|
||||||
printTitle.LoadString(IDS_PRINT_CL_JOB_TITLE);
|
CheckedLoadString(&printTitle, IDS_PRINT_CL_JOB_TITLE);
|
||||||
DOCINFO di;
|
DOCINFO di;
|
||||||
::ZeroMemory(&di, sizeof(DOCINFO));
|
::ZeroMemory(&di, sizeof(DOCINFO));
|
||||||
di.cbSize = sizeof(DOCINFO);
|
di.cbSize = sizeof(DOCINFO);
|
||||||
|
|
|
@ -58,7 +58,7 @@ void RenameEntryDialog::DoDataExchange(CDataExchange* pDX)
|
||||||
{
|
{
|
||||||
CString msg, failed;
|
CString msg, failed;
|
||||||
|
|
||||||
failed.LoadString(IDS_MB_APP_NAME);
|
CheckedLoadString(&failed, IDS_MB_APP_NAME);
|
||||||
|
|
||||||
/* fNewName must come last, or the focus will be set on the wrong field
|
/* fNewName must come last, or the focus will be set on the wrong field
|
||||||
when we return after failure */
|
when we return after failure */
|
||||||
|
|
|
@ -48,7 +48,7 @@ void RenameVolumeDialog::DoDataExchange(CDataExchange* pDX)
|
||||||
CString msg, failed;
|
CString msg, failed;
|
||||||
//DiskImgLib::DiskFS* pDiskFS = fpArchive->GetDiskFS();
|
//DiskImgLib::DiskFS* pDiskFS = fpArchive->GetDiskFS();
|
||||||
|
|
||||||
failed.LoadString(IDS_MB_APP_NAME);
|
CheckedLoadString(&failed, IDS_MB_APP_NAME);
|
||||||
|
|
||||||
/* put fNewName last so it gets the focus after failure */
|
/* put fNewName last so it gets the focus after failure */
|
||||||
DDX_Text(pDX, IDC_RENAMEVOL_NEW, fNewName);
|
DDX_Text(pDX, IDC_RENAMEVOL_NEW, fNewName);
|
||||||
|
@ -60,7 +60,7 @@ void RenameVolumeDialog::DoDataExchange(CDataExchange* pDX)
|
||||||
*/
|
*/
|
||||||
CTreeCtrl* pTree = (CTreeCtrl*) GetDlgItem(IDC_RENAMEVOL_TREE);
|
CTreeCtrl* pTree = (CTreeCtrl*) GetDlgItem(IDC_RENAMEVOL_TREE);
|
||||||
CString errMsg, appName;
|
CString errMsg, appName;
|
||||||
appName.LoadString(IDS_MB_APP_NAME);
|
CheckedLoadString(&appName, IDS_MB_APP_NAME);
|
||||||
|
|
||||||
HTREEITEM selected;
|
HTREEITEM selected;
|
||||||
selected = pTree->GetSelectedItem();
|
selected = pTree->GetSelectedItem();
|
||||||
|
|
|
@ -102,7 +102,7 @@ void MainWindow::OnToolsDiskEdit(void)
|
||||||
/* flush current archive in case that's what we're planning to edit */
|
/* flush current archive in case that's what we're planning to edit */
|
||||||
OnFileSave();
|
OnFileSave();
|
||||||
|
|
||||||
failed.LoadString(IDS_FAILED);
|
CheckedLoadString(&failed, IDS_FAILED);
|
||||||
|
|
||||||
diskEditOpen.fArchiveOpen = false;
|
diskEditOpen.fArchiveOpen = false;
|
||||||
if (fpOpenArchive != NULL &&
|
if (fpOpenArchive != NULL &&
|
||||||
|
@ -499,8 +499,8 @@ void MainWindow::OnToolsDiskConv(void)
|
||||||
{
|
{
|
||||||
/* converting from TrackStar to anything else */
|
/* converting from TrackStar to anything else */
|
||||||
CString msg, appName;
|
CString msg, appName;
|
||||||
msg.LoadString(IDS_TRACKSTAR_TO_OTHER_WARNING);
|
CheckedLoadString(&msg, IDS_TRACKSTAR_TO_OTHER_WARNING);
|
||||||
appName.LoadString(IDS_MB_APP_NAME);
|
CheckedLoadString(&appName, IDS_MB_APP_NAME);
|
||||||
if (MessageBox(msg, appName, MB_OKCANCEL | MB_ICONWARNING) != IDOK) {
|
if (MessageBox(msg, appName, MB_OKCANCEL | MB_ICONWARNING) != IDOK) {
|
||||||
LOGI(" User bailed after trackstar-to-other warning");
|
LOGI(" User bailed after trackstar-to-other warning");
|
||||||
goto bail;
|
goto bail;
|
||||||
|
@ -511,8 +511,8 @@ void MainWindow::OnToolsDiskConv(void)
|
||||||
{
|
{
|
||||||
/* converting from 5.25" FDI to anything but TrackStar */
|
/* converting from 5.25" FDI to anything but TrackStar */
|
||||||
CString msg, appName;
|
CString msg, appName;
|
||||||
msg.LoadString(IDS_FDI_TO_OTHER_WARNING);
|
CheckedLoadString(&msg, IDS_FDI_TO_OTHER_WARNING);
|
||||||
appName.LoadString(IDS_MB_APP_NAME);
|
CheckedLoadString(&appName, IDS_MB_APP_NAME);
|
||||||
if (MessageBox(msg, appName, MB_OKCANCEL | MB_ICONWARNING) != IDOK) {
|
if (MessageBox(msg, appName, MB_OKCANCEL | MB_ICONWARNING) != IDOK) {
|
||||||
LOGI(" User bailed after fdi-to-other warning");
|
LOGI(" User bailed after fdi-to-other warning");
|
||||||
goto bail;
|
goto bail;
|
||||||
|
@ -521,8 +521,8 @@ void MainWindow::OnToolsDiskConv(void)
|
||||||
{
|
{
|
||||||
/* converting from nibble to non-nibble format */
|
/* converting from nibble to non-nibble format */
|
||||||
CString msg, appName;
|
CString msg, appName;
|
||||||
msg.LoadString(IDS_NIBBLE_TO_SECTOR_WARNING);
|
CheckedLoadString(&msg, IDS_NIBBLE_TO_SECTOR_WARNING);
|
||||||
appName.LoadString(IDS_MB_APP_NAME);
|
CheckedLoadString(&appName, IDS_MB_APP_NAME);
|
||||||
if (MessageBox(msg, appName, MB_OKCANCEL | MB_ICONWARNING) != IDOK) {
|
if (MessageBox(msg, appName, MB_OKCANCEL | MB_ICONWARNING) != IDOK) {
|
||||||
LOGI(" User bailed after nibble-to-sector warning");
|
LOGI(" User bailed after nibble-to-sector warning");
|
||||||
goto bail;
|
goto bail;
|
||||||
|
@ -533,8 +533,8 @@ void MainWindow::OnToolsDiskConv(void)
|
||||||
{
|
{
|
||||||
/* converting between differing nibble formats */
|
/* converting between differing nibble formats */
|
||||||
CString msg, appName;
|
CString msg, appName;
|
||||||
msg.LoadString(IDS_DIFFERENT_NIBBLE_WARNING);
|
CheckedLoadString(&msg, IDS_DIFFERENT_NIBBLE_WARNING);
|
||||||
appName.LoadString(IDS_MB_APP_NAME);
|
CheckedLoadString(&appName, IDS_MB_APP_NAME);
|
||||||
if (MessageBox(msg, appName, MB_OKCANCEL | MB_ICONWARNING) != IDOK) {
|
if (MessageBox(msg, appName, MB_OKCANCEL | MB_ICONWARNING) != IDOK) {
|
||||||
LOGI(" User bailed after differing-nibbles warning");
|
LOGI(" User bailed after differing-nibbles warning");
|
||||||
goto bail;
|
goto bail;
|
||||||
|
@ -935,7 +935,7 @@ DIError MainWindow::CopyDiskImage(DiskImg* pDstImg, DiskImg* pSrcImg, bool bulk,
|
||||||
|
|
||||||
if (!bulk && numBadSectors != 0) {
|
if (!bulk && numBadSectors != 0) {
|
||||||
CString appName;
|
CString appName;
|
||||||
appName.LoadString(IDS_MB_APP_NAME);
|
CheckedLoadString(&appName, IDS_MB_APP_NAME);
|
||||||
errMsg.Format(L"Skipped %ld unreadable sector%ls.", numBadSectors,
|
errMsg.Format(L"Skipped %ld unreadable sector%ls.", numBadSectors,
|
||||||
numBadSectors == 1 ? L"" : L"s");
|
numBadSectors == 1 ? L"" : L"s");
|
||||||
MessageBox(errMsg, appName, MB_OK | MB_ICONWARNING);
|
MessageBox(errMsg, appName, MB_OK | MB_ICONWARNING);
|
||||||
|
@ -1017,7 +1017,7 @@ DIError MainWindow::CopyDiskImage(DiskImg* pDstImg, DiskImg* pSrcImg, bool bulk,
|
||||||
|
|
||||||
if (!bulk && numBadBlocks != 0) {
|
if (!bulk && numBadBlocks != 0) {
|
||||||
CString appName;
|
CString appName;
|
||||||
appName.LoadString(IDS_MB_APP_NAME);
|
CheckedLoadString(&appName, IDS_MB_APP_NAME);
|
||||||
errMsg.Format(L"Skipped %ld unreadable block%ls.", numBadBlocks,
|
errMsg.Format(L"Skipped %ld unreadable block%ls.", numBadBlocks,
|
||||||
numBadBlocks == 1 ? L"" : L"s");
|
numBadBlocks == 1 ? L"" : L"s");
|
||||||
MessageBox(errMsg, appName, MB_OK | MB_ICONWARNING);
|
MessageBox(errMsg, appName, MB_OK | MB_ICONWARNING);
|
||||||
|
@ -1168,7 +1168,7 @@ void MainWindow::OnToolsBulkDiskConv(void)
|
||||||
CString failed;
|
CString failed;
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
failed.LoadString(IDS_FAILED);
|
CheckedLoadString(&failed, IDS_FAILED);
|
||||||
errMsg += "\n\nSource file: ";
|
errMsg += "\n\nSource file: ";
|
||||||
errMsg += pathName;
|
errMsg += pathName;
|
||||||
errMsg += "\n\nClick OK to skip this and continue, or Cancel to "
|
errMsg += "\n\nClick OK to skip this and continue, or Cancel to "
|
||||||
|
@ -1521,7 +1521,7 @@ void MainWindow::OnToolsSSTMerge(void)
|
||||||
OFN_OVERWRITEPROMPT|OFN_NOREADONLYRETURN|OFN_HIDEREADONLY,
|
OFN_OVERWRITEPROMPT|OFN_NOREADONLYRETURN|OFN_HIDEREADONLY,
|
||||||
L"All Files (*.*)|*.*||", this);
|
L"All Files (*.*)|*.*||", this);
|
||||||
|
|
||||||
appName.LoadString(IDS_MB_APP_NAME);
|
CheckedLoadString(&appName, IDS_MB_APP_NAME);
|
||||||
|
|
||||||
trackBuf = new uint8_t[kSSTNumTracks * kSSTTrackLen];
|
trackBuf = new uint8_t[kSSTNumTracks * kSSTTrackLen];
|
||||||
if (trackBuf == NULL)
|
if (trackBuf == NULL)
|
||||||
|
@ -1537,7 +1537,7 @@ void MainWindow::OnToolsSSTMerge(void)
|
||||||
goto bail;
|
goto bail;
|
||||||
LOGI("FOUND %ld bad bytes in part 0", badCount);
|
LOGI("FOUND %ld bad bytes in part 0", badCount);
|
||||||
if (badCount > kBadCountThreshold) {
|
if (badCount > kBadCountThreshold) {
|
||||||
errMsg.LoadString(IDS_BAD_SST_IMAGE);
|
CheckedLoadString(&errMsg, IDS_BAD_SST_IMAGE);
|
||||||
if (MessageBox(errMsg, appName, MB_OKCANCEL | MB_ICONWARNING) != IDOK)
|
if (MessageBox(errMsg, appName, MB_OKCANCEL | MB_ICONWARNING) != IDOK)
|
||||||
goto bail;
|
goto bail;
|
||||||
}
|
}
|
||||||
|
@ -1549,7 +1549,7 @@ void MainWindow::OnToolsSSTMerge(void)
|
||||||
goto bail;
|
goto bail;
|
||||||
LOGI("FOUND %ld bad bytes in part 1", badCount);
|
LOGI("FOUND %ld bad bytes in part 1", badCount);
|
||||||
if (badCount > kBadCountThreshold) {
|
if (badCount > kBadCountThreshold) {
|
||||||
errMsg.LoadString(IDS_BAD_SST_IMAGE);
|
CheckedLoadString(&errMsg, IDS_BAD_SST_IMAGE);
|
||||||
if (MessageBox(errMsg, appName, MB_OKCANCEL | MB_ICONWARNING) != IDOK)
|
if (MessageBox(errMsg, appName, MB_OKCANCEL | MB_ICONWARNING) != IDOK)
|
||||||
goto bail;
|
goto bail;
|
||||||
}
|
}
|
||||||
|
@ -1892,7 +1892,7 @@ void MainWindow::VolumeCopier(bool openFile)
|
||||||
/* flush current archive in case that's what we're planning to edit */
|
/* flush current archive in case that's what we're planning to edit */
|
||||||
OnFileSave();
|
OnFileSave();
|
||||||
|
|
||||||
failed.LoadString(IDS_FAILED);
|
CheckedLoadString(&failed, IDS_FAILED);
|
||||||
|
|
||||||
if (!openFile) {
|
if (!openFile) {
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -100,8 +100,8 @@ void TwoImgPropsDialog::DoDataExchange(CDataExchange* pDX)
|
||||||
|
|
||||||
CString appStr, errMsg;
|
CString appStr, errMsg;
|
||||||
if (dosVolNum < 1 || dosVolNum > 254) {
|
if (dosVolNum < 1 || dosVolNum > 254) {
|
||||||
appStr.LoadString(IDS_MB_APP_NAME);
|
CheckedLoadString(&appStr, IDS_MB_APP_NAME);
|
||||||
errMsg.LoadString(IDS_VALID_VOLNAME_DOS);
|
CheckedLoadString(&errMsg, IDS_VALID_VOLNAME_DOS);
|
||||||
MessageBox(errMsg, appStr, MB_OK);
|
MessageBox(errMsg, appStr, MB_OK);
|
||||||
pDX->Fail();
|
pDX->Fail();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -26,10 +26,10 @@ BOOL UseSelectionDialog::OnInitDialog(void)
|
||||||
|
|
||||||
/* set the string using a string table entry */
|
/* set the string using a string table entry */
|
||||||
if (fSelectedCount == 1) {
|
if (fSelectedCount == 1) {
|
||||||
str.LoadString(fSelCountID);
|
CheckedLoadString(&str, fSelCountID);
|
||||||
pWnd->SetWindowText(str);
|
pWnd->SetWindowText(str);
|
||||||
} else {
|
} else {
|
||||||
str.LoadString(fSelCountsID);
|
CheckedLoadString(&str, fSelCountsID);
|
||||||
selStr.Format((LPCWSTR) str, fSelectedCount);
|
selStr.Format((LPCWSTR) str, fSelectedCount);
|
||||||
pWnd->SetWindowText(selStr);
|
pWnd->SetWindowText(selStr);
|
||||||
|
|
||||||
|
@ -38,17 +38,17 @@ BOOL UseSelectionDialog::OnInitDialog(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set the other strings */
|
/* set the other strings */
|
||||||
str.LoadString(fTitleID);
|
CheckedLoadString(&str, fTitleID);
|
||||||
SetWindowText(str);
|
SetWindowText(str);
|
||||||
|
|
||||||
pWnd = GetDlgItem(IDC_USE_ALL);
|
pWnd = GetDlgItem(IDC_USE_ALL);
|
||||||
ASSERT(pWnd != NULL);
|
ASSERT(pWnd != NULL);
|
||||||
str.LoadString(fAllID);
|
CheckedLoadString(&str, fAllID);
|
||||||
pWnd->SetWindowText(str);
|
pWnd->SetWindowText(str);
|
||||||
|
|
||||||
pWnd = GetDlgItem(IDOK);
|
pWnd = GetDlgItem(IDOK);
|
||||||
ASSERT(pWnd != NULL);
|
ASSERT(pWnd != NULL);
|
||||||
str.LoadString(fOkLabelID);
|
CheckedLoadString(&str, fOkLabelID);
|
||||||
pWnd->SetWindowText(str);
|
pWnd->SetWindowText(str);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -1122,7 +1122,7 @@ void ViewFilesDialog::OnFviewPrint(void)
|
||||||
*/
|
*/
|
||||||
if (dc.Attach(dlg.GetPrinterDC()) != TRUE) {
|
if (dc.Attach(dlg.GetPrinterDC()) != TRUE) {
|
||||||
CString msg;
|
CString msg;
|
||||||
msg.LoadString(IDS_PRINTER_NOT_USABLE);
|
CheckedLoadString(&msg, IDS_PRINTER_NOT_USABLE);
|
||||||
ShowFailureMsg(this, msg, IDS_FAILED);
|
ShowFailureMsg(this, msg, IDS_FAILED);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -265,7 +265,7 @@ void VolumeCopyDialog::ScanDiskInfo(bool scanTop)
|
||||||
dierr = fpDiskFS->Initialize(fpDiskImg, DiskFS::kInitFull);
|
dierr = fpDiskFS->Initialize(fpDiskImg, DiskFS::kInitFull);
|
||||||
if (dierr != kDIErrNone) {
|
if (dierr != kDIErrNone) {
|
||||||
CString appName, msg;
|
CString appName, msg;
|
||||||
appName.LoadString(IDS_MB_APP_NAME);
|
CheckedLoadString(&appName, IDS_MB_APP_NAME);
|
||||||
msg.Format(L"Warning: error during disk scan: %hs.",
|
msg.Format(L"Warning: error during disk scan: %hs.",
|
||||||
DiskImgLib::DIStrError(dierr));
|
DiskImgLib::DIStrError(dierr));
|
||||||
fpWaitDlg->MessageBox(msg, appName, MB_OK | MB_ICONEXCLAMATION);
|
fpWaitDlg->MessageBox(msg, appName, MB_OK | MB_ICONEXCLAMATION);
|
||||||
|
@ -501,7 +501,7 @@ void VolumeCopyDialog::OnCopyToFile(void)
|
||||||
dierr = pMain->CopyDiskImage(&dstImg, pSrcImg, false, false, pProgressDialog);
|
dierr = pMain->CopyDiskImage(&dstImg, pSrcImg, false, false, pProgressDialog);
|
||||||
if (dierr != kDIErrNone) {
|
if (dierr != kDIErrNone) {
|
||||||
if (dierr == kDIErrCancelled) {
|
if (dierr == kDIErrCancelled) {
|
||||||
errMsg.LoadString(IDS_OPERATION_CANCELLED);
|
CheckedLoadString(&errMsg, IDS_OPERATION_CANCELLED);
|
||||||
ShowFailureMsg(pProgressDialog, errMsg, IDS_CANCELLED);
|
ShowFailureMsg(pProgressDialog, errMsg, IDS_CANCELLED);
|
||||||
// remove the partially-written file
|
// remove the partially-written file
|
||||||
dstImg.CloseImage();
|
dstImg.CloseImage();
|
||||||
|
@ -573,7 +573,7 @@ void VolumeCopyDialog::OnCopyFromFile(void)
|
||||||
bool needReload = false;
|
bool needReload = false;
|
||||||
bool isPartial = false;
|
bool isPartial = false;
|
||||||
|
|
||||||
warning.LoadString(IDS_WARNING);
|
CheckedLoadString(&warning, IDS_WARNING);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get the DiskImg and DiskFS pointers for the selected partition out of
|
* Get the DiskImg and DiskFS pointers for the selected partition out of
|
||||||
|
@ -683,7 +683,7 @@ void VolumeCopyDialog::OnCopyFromFile(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (srcImg.GetNumBlocks() != pDstImg->GetNumBlocks()) {
|
if (srcImg.GetNumBlocks() != pDstImg->GetNumBlocks()) {
|
||||||
errMsg.LoadString(IDS_WARNING);
|
//errMsg.LoadString(IDS_WARNING);
|
||||||
errMsg.Format(L"The disk image file has %ld blocks, but the target"
|
errMsg.Format(L"The disk image file has %ld blocks, but the target"
|
||||||
L" volume holds %ld blocks. The leftover space may be"
|
L" volume holds %ld blocks. The leftover space may be"
|
||||||
L" wasted, and non-ProDOS volumes may not be identified"
|
L" wasted, and non-ProDOS volumes may not be identified"
|
||||||
|
@ -697,7 +697,7 @@ void VolumeCopyDialog::OnCopyFromFile(void)
|
||||||
isPartial = true;
|
isPartial = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
errMsg.LoadString(IDS_WARNING); // TODO: what does this accomplish?
|
//errMsg.LoadString(IDS_WARNING);
|
||||||
errMsg.Format(L"You are about to overwrite volume %ls with the"
|
errMsg.Format(L"You are about to overwrite volume %ls with the"
|
||||||
L" contents of '%ls'. This will destroy all data on"
|
L" contents of '%ls'. This will destroy all data on"
|
||||||
L" %ls. Are you sure you wish to continue?",
|
L" %ls. Are you sure you wish to continue?",
|
||||||
|
@ -755,7 +755,7 @@ void VolumeCopyDialog::OnCopyFromFile(void)
|
||||||
pProgressDialog);
|
pProgressDialog);
|
||||||
if (dierr != kDIErrNone) {
|
if (dierr != kDIErrNone) {
|
||||||
if (dierr == kDIErrCancelled) {
|
if (dierr == kDIErrCancelled) {
|
||||||
errMsg.LoadString(IDS_OPERATION_CANCELLED);
|
CheckedLoadString(&errMsg, IDS_OPERATION_CANCELLED);
|
||||||
ShowFailureMsg(pProgressDialog, errMsg, IDS_CANCELLED);
|
ShowFailureMsg(pProgressDialog, errMsg, IDS_CANCELLED);
|
||||||
} else {
|
} else {
|
||||||
errMsg.Format(L"Copy failed: %hs.", DiskImgLib::DIStrError(dierr));
|
errMsg.Format(L"Copy failed: %hs.", DiskImgLib::DIStrError(dierr));
|
||||||
|
|
|
@ -95,7 +95,7 @@ void MainWindow::OnFileScan(void)
|
||||||
{
|
{
|
||||||
if (0) {
|
if (0) {
|
||||||
CString msg;
|
CString msg;
|
||||||
msg.LoadString(IDS_MUST_REGISTER);
|
CheckedLoadString(&msg, IDS_MUST_REGISTER);
|
||||||
ShowFailureMsg(this, msg, IDS_APP_TITLE);
|
ShowFailureMsg(this, msg, IDS_APP_TITLE);
|
||||||
} else {
|
} else {
|
||||||
ScanFiles();
|
ScanFiles();
|
||||||
|
@ -274,7 +274,7 @@ void MainWindow::ScanFiles(void)
|
||||||
CString doneMsg = L"Processing completed.";
|
CString doneMsg = L"Processing completed.";
|
||||||
CString appName;
|
CString appName;
|
||||||
|
|
||||||
appName.LoadString(IDS_APP_TITLE);
|
CheckedLoadString(&appName, IDS_APP_TITLE);
|
||||||
scanOpts.pProgress->MessageBox(doneMsg, appName, MB_OK|MB_ICONINFORMATION);
|
scanOpts.pProgress->MessageBox(doneMsg, appName, MB_OK|MB_ICONINFORMATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -390,7 +390,7 @@ void ShowFailureMsg(CWnd* pWnd, const CString& msg, int titleStrID)
|
||||||
{
|
{
|
||||||
CString failed;
|
CString failed;
|
||||||
|
|
||||||
failed.LoadString(titleStrID);
|
CheckedLoadString(&failed, titleStrID);
|
||||||
pWnd->MessageBox(msg, failed, MB_OK | MB_ICONERROR);
|
pWnd->MessageBox(msg, failed, MB_OK | MB_ICONERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -409,6 +409,14 @@ bool IsWin9x(void)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CheckedLoadString(CString* pString, UINT nID)
|
||||||
|
{
|
||||||
|
if (!pString->LoadString(nID)) {
|
||||||
|
LOGW("WARNING: failed to load string %u", nID);
|
||||||
|
*pString = L"!Internal failure!";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ===========================================================================
|
* ===========================================================================
|
||||||
|
|
|
@ -187,6 +187,11 @@ void ShowFailureMsg(CWnd* pWnd, const CString& msg, int titleStrID);
|
||||||
*/
|
*/
|
||||||
bool IsWin9x(void);
|
bool IsWin9x(void);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Wrapper for CString::LoadString that checks the return value and logs a
|
||||||
|
* complaint if the load fails.
|
||||||
|
*/
|
||||||
|
void CheckedLoadString(CString* pString, UINT nID);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ====================================
|
* ====================================
|
||||||
|
|
Loading…
Reference in New Issue