OSDN Git Service

微修正。
[tpi/lychee.git] / src / lychee / frm_main.cpp
index 13ae838..52134ce 100644 (file)
@@ -247,15 +247,30 @@ void MainFrame::OnArcCreate(wxCommandEvent& e)
        MakeDialog mkDlg(this, TPI_COMMAND_CREATE);\r
        if (e.GetClientData() == NULL)\r
        {\r
-               // 処理対象のファイルを選択。\r
-               wxFileDialog fd(this, _("Choose files to compress"), this->conf.ReadHistory(CONF_HISTORY_PATH, 0), wxEmptyString, wxFileSelectorDefaultWildcardStr, wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_MULTIPLE);\r
-               if (fd.ShowModal() == wxID_CANCEL)\r
+               if (::wxGetKeyState(WXK_SHIFT))\r
                {\r
-                       return;\r
+                       // 処理対象のフォルダを選択。\r
+                       wxDirDialog dd(this, _("Choose dir to compress"), this->conf.ReadHistory(CONF_HISTORY_PATH, 0), wxDD_DIR_MUST_EXIST);\r
+                       if (dd.ShowModal() == wxID_CANCEL)\r
+                       {\r
+                               return;\r
+                       }\r
+                       swInfo.fnDestinationDirectory = wxFileName(dd.GetPath());\r
+                       this->conf.WriteHistory(CONF_HISTORY_PATH, swInfo.fnDestinationDirectory.GetPath());\r
+                       mkDlg.files.Add(swInfo.fnDestinationDirectory.GetFullName());\r
+               }\r
+               else\r
+               {\r
+                       // 処理対象のファイルを選択。\r
+                       wxFileDialog fd(this, _("Choose files to compress"), this->conf.ReadHistory(CONF_HISTORY_PATH, 0), wxEmptyString, wxFileSelectorDefaultWildcardStr, wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_MULTIPLE);\r
+                       if (fd.ShowModal() == wxID_CANCEL)\r
+                       {\r
+                               return;\r
+                       }\r
+                       fd.GetFilenames(mkDlg.files);\r
+                       swInfo.fnDestinationDirectory = wxFileName::DirName(fd.GetDirectory());\r
+                       this->conf.WriteHistory(CONF_HISTORY_PATH, fd.GetDirectory());\r
                }\r
-               swInfo.fnDestinationDirectory = wxFileName::DirName(fd.GetDirectory());\r
-               this->conf.WriteHistory(CONF_HISTORY_PATH, fd.GetDirectory());\r
-               fd.GetFilenames(mkDlg.files);\r
        }\r
        else\r
        {\r
@@ -315,6 +330,7 @@ void MainFrame::OnArcCreate(wxCommandEvent& e)
                procDlg.Show(false);\r
                if (this->ErrorCheck(tpi.nErrorCode) != TPI_ERROR_SUCCESS)\r
                {\r
+                       tpi.FreeLibrary();\r
                        return;\r
                }\r
        }\r
@@ -416,7 +432,7 @@ void MainFrame::OnArcOpen(wxCommandEvent& e)
                idArcRoot = this->tree_ctrl->AppendItem(idRoot, wxT("-----"), 0, 1);\r
 \r
        // 巨大書庫のときにファイル名検査を省略するか。\r
-       bool bDTVCheck = piInfo.fiInfo.nUnpackedSize < 10000 || ::AskDlg(_("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?"), this) == wxNO;\r
+       bool bDTVCheck = piInfo.fiInfo.nUnpackedSize < 10000 || AskDlg(_("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?"), this) == wxNO;\r
 \r
        // ファイル情報をロード。\r
        if (tpi.GetFileInformation(& piInfo.fiInfo, true))\r
@@ -581,6 +597,9 @@ void MainFrame::OnArcOpen(wxCommandEvent& e)
        SetMenuToolState("Arc_Repair",  (this->aiArchive.fiInfo.eSupportedCommand & TPI_COMMAND_REPAIR) == TPI_COMMAND_REPAIR);\r
        this->menubar->Enable(XRCID("Arc_Clone"), true);\r
 \r
+       // タイトルバー設定。\r
+       this->SetTitle(this->fnArchive.GetFullName() + wxT(" - Lychee"));\r
+\r
        procDlg.Show(false);\r
        this->Raise();\r
 }\r
@@ -626,6 +645,9 @@ void MainFrame::OnArcClose(wxCommandEvent& e)
        g_hIconLL.RemoveAll();\r
        g_hIconLS.RemoveAll();\r
 \r
+       // タイトルバー設定。\r
+       this->SetTitle(wxT("Lychee"));\r
+\r
        // DnDで書庫を開くときは既に読み込まれているTPIを用いるので、解放してはいけない。\r
        if (e.GetExtraLong() == 0)\r
        {\r
@@ -962,7 +984,7 @@ void MainFrame::OnArcDelete(wxCommandEvent& e)
                return;\r
        }\r
 \r
-       if (::AskDlg(_("Are you sure to delete selected files?"), this) == wxNO)\r
+       if (AskDlg(_("Are you sure to delete selected files?"), this) == wxNO)\r
        {\r
                return;\r
        }\r