}
// \8f\91\8cÉ\82ð\8aJ\82\81B
- wxFileName fnArchive(this->cmdLine.GetParam(0));
- fnArchive.Normalize(wxPATH_NORM_ALL, this->szCurrentPath);
- e.SetString(fnArchive.GetFullPath());
+ this->fnArchive = wxFileName(this->cmdLine.GetParam(0));
+ this->fnArchive.Normalize(wxPATH_NORM_ALL, this->szCurrentPath);
this->OnArcOpen(e);
if (this->cmdLine.Found(wxT("x")))
{
}
}
+ this->OnArcClose(e);
mkDlg.InitDialog();
mkDlg.cbDir->SetValue(swInfo.fnDestinationDirectory.GetPath());
// \8f\91\8cÉ\96¼\82Í\83t\83@\83C\83\8b\96¼\82Ì\8ag\92£\8eq\82æ\82è\91O\81A\82à\82µ\82\82Í\83f\83B\83\8c\83N\83g\83\8a\96¼\81B
- wxFileName fnFirstFile(mkDlg.files[0]);
- mkDlg.cbFileName->SetValue(mkDlg.files.GetCount() == 1 ? (fnFirstFile.GetName().IsEmpty() ? fnFirstFile.GetDirs().Last() : fnFirstFile.GetName()) : swInfo.fnDestinationDirectory.GetDirs().Last());
+ this->fnArchive = wxFileName(mkDlg.files[0]);
+ this->fnArchive.SetName(mkDlg.files.GetCount() == 1 ? (this->fnArchive.GetName().IsEmpty() ? this->fnArchive.GetDirs().Last() : this->fnArchive.GetName()) : swInfo.fnDestinationDirectory.GetDirs().Last());
+ this->fnArchive.SetPath(swInfo.fnDestinationDirectory.GetPath());
+ mkDlg.cbFileName->SetValue(this->fnArchive.GetName());
// \83_\83C\83A\83\8d\83O\82ð\95\\8e¦\81B
if (mkDlg.ShowModal() == wxID_CANCEL)
// TPI\82ð\93Ç\82Ý\8d\9e\82Ý\81B
int nSelected = mkDlg.chType->GetSelection();
- wxFileName fnArchive = wxFileName::DirName(mkDlg.cbDir->GetValue());
- fnArchive.SetName(mkDlg.cbFileName->GetValue());
- fnArchive.SetExt(swInfo.fMakeSFX ? EXE_EXT : mkDlg.afInfo[nSelected].szSuffix.BeforeFirst(wxT(';')));
- if (! tpi.InitLibrary(mkDlg.afInfo[nSelected].szTPIName, fnArchive.GetFullPath(), mkDlg.afInfo[nSelected].llTypeId))
+ this->fnArchive = wxFileName(mkDlg.cbDir->GetValue(), mkDlg.cbFileName->GetValue(), swInfo.fMakeSFX ? EXE_EXT : mkDlg.afInfo[nSelected].szSuffix.BeforeFirst(wxT(';')));
+ if (! tpi.InitLibrary(mkDlg.afInfo[nSelected].szTPIName, this->fnArchive.GetFullPath(), mkDlg.afInfo[nSelected].llTypeId))
{
::ErrDlg(wxT("InitLibrary()!"), this);
return;
ProcessDialog procDlg;
procDlg.InitDialog();
procDlg.Show(true);
- int nErrorCode = this->ErrorCheck(tpi.Command(TPI_COMMAND_ADD, & swInfo, fnArchive.GetFullPath(), mkDlg.files));
+ int nErrorCode = this->ErrorCheck(tpi.Command(TPI_COMMAND_ADD, & swInfo, this->fnArchive.GetFullPath(), mkDlg.files));
procDlg.Show(false);
tpi.FreeLibrary();
if (nErrorCode != TPI_ERROR_SUCCESS)
}
// \8fI\97¹\82µ\82È\82¢\8fê\8d\87\82Í\8f\91\8cÉ\82ð\8aJ\82\81B
- e.SetString(fnArchive.GetFullPath());
this->OnArcOpen(e);
}
void MainFrame::OnArcOpen(wxCommandEvent& e)
{
// \8f\91\8cÉ\82ð\91I\91ð\81B
- wxString szFileName = e.GetString();
- if (szFileName.IsEmpty())
+ if (e.GetId() == XRCID("Arc_Open"))
{
wxFileDialog fd(this);
fd.SetDirectory(this->conf.Read(wxT("LastOpenPath"), ::wxGetCwd()));
return;
}
this->conf.Write(wxT("LastOpenPath"), fd.GetDirectory());
- szFileName = fd.GetPath();
+ this->fnArchive = wxFileName(fd.GetPath());
}
this->OnArcClose(e);
piInfo.uMessage = TPI_MESSAGE_STATUS;
piInfo.uStatus = 0x1000;
piInfo.llProcessedSize = 0;
- piInfo.fiInfo.fnFileName = wxFileName::FileName(szFileName);
- piInfo.fiInfo.llUnpackedSize = this->LoadTPI(szFileName);
+ piInfo.fiInfo.fnFileName = this->fnArchive;
+ piInfo.fiInfo.llUnpackedSize = this->LoadTPI(this->fnArchive.GetFullPath());
if ((signed) piInfo.fiInfo.llUnpackedSize.ToULong() == -1)
{
procDlg.Show(false);
this->fileinfo.Alloc(piInfo.fiInfo.llUnpackedSize.ToULong());
// \8f\91\8cÉ\82ð\8aJ\82\81B
- if (tpi.OpenArchive(szFileName) != TPI_ERROR_SUCCESS)
+ if (tpi.OpenArchive(this->fnArchive.GetFullPath()) != TPI_ERROR_SUCCESS)
{
procDlg.Show(false);
tpi.FreeLibrary();
// \83X\83e\81[\83^\83X\83o\81[\90Ý\92è\81B
this->statusbar->SetStatusText(aiInfo.fiInfo.szTypeName, 0);
this->statusbar->SetStatusText(wxString::Format(wxT("%d file(s)"), this->fileinfo.Count()), 1);
- this->statusbar->SetStatusText(aiInfo.llUnpackedSize.ToString() + wxT(" B -> ") + aiInfo.llPackedSize.ToString() + wxT(" B"), 2);
+ this->statusbar->SetStatusText(aiInfo.llUnpackedSize.ToString() + wxT(" B -> ") + aiInfo.llPackedSize.ToString() + wxT(" B"), 2);
this->statusbar->SetStatusText(wxString::Format(wxT("%3.1f%%"), aiInfo.wCompressRatio / 10.0), 3);
- this->statusbar->SetStatusText(szFileName, 4);
+ this->statusbar->SetStatusText(this->fnArchive.GetFullPath(), 4);
// \83c\81[\83\8b\83o\81[\81E\83\81\83j\83\85\81[\83o\81[\90Ý\92è\81B
SetMenuToolState("Arc_Close", true);
swInfo.fnDestinationDirectory = wxFileName::DirName(fd.GetDirectory());
swInfo.fMakeSFX = false;
swInfo.pCustomSwitches = NULL;
- wxString szArcName = this->statusbar->GetStatusText(4);
ProcessDialog procDlg;
procDlg.InitDialog();
procDlg.Show(true);
- this->ErrorCheck(this->tpi.Command(TPI_COMMAND_ADD, & swInfo, szArcName, files));
+ this->ErrorCheck(this->tpi.Command(TPI_COMMAND_ADD, & swInfo, this->fnArchive.GetFullPath(), files));
procDlg.Show(false);
// \8f\91\8cÉ\82ð\8dÄ\93Ç\82Ý\8d\9e\82Ý\81B
- e.SetString(szArcName);
this->OnArcOpen(e);
}
swInfo.fMakeSFX = e.GetId() == XRCID("Arc_SFX");
// \95Û\91¶\90æ\82ð\90q\82Ë\82é\81B
- wxFileName fnArchive(this->statusbar->GetStatusText(4));
- wxFileDialog fd(this, swInfo.fMakeSFX ? wxT("Save as SFX") : wxT("Save as normal archive"), fnArchive.GetPath(), fnArchive.GetName() + (swInfo.fMakeSFX ? EXE_EXT : (wxString) wxEmptyString));
+ wxFileDialog fd(this, swInfo.fMakeSFX ? wxT("Save as SFX") : wxT("Save as normal archive"), this->fnArchive.GetPath(), this->fnArchive.GetName() + (swInfo.fMakeSFX ? EXE_EXT : (wxString) wxEmptyString));
fd.SetWindowStyleFlag(wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
if (fd.ShowModal() == wxID_CANCEL)
{
ProcessDialog procDlg;
procDlg.InitDialog();
procDlg.Show(true);
- this->ErrorCheck(this->tpi.Command(swInfo.fMakeSFX ? TPI_COMMAND_SFX : TPI_COMMAND_UNSFX, & swInfo, fnArchive.GetFullPath(), files));
+ this->ErrorCheck(this->tpi.Command(swInfo.fMakeSFX ? TPI_COMMAND_SFX : TPI_COMMAND_UNSFX, & swInfo, this->fnArchive.GetFullPath(), files));
procDlg.Show(false);
}
if (szDestDirBase == wxT("-----"))
{
// \8f\91\8cÉ\83\8b\81[\83g\82Ì\82Æ\82«\82Í\8f\91\8cÉ\96¼\82É\82µ\82Ä\82¨\82\81B
- szDestDirBase = wxFileName::FileName(this->statusbar->GetStatusText(4)).GetName();
+ szDestDirBase = this->fnArchive.GetName();
}
swInfo.fnDestinationDirectory = MakeDirPath(wxFileName::DirName(::wxGetCwd()), szDestDirBase, true);
if (! swInfo.fnDestinationDirectory.IsOk())
// \95K\97v\82È\82ç\8f\91\8cÉ\96¼\82Å\83f\83B\83\8c\83N\83g\83\8a\82ð\8dì\90¬\82·\82é\81B
if (WillMakeDirByArcName(this, & mkDlg))
{
- swInfo.fnDestinationDirectory = MakeDirPath(swInfo.fnDestinationDirectory, wxFileName::FileName(this->statusbar->GetStatusText(4)).GetName(), true);
+ swInfo.fnDestinationDirectory = MakeDirPath(swInfo.fnDestinationDirectory, this->fnArchive.GetName(), true);
if (! swInfo.fnDestinationDirectory.IsOk())
{
::ErrDlg(wxT("Unable to make the destination directory!"), this);
ProcessDialog procDlg;
procDlg.InitDialog();
procDlg.Show(true);
- int nErrorCode = this->ErrorCheck(this->tpi.Command(TPI_COMMAND_EXTRACT, & swInfo, this->statusbar->GetStatusText(4), mkDlg.files));
+ int nErrorCode = this->ErrorCheck(this->tpi.Command(TPI_COMMAND_EXTRACT, & swInfo, this->fnArchive.GetFullPath(), mkDlg.files));
procDlg.Show(false);
if (nMode == 0)
// \8ae\8eí\90Ý\92è\81B
TPI_SWITCHES swInfo;
- wxString szArcName = this->statusbar->GetStatusText(4);
wxArrayString files = MakeTargetFileList(this, false);
ProcessDialog procDlg;
procDlg.InitDialog();
procDlg.Show(true);
- this->ErrorCheck(this->tpi.Command(TPI_COMMAND_DELETE, & swInfo, szArcName, files));
+ this->ErrorCheck(this->tpi.Command(TPI_COMMAND_DELETE, & swInfo, this->fnArchive.GetFullPath(), files));
procDlg.Show(false);
// \8f\91\8cÉ\82ð\8dÄ\93Ç\82Ý\8d\9e\82Ý\82·\82é\81B
- e.SetString(szArcName);
this->OnArcOpen(e);
}
ProcessDialog procDlg;
procDlg.InitDialog();
procDlg.Show(true);
- if (this->ErrorCheck(this->tpi.Command(TPI_COMMAND_TEST, & swInfo, this->statusbar->GetStatusText(4), files)) == TPI_ERROR_SUCCESS)
+ if (this->ErrorCheck(this->tpi.Command(TPI_COMMAND_TEST, & swInfo, this->fnArchive.GetFullPath(), files)) == TPI_ERROR_SUCCESS)
{
::MsgDlg(wxT("This is a correct archive."), & procDlg, wxICON_INFORMATION);
}
ProcessDialog procDlg;
procDlg.InitDialog();
procDlg.Show(true);
- this->ErrorCheck(this->tpi.Command(TPI_COMMAND_REPAIR, & swInfo, this->statusbar->GetStatusText(4), files));
+ this->ErrorCheck(this->tpi.Command(TPI_COMMAND_REPAIR, & swInfo, this->fnArchive.GetFullPath(), files));
procDlg.Show(false);
}
// \83C\83x\83\93\83g\83n\83\93\83h\83\89\88È\8aO\81B
-int MainFrame::LoadTPI(wxString & szFileName)
+int MainFrame::LoadTPI(wxString szFileName)
{
// TPI\82ð\93Ç\82Ý\8d\9e\82Ý\81B
wxFileSystem fs;