OSDN Git Service

ApplyAllの処理を改良。
authorsirakaba <sirakaba@9df91469-1e22-0410-86e7-ea8537beb833>
Fri, 24 Sep 2010 11:56:50 +0000 (11:56 +0000)
committersirakaba <sirakaba@9df91469-1e22-0410-86e7-ea8537beb833>
Fri, 24 Sep 2010 11:56:50 +0000 (11:56 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/tpi/tpi@343 9df91469-1e22-0410-86e7-ea8537beb833

src/lychee/dlg_process.cpp
src/lychee/dlg_process.h

index a498fda..8f42187 100644 (file)
@@ -63,6 +63,7 @@ void ProcessDialog::OnInit(wxInitDialogEvent &)
        this->gFile             = XRCCTRL(* this, "gFile",        wxGauge);\r
        this->gArchive          = XRCCTRL(* this, "gArchive",     wxGauge);\r
        this->fCancel           = false;\r
+       this->nOverwriteMode    = wxID_OK;\r
        g_procDlg = this;\r
 \r
        ::wxXmlResource::Get()->Unload(L_DIR_S_XRC wxT("dlg_process.xrc"));\r
@@ -187,19 +188,22 @@ int ProcessDialog::CallbackProc(unsigned int _uMsg, void * _pStructure)
                        if (piInfo->fnDestination.FileExists() || ::wxDirExists(piInfo->fnDestination.GetFullPath()))\r
                        {\r
                                // 上書き確認を行う。\r
-                               static int nMode = wxID_OK;\r
                                bool bPerm = false;\r
-                               if (nMode == wxID_OK)\r
+                               if (this->nOverwriteMode == wxID_OK)\r
                                {\r
                                        OverwriteDialog odDlg;\r
                                        odDlg.fnExist = & piInfo->fnDestination;\r
                                        odDlg.tmWrite = & piInfo->fiInfo.tmModified;\r
                                        odDlg.nWriteSize = piInfo->fiInfo.nUnpackedSize;\r
 \r
-                                       nMode = odDlg.ShowModal();\r
+                                       this->nOverwriteMode = odDlg.ShowModal();\r
                                        bPerm = odDlg.cbApplyAll->IsChecked();\r
                                }\r
-                               switch (nMode)\r
+                               else\r
+                               {\r
+                                       bPerm = true;\r
+                               }\r
+                               switch (this->nOverwriteMode)\r
                                {\r
                                case wxID_CANCEL:\r
                                        this->fCancel = true;\r
@@ -226,7 +230,7 @@ int ProcessDialog::CallbackProc(unsigned int _uMsg, void * _pStructure)
                                }\r
                                if (! bPerm)\r
                                {\r
-                                       nMode = wxID_OK;\r
+                                       this->nOverwriteMode = wxID_OK;\r
                                }\r
                        }\r
                        break;\r
index 5305753..bb1c49f 100644 (file)
@@ -35,6 +35,7 @@ public:
 \r
 private:\r
        bool fCancel;\r
+       int nOverwriteMode;\r
        wxTextCtrl* ebTarget;\r
        wxTextCtrl* ebSource;\r
        wxGauge* gFile;\r