From 79d321544e76fa29edcf2b11beb5bd72963cbd28 Mon Sep 17 00:00:00 2001 From: lltcggie Date: Sat, 7 May 2016 06:18:59 +0900 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E6=9C=9F=E3=83=87=E3=82=A3=E3=83=AC?= =?UTF-8?q?=E3=82=AF=E3=83=88=E3=83=AA=E3=81=AE=E8=A8=AD=E5=AE=9A=E3=81=AB?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- waifu2x-caffe-gui/MainDialog.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/waifu2x-caffe-gui/MainDialog.cpp b/waifu2x-caffe-gui/MainDialog.cpp index e04d308..d472f3b 100644 --- a/waifu2x-caffe-gui/MainDialog.cpp +++ b/waifu2x-caffe-gui/MainDialog.cpp @@ -1749,6 +1749,12 @@ void DialogEvent::Create(HWND hWnd, WPARAM wParam, LPARAM lParam, LPVOID lpData) SetWindowText(GetDlgItem(hWnd, IDC_EDIT_INPUT_EXT_LIST), inputFileExt.c_str()); + if (tOutputDirFix.length() > 0 && boost::filesystem::exists(tOutputDirFix)) + { + output_dir = tOutputDirFix; + SetWindowText(GetDlgItem(hWnd, IDC_EDIT_OUTPUT), output_dir.c_str()); + } + EnableWindow(GetDlgItem(dh, IDC_BUTTON_CANCEL), FALSE); // 前回の拡張子設定関連を復元 @@ -2166,6 +2172,11 @@ void DialogEvent::InputRef(HWND hWnd, WPARAM wParam, LPARAM lParam, LPVOID lpDat *tfp = TEXT('\0'); tfp++; + if (tInputDirFix.length() > 0 && boost::filesystem::exists(tInputDirFix)) + ofn.lpstrInitialDir = tInputDirFix.c_str(); + else + ofn.lpstrInitialDir = szPath; + ofn.lStructSize = sizeof(ofn); ofn.hwndOwner = dh; ofn.lpstrFile = szFile.data(); @@ -2173,7 +2184,6 @@ void DialogEvent::InputRef(HWND hWnd, WPARAM wParam, LPARAM lParam, LPVOID lpDat ofn.lpstrFilter = szFilter; ofn.nFilterIndex = 1; ofn.lpstrTitle = langStringList.GetString(L"MessageTitleInputDialog").c_str(); - ofn.lpstrInitialDir = szPath; ofn.lpstrCustomFilter = NULL; ofn.nMaxCustFilter = 0; ofn.lpstrFileTitle = NULL; @@ -2264,6 +2274,11 @@ void DialogEvent::OutputRef(HWND hWnd, WPARAM wParam, LPARAM lParam, LPVOID lpDa memcpy(tfp, allFilesExt.c_str(), allFilesExt.length() * sizeof(TCHAR)); tfp += allFilesExt.length(); + if (tOutputDirFix.length() > 0 && boost::filesystem::exists(tOutputDirFix)) + ofn.lpstrInitialDir = tOutputDirFix.c_str(); + else + ofn.lpstrInitialDir = szPath; + ofn.lStructSize = sizeof(ofn); ofn.hwndOwner = dh; ofn.lpstrFile = szFile.data(); @@ -2271,7 +2286,6 @@ void DialogEvent::OutputRef(HWND hWnd, WPARAM wParam, LPARAM lParam, LPVOID lpDa ofn.lpstrFilter = szFilter; ofn.nFilterIndex = 1; ofn.lpstrTitle = langStringList.GetString(L"MessageTitleInputDialog").c_str(); - ofn.lpstrInitialDir = szPath; ofn.lpstrCustomFilter = NULL; ofn.nMaxCustFilter = 0; ofn.lpstrFileTitle = NULL;