this->conf.WriteId(CONF_LISTVIEW_C_PATH, this->list_ctrl->GetColumnWidth(7));\r
this->conf.WriteId(CONF_LISTVIEW_C_TYPE, this->list_ctrl->GetColumnWidth(8));\r
this->conf.WriteId(CONF_LISTVIEW_C_NO, this->list_ctrl->GetColumnWidth(9));\r
+ this->conf.WriteId(CONF_LISTVIEW_C_COMMENT, this->list_ctrl->GetColumnWidth(10));\r
this->conf.WriteId(CONF_LISTVIEW_S_COLUMN, g_nSortColumn);\r
this->conf.WriteId(CONF_LISTVIEW_S_ASCEND, g_fSortAscend);\r
}\r
this->list_ctrl->InsertColumn(7, _("Path"), wxLIST_FORMAT_LEFT, this->conf.ReadId(CONF_LISTVIEW_C_PATH, 100l));\r
this->list_ctrl->InsertColumn(8, _("Type"), wxLIST_FORMAT_LEFT, this->conf.ReadId(CONF_LISTVIEW_C_TYPE, 100l));\r
this->list_ctrl->InsertColumn(9, _("No."), wxLIST_FORMAT_RIGHT, this->conf.ReadId(CONF_LISTVIEW_C_NO, 35l));\r
+ this->list_ctrl->InsertColumn(10,_("Comment"), wxLIST_FORMAT_LEFT, this->conf.ReadId(CONF_LISTVIEW_C_COMMENT, 35l));\r
g_nSortColumn = this->conf.ReadId(CONF_LISTVIEW_S_COLUMN, 9l);\r
g_fSortAscend = this->conf.ReadId(CONF_LISTVIEW_S_ASCEND, true);\r
\r
this->conf.WriteHistory(CONF_HISTORY_PATH, fd.GetDirectory());\r
this->fnArchive = wxFileName(fd.GetPath());\r
}\r
- this->OnArcClose(e);\r
\r
// 進捗ダイアログ表示。\r
ProcessDialog procDlg;\r
procDlg.Show(true);\r
\r
- // TPIを読み込み、最初のコールバックを送信。\r
+ // DnD以外で書庫を開く場合、TPIを読み込み。\r
TPI_PROCESSINFO piInfo;\r
- piInfo.eMessage = TPI_MESSAGE_STATUS;\r
- piInfo.eStatus = 0x1000;\r
- piInfo.nProcessedSize = 0;\r
- piInfo.fiInfo.fnFileName = this->fnArchive;\r
- piInfo.fiInfo.nUnpackedSize = e.GetExtraLong() != 0 ? e.GetExtraLong() : this->LoadTPI(this->fnArchive.GetFullPath());\r
- if (piInfo.fiInfo.nUnpackedSize == 0)\r
+ piInfo.fiInfo.nUnpackedSize = e.GetExtraLong();\r
+ if (e.GetInt() != 1 && ! this->LoadTPI(this->fnArchive.GetFullPath(), & piInfo.fiInfo.nUnpackedSize))\r
{\r
procDlg.Show(false);\r
tpi.FreeLibrary();\r
}\r
return;\r
}\r
+\r
+ // 最初のコールバックを送信。\r
+ piInfo.eMessage = TPI_MESSAGE_STATUS;\r
+ piInfo.eStatus = 0x1000;\r
+ piInfo.nProcessedSize = 0;\r
+ piInfo.fiInfo.fnFileName = this->fnArchive;\r
procDlg.CallbackProc(TPI_NOTIFY_COMMON, & piInfo);\r
\r
// 配列のサイズを確保。\r
this->fileinfo.Alloc(piInfo.fiInfo.nUnpackedSize);\r
\r
- // 書庫を開く。\r
- if (! tpi.OpenArchive(this->fnArchive.GetFullPath()))\r
- {\r
- procDlg.Show(false);\r
- tpi.FreeLibrary();\r
- this->ErrorCheck(tpi.nErrorCode, wxT("OpenArchive"));\r
- return;\r
- }\r
-\r
// 履歴に追加。\r
this->conf.WriteHistory(CONF_HISTORY_PATH, this->fnArchive.GetPath());\r
this->conf.WriteHistory(CONF_HISTORY_NAME, this->fnArchive.GetFullName());\r
// 情報を保存してカウントアップ。\r
this->fileinfo.Add(piInfo.fiInfo);\r
}\r
- while (tpi.GetFileInformation(& piInfo.fiInfo, false));\r
+ while (tpi.GetFileInformation(& piInfo.fiInfo));\r
}\r
\r
// GetFileInformationがエラー終了した場合。\r
\r
// ステータスバー設定。\r
this->statusbar->SetStatusText(this->aiArchive.fiInfo.szTypeName, 0);\r
- this->statusbar->SetStatusText(wxString::Format(_("%d file(s)"), this->fileinfo.GetCount()), 1);\r
- this->statusbar->SetStatusText(wxString::Format(_("%dB -> %dB"), this->aiArchive.nUnpackedSize, this->aiArchive.nPackedSize), 2);\r
+ this->statusbar->SetStatusText(wxString::Format(_("%u file(s)"), this->fileinfo.GetCount()), 1);\r
+ this->statusbar->SetStatusText(wxString::Format(wxString("%" wxLongLongFmtSpec "uB -> %" wxLongLongFmtSpec "uB"), this->aiArchive.nUnpackedSize, this->aiArchive.nPackedSize), 2);\r
this->statusbar->SetStatusText(wxString::Format(wxT("%3.1f%%"), this->aiArchive.wCompressRatio / 10.0), 3);\r
this->statusbar->SetStatusText(this->fnArchive.GetFullPath(), 4);\r
\r
// ツリービュー・リストビュー設定。\r
this->tree_ctrl->DeleteAllItems();\r
this->list_ctrl->DeleteAllItems();\r
- this->list_ctrl->showFileInfo.Clear();\r
+ this->list_ctrl->apShowFile.Clear();\r
\r
// ツールバー・メニューバー設定。\r
SetMenuToolState("Arc_Close", false);\r
// ツリービューからパスを取得。\r
wxString szNodePath = TreeView_GetItemPath(this->tree_ctrl, e.GetItem());\r
// リストビューを初期化。\r
- this->list_ctrl->showFileInfo.Clear();\r
+ this->list_ctrl->apShowFile.Clear();\r
this->list_ctrl->DeleteAllItems();\r
g_hIconLL.RemoveAll();\r
g_hIconLS.RemoveAll();\r
continue;\r
}\r
\r
- this->list_ctrl->showFileInfo.Add(this->fileinfo[i]);\r
+ this->list_ctrl->apShowFile.Add(& this->fileinfo[i]);\r
}\r
}\r
\r
// ソートして表示。\r
- this->list_ctrl->showFileInfo.Sort(& ListCtrlCompareProc);\r
- this->list_ctrl->SetItemCount(this->list_ctrl->showFileInfo.GetCount());\r
+ this->list_ctrl->apShowFile.Sort(& ListCtrlCompareProc);\r
+ this->list_ctrl->SetItemCount(this->list_ctrl->apShowFile.GetCount());\r
}\r
\r
void MainFrame::OnTreeBeginDrag(wxTreeEvent& e)\r
\r
// イベントハンドラ以外。\r
\r
-wxULongLong_t MainFrame::LoadTPI(wxString szFileName)\r
+bool MainFrame::LoadTPI(const wxString & szFileName, wxULongLong_t * llFileCount)\r
{\r
+ // 書庫を開いていれば閉じておく。\r
+ wxCommandEvent e;\r
+ this->OnArcClose(e);\r
+\r
// TPIを読み込み。\r
wxDir fs(L_DIR_B_LIB);\r
- wxULongLong_t llFileCount = 0;\r
wxString szTPIName;\r
if (fs.GetFirst(& szTPIName, wxT("*" TPI_EXT)))\r
{\r
do\r
{\r
// 初期化。\r
- if (! tpi.InitLibrary(L_DIR_B_LIB + szTPIName, szFileName, 0))\r
+ if (! tpi.InitLibrary(L_DIR_B_LIB + szTPIName, szFileName))\r
{\r
tpi.FreeLibrary();\r
continue;\r
tpi.SetCallbackProc(TPICallbackProc);\r
\r
// 対応確認。\r
- if (! tpi.CheckArchive(szFileName, & llFileCount) || llFileCount == 0)\r
+ if (! tpi.OpenArchive(szFileName, llFileCount))\r
{\r
tpi.FreeLibrary();\r
- llFileCount = 0;\r
+ * llFileCount = 0;\r
continue;\r
}\r
- break;\r
+ return true;\r
}\r
while (fs.GetNext(& szTPIName));\r
}\r
- return llFileCount;\r
+ return false;\r
}\r
\r
-int MainFrame::ErrorCheck(int nErrorCode, wxString szAPIName)\r
+int MainFrame::ErrorCheck(int nErrorCode, const wxString & szAPIName)\r
{\r
switch (nErrorCode)\r
{\r