From 5e985616ca65e2faf9fe5cd206cf915a57486156 Mon Sep 17 00:00:00 2001 From: sirakaba Date: Mon, 8 Nov 2010 11:40:15 +0000 Subject: [PATCH] =?utf8?q?DnD=E4=BB=A5=E5=A4=96=E3=81=8B=E3=82=89=E6=9B=B8?= =?utf8?q?=E5=BA=AB=E3=82=92=E8=AA=AD=E3=81=BF=E8=BE=BC=E3=82=81=E3=81=AA?= =?utf8?q?=E3=81=8F=E3=81=AA=E3=81=A3=E3=81=A6=E3=81=84=E3=81=9F=E3=83=90?= =?utf8?q?=E3=82=B0=E3=82=92=E4=BF=AE=E6=AD=A3=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@426 9df91469-1e22-0410-86e7-ea8537beb833 --- src/lychee/cls_filedroptarget.cpp | 2 +- src/lychee/frm_main.cpp | 10 +++++----- src/lychee/lychee.cpp | 1 - 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/lychee/cls_filedroptarget.cpp b/src/lychee/cls_filedroptarget.cpp index 0e9abb2..78c75a3 100644 --- a/src/lychee/cls_filedroptarget.cpp +++ b/src/lychee/cls_filedroptarget.cpp @@ -58,7 +58,7 @@ bool myFileDropTarget::OnDropFiles(wxCoord, wxCoord, const wxArrayString & asFil #else e = new wxCommandEvent(wxEVT_COMMAND_MENU_SELECTED, XRCID("Arc_Open")); #endif - e->SetInt(1); + e->SetInt(2); e->SetExtraLong((long) llFileCount); this->mainFrame->fnArchive = wxFileName(asFiles[0]); #if wxCHECK_VERSION(2, 9, 0) diff --git a/src/lychee/frm_main.cpp b/src/lychee/frm_main.cpp index e718948..8ff8498 100644 --- a/src/lychee/frm_main.cpp +++ b/src/lychee/frm_main.cpp @@ -311,14 +311,16 @@ void MainFrame::OnArcCreate(wxCommandEvent& e) } // 終了しない場合は書庫を開く。 - e.SetInt(1); this->OnArcOpen(e); } void MainFrame::OnArcOpen(wxCommandEvent& e) { + // モード取得。通常は0, それ以外で開く場合は1, ファイルDnDなら2。 + int nMode = e.GetInt() == 2 ? 2 : e.GetId() == XRCID("Arc_Open") ? 0 : 1; + // 書庫を選択。 - if (e.GetInt() != 1) + if (nMode == 0) { wxFileDialog fd(this, _("Choose an archive"), this->conf.ReadHistory(CONF_HISTORY_PATH, 0), wxEmptyString, wxFileSelectorDefaultWildcardStr, wxFD_OPEN | wxFD_FILE_MUST_EXIST); if (fd.ShowModal() == wxID_CANCEL) @@ -336,7 +338,7 @@ void MainFrame::OnArcOpen(wxCommandEvent& e) // DnD以外で書庫を開く場合、TPIを読み込み。 TPI_PROCESSINFO piInfo; piInfo.fiInfo.nUnpackedSize = e.GetExtraLong(); - if (e.GetInt() != 1 && ! this->LoadTPI(this->fnArchive.GetFullPath(), & piInfo.fiInfo.nUnpackedSize)) + if (nMode != 2 && ! this->LoadTPI(this->fnArchive.GetFullPath(), & piInfo.fiInfo.nUnpackedSize)) { procDlg.Show(false); tpi.FreeLibrary(); @@ -616,7 +618,6 @@ void MainFrame::OnArcAdd(wxCommandEvent& e) } // 終了しない場合は書庫を再読み込み。 - e.SetInt(1); this->OnArcOpen(e); } @@ -867,7 +868,6 @@ void MainFrame::OnArcDelete(wxCommandEvent& e) } // 書庫を再読み込みする。 - e.SetInt(1); this->OnArcOpen(e); } diff --git a/src/lychee/lychee.cpp b/src/lychee/lychee.cpp index f8003eb..90abd61 100644 --- a/src/lychee/lychee.cpp +++ b/src/lychee/lychee.cpp @@ -82,7 +82,6 @@ bool Lychee::OnInit() // 書庫を開く。 wxCommandEvent e; - e.SetInt(1); frm_main->fnArchive = wxFileName(cmdLine.GetParam(0)); frm_main->fnArchive.Normalize(wxPATH_NORM_DOTS | wxPATH_NORM_ABSOLUTE | wxPATH_NORM_LONG, szCwd); frm_main->OnArcOpen(e); -- 2.11.0