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
\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
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