this->gFile = XRCCTRL(* this, "gFile", wxGauge);\r
this->gArchive = XRCCTRL(* this, "gArchive", wxGauge);\r
this->fCancel = false;\r
+ this->nOverwriteMode = wxID_OK;\r
+ this->Update();\r
g_procDlg = this;\r
\r
::wxXmlResource::Get()->Unload(L_DIR_S_XRC wxT("dlg_process.xrc"));\r
this->ebSource->ChangeValue(piInfo->fiInfo.fnFileName.GetFullPath());\r
this->gArchive->SetRange(piInfo->fiInfo.nUnpackedSize);\r
this->gArchive->SetValue(0);\r
+ this->Update();\r
s_nInterval = piInfo->fiInfo.nUnpackedSize / 10;\r
break;\r
case 0x1001:\r
}\r
case TPI_PARAM_NEXTVOLUME:\r
{\r
- wxFileDialog fd(this, _("Select next volume of: ") + piInfo->fiInfo.fnFileName.GetFullName());\r
- fd.SetWindowStyleFlag(wxFD_FILE_MUST_EXIST);\r
+ wxFileDialog fd(this, _("Choose next volume of: ") + piInfo->fiInfo.fnFileName.GetFullName(), piInfo->fiInfo.fnFileName.GetPath(), wxEmptyString, wxFileSelectorDefaultWildcardStr, wxFD_OPEN | wxFD_FILE_MUST_EXIST);\r
if (fd.ShowModal() == wxID_CANCEL)\r
{\r
this->fCancel = true;\r
if (piInfo->fnDestination.FileExists() || ::wxDirExists(piInfo->fnDestination.GetFullPath()))\r
{\r
// 上書き確認を行う。\r
- static int nMode = wxID_OK;\r
bool bPerm = false;\r
- if (nMode == wxID_OK)\r
+ if (this->nOverwriteMode == wxID_OK)\r
{\r
OverwriteDialog odDlg;\r
odDlg.fnExist = & piInfo->fnDestination;\r
odDlg.tmWrite = & piInfo->fiInfo.tmModified;\r
odDlg.nWriteSize = piInfo->fiInfo.nUnpackedSize;\r
\r
- nMode = odDlg.ShowModal();\r
+ this->nOverwriteMode = odDlg.ShowModal();\r
bPerm = odDlg.cbApplyAll->IsChecked();\r
}\r
- switch (nMode)\r
+ else\r
+ {\r
+ bPerm = true;\r
+ }\r
+ switch (this->nOverwriteMode)\r
{\r
case wxID_CANCEL:\r
this->fCancel = true;\r
else if (::wxDirExists(piInfo->fnDestination.GetFullPath()))\r
{\r
// TODO: 再帰削除。\r
- ::wxRmDir(piInfo->fnDestination.GetFullPath());\r
+ ::wxRmdir(piInfo->fnDestination.GetFullPath());\r
}\r
break;\r
case 1:\r
}\r
if (! bPerm)\r
{\r
- nMode = wxID_OK;\r
+ this->nOverwriteMode = wxID_OK;\r
}\r
}\r
break;\r
XRCCTRL(* this, "stExistTime", wxStaticText)->SetLabel(this->fnExist->GetModificationTime().Format(_("%Y/%m/%d %H:%M:%S modified, ")));\r
XRCCTRL(* this, "stExistSize", wxStaticText)->SetLabel(this->fnExist->GetHumanReadableSize());\r
XRCCTRL(* this, "stWriteTime", wxStaticText)->SetLabel(this->tmWrite->Format(_("%Y/%m/%d %H:%M:%S modified, ")));\r
- XRCCTRL(* this, "stWriteSize", wxStaticText)->SetLabel(wxFileName::GetHumanReadableSize(this->nWriteSize));\r
+ XRCCTRL(* this, "stWriteSize", wxStaticText)->SetLabel(wxFileName::GetHumanReadableSize((wxULongLong) this->nWriteSize));\r
XRCCTRL(* this, "sbIcon", wxStaticBitmap)->SetIcon(GetFileTypeIcon(* this->fnExist));\r
}\r
\r
\r
void OverwriteDialog::OnBtnBrowse(wxCommandEvent&)\r
{\r
- wxFileDialog fd(this);\r
- fd.SetWindowStyleFlag(wxFD_SAVE | wxFD_OVERWRITE_PROMPT);\r
- fd.SetPath(this->ebTarget->GetValue());\r
+ wxFileName fn(this->ebTarget->GetValue());\r
+ wxFileDialog fd(this, _("Choose a file"), fn.GetPath(), fn.GetFullName(), wxFileSelectorDefaultWildcardStr, wxFD_SAVE | wxFD_OVERWRITE_PROMPT);\r
if (fd.ShowModal() == wxID_OK)\r
{\r
this->ebTarget->SetValue(fd.GetPath());\r