OSDN Git Service

Windows上でwxWidgets2.9.1に移行。
authorsirakaba <sirakaba@9df91469-1e22-0410-86e7-ea8537beb833>
Thu, 2 Sep 2010 03:55:48 +0000 (03:55 +0000)
committersirakaba <sirakaba@9df91469-1e22-0410-86e7-ea8537beb833>
Thu, 2 Sep 2010 03:55:48 +0000 (03:55 +0000)
LycheeのウインドウへDnDできる範囲をリストビューだけでなくウインドウ全体に変更。
書庫閲覧時にDnDで展開するとき、Lycheeの同じウインドウへはドロップできないよう変更。

git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/tpi/tpi@299 9df91469-1e22-0410-86e7-ea8537beb833

doc/history.html
src/lychee/frm_main.cpp
src/lychee/lychee.cpp
src/plugin/calLibrary/calLibrary.cpp
src/plugin/cuiWrapper/cuiWrapper.cpp

index d2a1be2..14c21da 100644 (file)
@@ -27,6 +27,7 @@
       <ul>\r
        <li class="add">Linux上で展開先をDolphinで開く機能に対応。</li>\r
        <li class="chg">Windows上でVisual Studio 2008へ移行。</li>\r
+       <li class="chg">Windows上でwxWidgets2.9.1に移行。</li>\r
        <li class="fix">作業ディレクトリからライブラリを読み込まないよう修正。</li>\r
       </ul>\r
      </dd>\r
@@ -34,6 +35,8 @@
      <dd>\r
       <ul>\r
        <li class="chg">一時ファイルをOSのテンポラリディレクトリに作成するよう変更。</li>\r
+       <li class="chg">LycheeのウインドウへDnDできる範囲をリストビューだけでなくウインドウ全体に変更。</li>\r
+       <li class="chg">書庫閲覧時にDnDで展開するとき、Lycheeの同じウインドウへはドロップできないよう変更。</li>\r
       </ul>\r
      </dd>\r
     </dl>\r
index d9734c2..3f4c9bd 100644 (file)
@@ -153,6 +153,7 @@ void MainFrame::OnInit(wxInitDialogEvent&)
        }\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
@@ -175,7 +176,6 @@ void MainFrame::OnInit(wxInitDialogEvent&)
        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
@@ -264,14 +264,14 @@ void MainFrame::OnArcCreate(wxCommandEvent& e)
        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
@@ -344,7 +344,7 @@ void MainFrame::OnArcOpen(wxCommandEvent& e)
        {\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
@@ -357,7 +357,7 @@ void MainFrame::OnArcOpen(wxCommandEvent& e)
        {\r
                procDlg.Show(false);\r
                tpi.FreeLibrary();\r
-               ::wxLogError(_("Error: %s!"), wxT("OpenArchive()"));\r
+               wxLogError(_("Error: %s!"), wxT("OpenArchive()"));\r
                return;\r
        }\r
 \r
@@ -409,13 +409,13 @@ void MainFrame::OnArcOpen(wxCommandEvent& e)
                        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
@@ -423,7 +423,7 @@ void MainFrame::OnArcOpen(wxCommandEvent& e)
                                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
@@ -441,19 +441,19 @@ void MainFrame::OnArcOpen(wxCommandEvent& e)
        // 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
@@ -655,7 +655,7 @@ void MainFrame::OnArcExtract(wxCommandEvent& e)
                                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
@@ -673,7 +673,7 @@ void MainFrame::OnArcExtract(wxCommandEvent& e)
                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
@@ -696,7 +696,7 @@ void MainFrame::OnArcExtract(wxCommandEvent& e)
                        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
@@ -772,15 +772,20 @@ void MainFrame::OnArcExtract(wxCommandEvent& e)
                                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
@@ -852,7 +857,7 @@ void MainFrame::OnArcTest(wxCommandEvent&)
 \r
        if (bIsCorrect)\r
        {\r
-               ::wxLogMessage(_("This is a correct archive."));\r
+               wxLogMessage(_("This is a correct archive."));\r
        }\r
        else\r
        {\r
@@ -1046,14 +1051,14 @@ int MainFrame::ErrorCheck(int nErrorCode)
        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
index c2feda9..4ea3818 100644 (file)
@@ -50,7 +50,7 @@ bool Lychee::OnInit()
        MainFrame * frm_main = new MainFrame();\r
        if (! ::wxXmlResource::Get()->Load(L_DIR_S_XRC wxT("frm_main.xrc")))\r
        {\r
-               ::wxLogError(_("Unable to find XRC!"));\r
+               wxLogError(_("Unable to find XRC!"));\r
                return false;\r
        }\r
 \r
index fa98f48..a2eb3b2 100644 (file)
@@ -884,7 +884,7 @@ int __stdcall Command
 \r
        if (nErrorCode != 0)\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 ErrorCodeConvert(nErrorCode);\r
 }\r
index 4dda141..c53f7c2 100644 (file)
@@ -62,7 +62,7 @@ int myExecute(wxString szCommandLine, wxString * szOutput, wxString szCwd)
        ::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
@@ -339,7 +339,8 @@ int __stdcall OpenArchive
        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
@@ -508,7 +509,7 @@ int __stdcall Command
 \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