mirror of
https://github.com/lltcggie/waifu2x-caffe.git
synced 2025-06-26 13:42:48 +00:00
GUIの自動開始設定の挙動が正しくなかったのを修正
This commit is contained in:
parent
6494205283
commit
9c7ab0df1f
@ -1997,36 +1997,40 @@ public:
|
|||||||
|
|
||||||
// ドロップされたファイル数を取得
|
// ドロップされたファイル数を取得
|
||||||
UINT FileNum = DragQueryFile((HDROP)wParam, 0xFFFFFFFF, szTmp, _countof(szTmp));
|
UINT FileNum = DragQueryFile((HDROP)wParam, 0xFFFFFFFF, szTmp, _countof(szTmp));
|
||||||
if (FileNum == 1)
|
if (FileNum > 0)
|
||||||
{
|
{
|
||||||
DragQueryFile((HDROP)wParam, 0, szTmp, _countof(szTmp));
|
if (FileNum == 1)
|
||||||
szTmp[_countof(szTmp) - 1] = TEXT('\0');
|
|
||||||
|
|
||||||
OnSetInputFilePath(szTmp);
|
|
||||||
}
|
|
||||||
else if (FileNum > 1)
|
|
||||||
{
|
|
||||||
input_str_multi.clear();
|
|
||||||
|
|
||||||
for (UINT i = 0; i < FileNum; i++)
|
|
||||||
{
|
{
|
||||||
TCHAR szTmp[AR_PATH_MAX];
|
DragQueryFile((HDROP)wParam, 0, szTmp, _countof(szTmp));
|
||||||
|
szTmp[_countof(szTmp) - 1] = TEXT('\0');
|
||||||
|
|
||||||
if (DragQueryFile((HDROP)wParam, i, szTmp, _countof(szTmp)) < _countof(szTmp))
|
OnSetInputFilePath(szTmp);
|
||||||
|
}
|
||||||
|
else if (FileNum > 1)
|
||||||
|
{
|
||||||
|
input_str.clear();
|
||||||
|
input_str_multi.clear();
|
||||||
|
|
||||||
|
for (UINT i = 0; i < FileNum; i++)
|
||||||
{
|
{
|
||||||
szTmp[_countof(szTmp) - 1] = TEXT('\0');
|
TCHAR szTmp[AR_PATH_MAX];
|
||||||
|
|
||||||
input_str_multi.push_back(szTmp);
|
if (DragQueryFile((HDROP)wParam, i, szTmp, _countof(szTmp)) < _countof(szTmp))
|
||||||
|
{
|
||||||
|
szTmp[_countof(szTmp) - 1] = TEXT('\0');
|
||||||
|
|
||||||
|
input_str_multi.push_back(szTmp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OnSetInputFilePath();
|
||||||
}
|
}
|
||||||
|
|
||||||
OnSetInputFilePath();
|
if (SendMessage(GetDlgItem(dh, IDC_RADIO_AUTO_START_ONE), BM_GETCHECK, 0, 0) ||
|
||||||
}
|
(SendMessage(GetDlgItem(dh, IDC_RADIO_AUTO_START_MULTI), BM_GETCHECK, 0, 0) && (input_str_multi.size() > 0 || boost::filesystem::is_directory(szTmp))))
|
||||||
|
{
|
||||||
if (SendMessage(GetDlgItem(dh, IDC_RADIO_AUTO_START_ONE), BM_GETCHECK, 0, 0) ||
|
::PostMessage(GetDlgItem(dh, IDC_BUTTON_EXEC), BM_CLICK, 0, 0);
|
||||||
(SendMessage(GetDlgItem(dh, IDC_RADIO_AUTO_START_MULTI), BM_GETCHECK, 0, 0) && input_str_multi.size() > 0))
|
}
|
||||||
{
|
|
||||||
::PostMessage(GetDlgItem(dh, IDC_BUTTON_EXEC), BM_CLICK, 0, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0L;
|
return 0L;
|
||||||
@ -2130,13 +2134,14 @@ public:
|
|||||||
{
|
{
|
||||||
szFile[szFile.size() - 1] = TEXT('\0');
|
szFile[szFile.size() - 1] = TEXT('\0');
|
||||||
|
|
||||||
input_str_multi.clear();
|
|
||||||
|
|
||||||
const TCHAR * ptr = szFile.data();
|
const TCHAR * ptr = szFile.data();
|
||||||
|
|
||||||
const auto firstLen = _tcslen(ptr);
|
const auto firstLen = _tcslen(ptr);
|
||||||
if (firstLen > 0)
|
if (firstLen > 0)
|
||||||
{
|
{
|
||||||
|
input_str.clear();
|
||||||
|
input_str_multi.clear();
|
||||||
|
|
||||||
if(firstLen + 2 >= szFile.size() || ptr[firstLen + 1] == '\0')
|
if(firstLen + 2 >= szFile.size() || ptr[firstLen + 1] == '\0')
|
||||||
OnSetInputFilePath(ptr);
|
OnSetInputFilePath(ptr);
|
||||||
else
|
else
|
||||||
@ -2167,8 +2172,8 @@ public:
|
|||||||
OnSetInputFilePath();
|
OnSetInputFilePath();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SendMessage(GetDlgItem(dh, IDC_RADIO_AUTO_START_ONE), BM_GETCHECK, 0, 0) ||
|
if ( SendMessage(GetDlgItem(dh, IDC_RADIO_AUTO_START_ONE), BM_GETCHECK, 0, 0) ||
|
||||||
(SendMessage(GetDlgItem(dh, IDC_RADIO_AUTO_START_MULTI), BM_GETCHECK, 0, 0) && input_str_multi.size() > 0))
|
(SendMessage(GetDlgItem(dh, IDC_RADIO_AUTO_START_MULTI), BM_GETCHECK, 0, 0) && (input_str_multi.size() > 0 || boost::filesystem::is_directory(szFile.data()))))
|
||||||
{
|
{
|
||||||
::PostMessage(GetDlgItem(dh, IDC_BUTTON_EXEC), BM_CLICK, 0, 0);
|
::PostMessage(GetDlgItem(dh, IDC_BUTTON_EXEC), BM_CLICK, 0, 0);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user