this->lcFiles->InsertColumn(1, _("Output"), wxLIST_FORMAT_LEFT, 290);\r
this->lcFiles->asInput = & this->files;\r
this->lcFiles->atDangerItem.SetTextColour(* wxRED);\r
+ this->lcFiles->atExistItem.SetTextColour(* wxBLUE);\r
\r
::wxXmlResource::Get()->Unload(L_DIR_S_XRC wxT("dlg_make.xrc"));\r
\r
MainFrame * frm_main = (MainFrame *) this->GetParent();\r
wxString szArcPath = frm_main->fnArchive.GetPath();\r
\r
- // パス履歴読み込み。\r
- for (size_t i = 0; i < frm_main->conf.GetHistoryCount(CONF_HISTORY_PATH); i++)\r
- {\r
- wxString sz = frm_main->conf.ReadHistory(CONF_HISTORY_PATH, i);\r
- if (sz.IsEmpty())\r
- {\r
- continue;\r
- }\r
-\r
- this->cbDir->Append(sz);\r
- }\r
- // 書庫名履歴読み込み。\r
- for (size_t i = 0; i < frm_main->conf.GetHistoryCount(CONF_HISTORY_NAME); i++)\r
- {\r
- wxString sz = frm_main->conf.ReadHistory(CONF_HISTORY_NAME, i);\r
- if (sz.IsEmpty())\r
- {\r
- continue;\r
- }\r
-\r
- this->cbFileName->Append(sz);\r
- }\r
+ // 履歴読み込み。\r
+ this->myLoadHistory(CONF_HISTORY_PATH, this->cbDir);\r
+ this->myLoadHistory(CONF_HISTORY_NAME, this->cbFileName);\r
\r
// パスを設定。\r
this->cbDir->SetValue(szArcPath);\r
// 初期値を設定。\r
this->SetTitle(_("Extract"));\r
this->tcComment->SetValue(frm_main->aiArchive.szComment);\r
+ this->cbDir->SetFocus();\r
\r
// コントロールを無効化。\r
this->scLevel->Disable();\r
\r
// 書庫名を設定。初期化の都合上.を付加しておく。\r
this->cbFileName->SetValue(frm_main->fnArchive.GetName() + wxT('.'));\r
+ this->cbFileName->SetFocus();\r
\r
// ライブラリを検索。\r
TPIHandle tpi;\r
{\r
// ロード。\r
wxString szLibName = L_DIR_B_LIB + szTPIName;\r
- if (tpi.InitLibrary(szLibName, wxEmptyString, 0))\r
+ if (tpi.InitLibrary(szLibName, wxEmptyString))\r
{\r
// 対応する形式名を取得。\r
TPI_FORMATINFO fiInfo;\r
this->chType->Append(fiInfo.szTypeName);\r
}\r
}\r
- while (tpi.GetFormatInformation(& fiInfo, false));\r
+ while (tpi.GetFormatInformation(& fiInfo));\r
}\r
tpi.FreeLibrary();\r
}\r
}\r
\r
// 展開/格納先を予測。ただしDTVスキャンに時間がかかる場合はスキップ可能。\r
- if (this->lcFiles->asInput->GetCount() < 3000 ||\r
+ size_t n = this->lcFiles->asInput->GetCount();\r
+ this->lcFiles->asOutput.Alloc(n);\r
+ this->lcFiles->apItem.Alloc(n);\r
+ if (n < 3000 ||\r
::AskDlg(\r
this->uCommand == TPI_COMMAND_EXTRACT ?\r
_("This archive contains so many files that it takes long to check Directory Traversal Vulnerability(DTV) problem. If you are sure this archive is safe, you can skip this scanning process. Do you want to scan for DTV problem?") :\r
\r
void MakeDialog::OnBtnDesktop(wxCommandEvent&)\r
{\r
- wxFileName fn(wxFileName::GetHomeDir(), wxT("Desktop"));\r
- this->cbDir->SetValue(fn.GetFullPath());\r
+ this->cbDir->SetValue(wxFileName(wxFileName::GetHomeDir(), wxT("Desktop")).GetFullPath());\r
}\r
\r
void MakeDialog::OnBtnCurrent(wxCommandEvent&)\r
\r
void MakeDialog::OnBtnBrowseKF(wxCommandEvent&)\r
{\r
- wxFileDialog fd(this);\r
- fd.SetWindowStyleFlag(wxFD_OPEN | wxFD_FILE_MUST_EXIST);\r
+ wxFileDialog fd(this, _("Choose a key file"), wxEmptyString, wxEmptyString, wxFileSelectorDefaultWildcardStr, wxFD_OPEN | wxFD_FILE_MUST_EXIST);\r
if (fd.ShowModal() == wxID_OK)\r
{\r
this->tcKeyfile->SetValue(fd.GetPath());\r
return;\r
}\r
this->lcFiles->DeleteAllItems();\r
- this->lcFiles->asOutput.Clear();\r
- this->lcFiles->apItem.Clear();\r
+ this->lcFiles->asOutput.Empty();\r
+ this->lcFiles->apItem.Empty();\r
\r
bool fDTVWarning = false;\r
switch (this->uCommand)\r
}\r
else\r
{\r
- this->lcFiles->apItem.Add(NULL);\r
+ this->lcFiles->apItem.Add(fnOutput.FileExists() || ::wxDirExists(fnOutput.GetFullPath()) ? & this->lcFiles->atExistItem : NULL);\r
}\r
this->lcFiles->asOutput.Add(fnOutput.GetFullPath());\r
}\r
}\r
\r
// DTV検査で異常があれば警告。\r
- if (fDTVWarning &&\r
- ::AskDlg(\r
- _("This archive may have Directory Traversal Vulnerability(DTV) problem, ") +\r
- (this->uCommand == TPI_COMMAND_EXTRACT ?\r
- _("and some danger files may be extracted to the unexpected system directory! It is strongly recommended to ignore file path. Would you like to do so?") :\r
- _("and some danger files may be stored! It is strongly recommended to ignore file path. Would you like to do so?")),\r
- this) == wxYES)\r
+ if (fDTVWarning)\r
{\r
- this->cbIgnorePath->SetValue(true);\r
- this->OnTabChanged(e);\r
+ wxString sz;\r
+ sz.Printf(\r
+ _("This archive may have Directory Traversal Vulnerability(DTV) problem, %s It is strongly recommended to ignore file path. Would you like to do so?"),\r
+ (this->uCommand == TPI_COMMAND_EXTRACT ?\r
+ _("and some danger files may be extracted to the unexpected system directory!") :\r
+ _("and some danger files may be stored!")\r
+ )\r
+ );\r
+ if (::AskDlg(sz, this) == wxYES)\r
+ {\r
+ this->cbIgnorePath->SetValue(true);\r
+ this->OnTabChanged(e);\r
+ }\r
}\r
\r
// リストビューに表示。\r
this->lcFiles->SetItemCount(this->lcFiles->asInput->GetCount());\r
}\r
\r
+void MakeDialog::myLoadHistory(myConfigId confId, wxComboBox * cb)\r
+{\r
+ MainFrame * frm_main = (MainFrame *) this->GetParent();\r
+ for (size_t i = 0; i < frm_main->conf.GetHistoryCount(confId); i++)\r
+ {\r
+ wxString sz = frm_main->conf.ReadHistory(confId, i);\r
+ if (! sz.IsEmpty())\r
+ {\r
+ cb->Append(sz);\r
+ }\r
+ }\r
+}\r
+\r
//******************************************************************************\r
// myListCtrl2\r
//******************************************************************************\r