From 0c37809c739ce48613c229ecee22a9d790922ed3 Mon Sep 17 00:00:00 2001 From: sirakaba Date: Fri, 26 Nov 2010 11:29:26 +0000 Subject: [PATCH] =?utf8?q?DnD=E3=81=8B=E3=82=89=E3=81=A7=E3=81=AF=E3=83=98?= =?utf8?q?=E3=83=83=E3=83=80=E6=9A=97=E5=8F=B7=E5=8C=96=E6=9B=B8=E5=BA=AB?= =?utf8?q?=E3=82=84=E5=88=86=E5=89=B2=E6=9B=B8=E5=BA=AB=E3=81=8C=E9=96=8B?= =?utf8?q?=E3=81=91=E3=81=AA=E3=81=84=E5=A0=B4=E5=90=88=E3=81=8C=E3=81=82?= =?utf8?q?=E3=81=A3=E3=81=9F=E3=83=90=E3=82=B0=E3=82=92=E4=BF=AE=E6=AD=A3?= =?utf8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/tpi/tpi@451 9df91469-1e22-0410-86e7-ea8537beb833 --- doc/history.html | 7 +++++++ src/lychee/cls_filedroptarget.cpp | 44 +++++++++++++-------------------------- src/lychee/frm_main.cpp | 10 ++++++--- 3 files changed, 29 insertions(+), 32 deletions(-) diff --git a/doc/history.html b/doc/history.html index 081d7e8..6edf126 100644 --- a/doc/history.html +++ b/doc/history.html @@ -27,6 +27,13 @@ + +
rarArc
+
+
diff --git a/src/lychee/cls_filedroptarget.cpp b/src/lychee/cls_filedroptarget.cpp index 78c75a3..3214c77 100644 --- a/src/lychee/cls_filedroptarget.cpp +++ b/src/lychee/cls_filedroptarget.cpp @@ -37,47 +37,33 @@ myFileDropTarget::myFileDropTarget(MainFrame * mainFrame) // Event handler. //****************************************************************************** -bool myFileDropTarget::OnDropFiles(wxCoord, wxCoord, const wxArrayString & asFiles) -{ -#if wxCHECK_VERSION(2, 9, 0) - wxThreadEvent * e; -#else - wxCommandEvent * e; +#if ! wxCHECK_VERSION(2, 9, 0) +#define wxThreadEvent wxCommandEvent #endif +bool myFileDropTarget::OnDropFiles(wxCoord, wxCoord, const wxArrayString & asFiles) +{ // ファイルが存在するか確認。 + wxThreadEvent * e; + this->as = asFiles; if (asFiles.GetCount() == 1 && ::wxFileExists(asFiles[0])) { - // 対応しているかどうか確認。 - wxULongLong_t llFileCount = 0; - if (this->mainFrame->LoadTPI(asFiles[0], & llFileCount)) - { - // 書庫を開く。 -#if wxCHECK_VERSION(2, 9, 0) - e = new wxThreadEvent(wxEVT_COMMAND_MENU_SELECTED, XRCID("Arc_Open")); -#else - e = new wxCommandEvent(wxEVT_COMMAND_MENU_SELECTED, XRCID("Arc_Open")); -#endif - e->SetInt(2); - e->SetExtraLong((long) llFileCount); - this->mainFrame->fnArchive = wxFileName(asFiles[0]); + // 書庫を開く。 + e = new wxThreadEvent(wxEVT_COMMAND_MENU_SELECTED, XRCID("Arc_Open")); + e->SetClientData(& this->as); + e->SetInt(2); + this->mainFrame->fnArchive = wxFileName(asFiles[0]); #if wxCHECK_VERSION(2, 9, 0) - ::wxQueueEvent(this->mainFrame, e); + ::wxQueueEvent(this->mainFrame, e); #else - this->mainFrame->OnArcOpen(* e); - delete e; + this->mainFrame->OnArcOpen(* e); + delete e; #endif - return true; - } + return true; } // 対応していない場合は書庫の作成を試みる。 - this->as = asFiles; -#if wxCHECK_VERSION(2, 9, 0) e = new wxThreadEvent(wxEVT_COMMAND_MENU_SELECTED, XRCID("Arc_Create")); -#else - e = new wxCommandEvent(wxEVT_COMMAND_MENU_SELECTED, XRCID("Arc_Create")); -#endif e->SetClientData(& this->as); #if wxCHECK_VERSION(2, 9, 0) ::wxQueueEvent(this->mainFrame, e); diff --git a/src/lychee/frm_main.cpp b/src/lychee/frm_main.cpp index 345b901..9a5790d 100644 --- a/src/lychee/frm_main.cpp +++ b/src/lychee/frm_main.cpp @@ -337,12 +337,16 @@ void MainFrame::OnArcOpen(wxCommandEvent& e) // DnD以外で書庫を開く場合、TPIを読み込み。 TPI_PROCESSINFO piInfo; - piInfo.fiInfo.nUnpackedSize = e.GetExtraLong(); - if (nMode != 2 && ! this->LoadTPI(this->fnArchive.GetFullPath(), & piInfo.fiInfo.nUnpackedSize)) + if (! this->LoadTPI(this->fnArchive.GetFullPath(), & piInfo.fiInfo.nUnpackedSize)) { procDlg.Show(false); tpi.FreeLibrary(); - if (this->IsShown()) + if (nMode == 2) + { + // DnDの場合は書庫を作成する。 + this->OnArcCreate(e); + } + else if (this->IsShown()) { wxBell(); this->statusbar->SetStatusText(_("No plug-in supporting this archive was found!"), 4); -- 2.11.0