fnArchive.SetExt(swInfo.fMakeSFX ? (wxString) EXE_EXT : mkDlg.defext[nSelected]);
if (! tpi.InitLibrary(mkDlg.libname[nSelected], fnArchive.GetFullPath(), mkDlg.nLibNum[nSelected]))
{
- ::wxMessageBox(wxT("Fault: InitLibrary()!"));
+ ::ErrDlg(wxT("InitLibrary()!"), this);
return;
}
swInfo.fnDestinationDirectory = MakeDirPath(swInfo.fnDestinationDirectory, wxFileName::FileName(this->statusbar->GetStatusText(5)).GetName(), true);
if (! swInfo.fnDestinationDirectory.IsOk())
{
- ::wxMessageBox(wxT("Fault: Unable to make the destination directory!"));
+ ::ErrDlg(wxT("Unable to make the destination directory!"), this);
return;
}
}
return;
}
- if (::wxMessageBox(wxT("Are you sure to delete selected files?"), wxMessageBoxCaptionStr, wxYES_NO | wxICON_EXCLAMATION, this) == wxNO)
+ if (::AskDlg(wxT("Are you sure to delete selected files?"), this) == wxNO)
{
return;
}
procDlg.Show(true);
if (this->ErrorCheck(this->tpi.Command(TPI_COMMAND_TEST, & swInfo, this->statusbar->GetStatusText(5), files)) == TPI_ERROR_SUCCESS)
{
- ::wxMessageBox(wxT("This is a correct archive."), wxT("Frontend"), wxOK | wxCENTRE | wxICON_INFORMATION, this);
+ ::MsgDlg(wxT("This is a correct archive."), this, wxICON_INFORMATION);
}
procDlg.Show(false);
}
wxFileType * ftFile = wxTheMimeTypesManager->GetFileTypeFromExtension(wxFileName::FileName(files[0]).GetExt());
if (! ftFile)
{
- ::wxMessageBox(wxT("Fault: Unable to get the file type!"));
+ ::ErrDlg(wxT("Unable to get the file type!"), this);
return;
}
swInfo.fnDestinationDirectory = MakeDirPath(wxFileName::DirName(::wxGetCwd()), wxT("tpi_tmp"), true);
if (! swInfo.fnDestinationDirectory.IsOk())
{
- ::wxMessageBox(wxT("Fault: Unable to make the temporary directory!"));
+ ::ErrDlg(wxT("Unable to make the temporary directory!"), this);
return;
}
swInfo.fnDestinationDirectory = MakeDirPath(wxFileName::DirName(::wxGetCwd()), wxT("tpi_tmp"), true);
if (! swInfo.fnDestinationDirectory.IsOk())
{
- ::wxMessageBox(wxT("Fault: Unable to make the temporary directory!"));
+ ::ErrDlg(wxT("Unable to make the temporary directory!"), this);
return;
}
{
procDlg.Show(false);
tpi.FreeLibrary();
- ::wxMessageBox(wxT("Fault : No plug-in supporting this archive was found!"));
+ ::ErrDlg(wxT("No plug-in supporting this archive was found!"), this);
return;
}
{
procDlg.Show(false);
tpi.FreeLibrary();
- ::wxMessageBox(wxT("Fault : OpenArchive()!"));
+ ::ErrDlg(wxT("OpenArchive()!"), this);
return;
}
tpi.CloseArchive();
wxCommandEvent e;
this->OnArcClose(e);
- ::wxMessageBox(wxT("Fault : Canceled by user!"));
+ ::ErrDlg(wxT("Canceled by user!"), this);
return;
}
if (piInfo.fiInfo.fnFileName.GetPathWithSep().Find(wxT("..")) != wxNOT_FOUND)
{
piInfo.fiInfo.uDanger = TRUE;
- ::wxMessageBox(wxT("This archive may have Directory Traversal Vulnerability(DTV) problem, and some danger files may be extracted to the unexpected system directory! You should use the \"Ignore file pathes\" option when extracting this archive.\nDanger file is:\n" + piInfo.fiInfo.szStoredName), wxMessageBoxCaptionStr, wxICON_EXCLAMATION);
+ ::WrnDlg(wxT("This archive may have Directory Traversal Vulnerability(DTV) problem, and some danger files may be extracted to the unexpected system directory! You should use the \"Ignore file pathes\" option when extracting this archive.\nDanger file is:\n") + piInfo.fiInfo.szStoredName, this);
}
// \8bó\94\92\82Ì\98A\91±\82É\82æ\82é\8ag\92£\8eq\8bU\91\95\82ð\8c\9f\8d¸\81B
if (piInfo.fiInfo.fnFileName.GetFullName().Find(wxT(" ")) != wxNOT_FOUND)
{
piInfo.fiInfo.uDanger = TRUE;
- ::wxMessageBox(wxT("This archive may contain extension-disguised files whose real extension is hidden by using many blank charactor and you may mistake that it is a \"safe\" file. Don\'t execute these files carelessly.\nDanger file is:\n" + piInfo.fiInfo.szStoredName), wxMessageBoxCaptionStr, wxICON_EXCLAMATION);
+ ::WrnDlg(wxT("This archive may contain extension-disguised files whose real extension is hidden by using many blank charactor and you may mistake that it is a \"safe\" file. Don\'t execute these files carelessly.\nDanger file is:\n") + piInfo.fiInfo.szStoredName, this);
}
// Unicode\90§\8cä\95¶\8e\9a\82ð\8c\9f\8d¸\81B
for (wxChar c = 0x200c; c <= 0x206f; c++)
if (piInfo.fiInfo.fnFileName.GetFullName().Find(c) != wxNOT_FOUND)
{
piInfo.fiInfo.uDanger = TRUE;
- ::wxMessageBox(wxT("This archive may contain extension-disguised files whose real extension is hidden by using Unicode control character and you may mistake that it is a \"safe\" file. Don\'t execute these files carelessly.\nDanger file is:\n" + piInfo.fiInfo.szStoredName), wxMessageBoxCaptionStr, wxICON_EXCLAMATION);
+ ::WrnDlg(wxT("This archive may contain extension-disguised files whose real extension is hidden by using Unicode control character and you may mistake that it is a \"safe\" file. Don\'t execute these files carelessly.\nDanger file is:\n") + piInfo.fiInfo.szStoredName, this);
}
switch (c)
{
{
procDlg.Show(false);
tpi.FreeLibrary();
- ::wxMessageBox(wxT("Fault : GetArchiveInformation()!"));
+ ::ErrDlg(wxT("GetArchiveInformation()!"), this);
return;
}
// \8f\91\8cÉ\82ð\95Â\82¶\82é\81B
if (tpi.CloseArchive() != TPI_ERROR_SUCCESS)
{
- ::wxMessageBox(wxT("Fault : CloseArchive()!"));
+ ::ErrDlg(wxT("CloseArchive()!"), this);
}
// \83R\81[\83\8b\83o\83b\83N\8aÖ\90\94\82ð\90Ý\92è\81B
if (tpi.SetCallbackProc(TPICallbackProc) != TPI_ERROR_SUCCESS)
{
- ::wxMessageBox(wxT("Fault : SetCallbackProc()!"));
+ ::ErrDlg(wxT("SetCallbackProc()!"), this);
}
// UI\8ae\8eí\90Ý\92è\81B
int MainFrame::ErrorCheck(int nErrorCode)
{
- wxString s;
switch (nErrorCode)
{
case TPI_ERROR_SUCCESS:
- return TPI_ERROR_SUCCESS;
+ break;
case TPI_ERROR_D_UNSUPPORTED:
- s = wxT("Sorry, this function is not supported yet.");
+ ::ErrDlg(wxT("Sorry, this function is not supported yet."), this);
break;
case TPI_ERROR_D_SKIPPED:
- s = wxT("This operation is canceled by the user.");
+ ::ErrDlg(wxT("This operation is canceled by the user."), this);
break;
default:
- s.Printf(wxT("ErrorCode:%d"), nErrorCode);
+ ::ErrDlg(wxT("ErrorCode:") + wxString::Format(wxT("%d"), nErrorCode), this);
}
- ::wxMessageBox(s, wxT("Frontend"), wxOK | wxCENTRE | wxICON_ERROR, this);
return nErrorCode;
}