}\r
wxCommandEvent e;\r
this->OnArcClose(e);\r
+ this->SetDropTarget(new myFileDropTarget(this));\r
\r
// スプリッター設定。\r
this->window_splitter->SetSashPosition(this->conf.ReadId(CONF_WINDOW_SPLITTER_POS, 200l));\r
this->list_ctrl->InsertColumn(9, _("No."), wxLIST_FORMAT_RIGHT, this->conf.ReadId(CONF_LISTVIEW_C_NO, 35l));\r
g_nSortColumn = this->conf.ReadId(CONF_LISTVIEW_S_COLUMN, 9l);\r
g_fSortAscend = this->conf.ReadId(CONF_LISTVIEW_S_ASCEND, true);\r
- this->list_ctrl->SetDropTarget(new myFileDropTarget(this));\r
\r
// ツールバー/ステータスバー設定。\r
int nStatusBarParts[] = {70, 70, 180, 50, -1};\r
this->fnArchive = wxFileName(mkDlg.cbDir->GetValue(), mkDlg.cbFileName->GetValue());\r
if (! tpi.InitLibrary(mkDlg.afInfo[nSelected].szTPIName, this->fnArchive.GetFullPath(), mkDlg.afInfo[nSelected].nTypeId))\r
{\r
- ::wxLogError(_("Error: %s!"), wxT("InitLibrary()!"));\r
+ wxLogError(_("Error: %s!"), wxT("InitLibrary()!"));\r
return;\r
}\r
\r
// コールバック関数を設定。\r
if (! tpi.SetCallbackProc(TPICallbackProc))\r
{\r
- ::wxLogError(_("Error: %s!"), wxT("SetCallbackProc()!"));\r
+ wxLogError(_("Error: %s!"), wxT("SetCallbackProc()!"));\r
}\r
\r
// 処理を行う。\r
{\r
procDlg.Show(false);\r
tpi.FreeLibrary();\r
- ::wxLogError(_("No plug-in supporting this archive was found!"));\r
+ wxLogError(_("No plug-in supporting this archive was found!"));\r
return;\r
}\r
procDlg.CallbackProc(TPI_NOTIFY_COMMON, & piInfo);\r
{\r
procDlg.Show(false);\r
tpi.FreeLibrary();\r
- ::wxLogError(_("Error: %s!"), wxT("OpenArchive()"));\r
+ wxLogError(_("Error: %s!"), wxT("OpenArchive()"));\r
return;\r
}\r
\r
if (piInfo.fiInfo.fnFileName.GetPathWithSep().Find(wxT("..")) != wxNOT_FOUND)\r
{\r
piInfo.fiInfo.eDanger = TRUE;\r
- ::wxLogWarning(_("This archive may have Directory Traversal Vulnerability(DTV) problem, and some danger files may be extracted to the unexpected system directory! You should use the \"Ignore file pathes\" option when extracting this archive.\nDanger file is:\n%s"), piInfo.fiInfo.fnFileName.GetFullPath().c_str());\r
+ wxLogWarning(_("This archive may have Directory Traversal Vulnerability(DTV) problem, and some danger files may be extracted to the unexpected system directory! You should use the \"Ignore file pathes\" option when extracting this archive.\nDanger file is:\n%s"), piInfo.fiInfo.fnFileName.GetFullPath().c_str());\r
}\r
// 空白の連続による拡張子偽装を検査。\r
if (piInfo.fiInfo.fnFileName.GetFullName().Find(wxT(" ")) != wxNOT_FOUND)\r
{\r
piInfo.fiInfo.eDanger = TRUE;\r
- ::wxLogWarning(_("This archive may contain extension-disguised files whose real extension is hidden by using many blank charactor and you may mistake that it is a \"safe\" file. Don\'t execute these files carelessly.\nDanger file is:\n%s"), piInfo.fiInfo.fnFileName.GetFullPath().c_str());\r
+ wxLogWarning(_("This archive may contain extension-disguised files whose real extension is hidden by using many blank charactor and you may mistake that it is a \"safe\" file. Don\'t execute these files carelessly.\nDanger file is:\n%s"), piInfo.fiInfo.fnFileName.GetFullPath().c_str());\r
}\r
// Unicode制御文字を検査。\r
for (wxChar c = 0x200c; c <= 0x206f; c++)\r
if (piInfo.fiInfo.fnFileName.GetFullName().Find(c) != wxNOT_FOUND)\r
{\r
piInfo.fiInfo.eDanger = TRUE;\r
- ::wxLogWarning(_("This archive may contain extension-disguised files whose real extension is hidden by using Unicode control character and you may mistake that it is a \"safe\" file. Don\'t execute these files carelessly.\nDanger file is:\n%s"), piInfo.fiInfo.fnFileName.GetFullPath().c_str());\r
+ wxLogWarning(_("This archive may contain extension-disguised files whose real extension is hidden by using Unicode control character and you may mistake that it is a \"safe\" file. Don\'t execute these files carelessly.\nDanger file is:\n%s"), piInfo.fiInfo.fnFileName.GetFullPath().c_str());\r
}\r
switch (c)\r
{\r
// GetFileInformationがエラー終了した場合。\r
if (tpi.nErrorCode != TPI_ERROR_S_ENDOFDATA)\r
{\r
- ::wxLogError(_("Error: %s!"), wxT("GetFileInformation()"));\r
+ wxLogError(_("Error: %s!"), wxT("GetFileInformation()"));\r
}\r
\r
// 書庫の情報を取得。\r
if (! tpi.GetArchiveInformation(& this->aiArchive))\r
{\r
- ::wxLogError(_("Error: %s!"), wxT("GetArchiveInformation()"));\r
+ wxLogError(_("Error: %s!"), wxT("GetArchiveInformation()"));\r
}\r
\r
// 書庫を閉じる。\r
if (! tpi.CloseArchive())\r
{\r
- ::wxLogError(_("Error: %s!"), wxT("CloseArchive()"));\r
+ wxLogError(_("Error: %s!"), wxT("CloseArchive()"));\r
}\r
\r
// 以下、UI処理。\r
ftFile = wxTheMimeTypesManager->GetFileTypeFromExtension(this->conf.ReadId(CONF_DEFAULT_EXT, (wxString) wxT("txt")));\r
if (! ftFile)\r
{\r
- ::wxLogError(_("Unable to get the file type!"));\r
+ wxLogError(_("Unable to get the file type!"));\r
return;\r
}\r
}\r
swInfo.fnDestinationDirectory = MakeDirPath(wxFileName::DirName(p.GetTempDir()), szDestDirBase, true);\r
if (! swInfo.fnDestinationDirectory.IsOk())\r
{\r
- ::wxLogError(_("Unable to make the temporary directory!"));\r
+ wxLogError(_("Unable to make the temporary directory!"));\r
return;\r
}\r
}\r
swInfo.fnDestinationDirectory = MakeDirPath(swInfo.fnDestinationDirectory, this->fnArchive.GetName(), true);\r
if (! swInfo.fnDestinationDirectory.IsOk())\r
{\r
- ::wxLogError(_("Unable to make the destination directory!"));\r
+ wxLogError(_("Unable to make the destination directory!"));\r
return;\r
}\r
}\r
objFile.AddFile(swInfo.fnDestinationDirectory.GetPath());\r
}\r
\r
+ // 自身にドロップされると煩雑なので、一時的にドロップを受け付けないようにしておく。\r
+ this->SetDropTarget(NULL);\r
+\r
// DnD開始。\r
wxDropSource dropSource(objFile, this);\r
- if (dropSource.DoDragDrop() != wxDragMove)\r
+ wxDragResult drResult = dropSource.DoDragDrop(wxDrag_DefaultMove);\r
+ if (drResult != wxDragCancel && drResult != wxDragNone && drResult != wxDragMove)\r
{\r
#ifdef __LINUX__\r
// Linuxではまだ処理が終わっていない(コンテキストメニューが表示されている)ので、とりあえず3秒だけ待つ。\r
sleep(3);\r
#endif\r
}\r
+ this->SetDropTarget(new myFileDropTarget(this));\r
}\r
\r
// ファイルと一時ディレクトリを削除。\r
\r
if (bIsCorrect)\r
{\r
- ::wxLogMessage(_("This is a correct archive."));\r
+ wxLogMessage(_("This is a correct archive."));\r
}\r
else\r
{\r
case TPI_CALLBACK_CONTINUE:\r
break;\r
case TPI_ERROR_D_UNSUPPORTED:\r
- ::wxLogError(_("Sorry, this function is not supported yet."));\r
+ wxLogError(_("Sorry, this function is not supported yet."));\r
break;\r
case TPI_ERROR_D_SKIPPED:\r
case TPI_CALLBACK_CANCEL:\r
- ::wxLogError(_("This operation is canceled by the user."));\r
+ wxLogError(_("This operation is canceled by the user."));\r
break;\r
default:\r
- ::wxLogError(_("Error code: %d"), nErrorCode);\r
+ wxLogError(_("Error code: %d"), nErrorCode);\r
}\r
return nErrorCode;\r
}\r
::wxSetWorkingDirectory(sz);\r
if (fp == NULL)\r
{\r
- ::wxLogError(L"Error :\n\nCommandLine:\n%s", szCommandLine.c_str());\r
+ wxLogError(L"Error :\n\nCommandLine:\n%s", szCommandLine.c_str());\r
return TPI_ERROR_U_USE_LIBRARY;\r
}\r
\r
if (g_szCurrentArchive != _szArcName)\r
{\r
wxString szOutput;\r
- if (myExecute(g_LibInfo.szExeFile + wxT(" ") + MakeCommandLineSend(g_LibInfo.node.GetAttribute(wxT("list"), wxEmptyString), _szArcName, NULL, NULL, wxEmptyString), & szOutput, wxEmptyString) != TPI_ERROR_SUCCESS)\r
+ wxArrayString as;\r
+ if (myExecute(g_LibInfo.szExeFile + wxT(" ") + MakeCommandLineSend(g_LibInfo.node.GetAttribute(wxT("list"), wxEmptyString), _szArcName, NULL, as, wxEmptyString), & szOutput, wxEmptyString) != TPI_ERROR_SUCCESS)\r
{\r
return TPI_ERROR_U_USE_LIBRARY;\r
}\r
\r
if (nErrorCode != TPI_ERROR_SUCCESS)\r
{\r
- ::wxLogError(L"Error :\n%x\n\nCommandLine:\n%s\n\nOutput:\n%s", nErrorCode, szCommandLineSend.c_str(), szOutput.c_str());\r
+ wxLogError(L"Error :\n%x\n\nCommandLine:\n%s\n\nOutput:\n%s", nErrorCode, szCommandLineSend.c_str(), szOutput.c_str());\r
}\r
return nErrorCode;\r
}\r