| 578 |
break; |
break; |
| 579 |
case IDC_FOPT_FILENAME_BUTTON: { |
case IDC_FOPT_FILENAME_BUTTON: { |
| 580 |
/* save current dir */ |
/* save current dir */ |
| 581 |
const char *UILanguageFile = work->pts->UILanguageFile; |
const wchar_t *UILanguageFile = work->pts->UILanguageFileW; |
| 582 |
wchar_t curdir[MAXPATHLEN]; |
wchar_t curdir[MAXPATHLEN]; |
| 583 |
GetCurrentDirectoryW(_countof(curdir), curdir); |
GetCurrentDirectoryW(_countof(curdir), curdir); |
| 584 |
|
|
| 585 |
wchar_t fname[MAX_PATH]; |
wchar_t fname[MAX_PATH]; |
| 586 |
GetDlgItemTextW(Dialog, IDC_FOPT_FILENAME_EDIT, fname, _countof(fname)); |
GetDlgItemTextW(Dialog, IDC_FOPT_FILENAME_EDIT, fname, _countof(fname)); |
| 587 |
|
|
| 588 |
wchar_t *FNFilter = GetCommonDialogFilterW(NULL, UILanguageFile); |
const wchar_t* simple_log_filter = L"*.txt;*.log"; |
| 589 |
|
wchar_t *FNFilter = GetCommonDialogFilterWW(simple_log_filter, UILanguageFile); |
| 590 |
|
|
| 591 |
wchar_t caption[MAX_PATH]; |
wchar_t *caption; |
| 592 |
wchar_t uimsg[MAX_UIMSG]; |
wchar_t *uimsg; |
| 593 |
get_lang_msgW("FILEDLG_TRANS_TITLE_LOG", uimsg, _countof(uimsg), TitLog, UILanguageFile); |
GetI18nStrWW("Tera Term", "FILEDLG_TRANS_TITLE_LOG", |
| 594 |
wcsncpy_s(caption, _countof(caption), L"Tera Term: ", _TRUNCATE); |
TitLog, UILanguageFile, &uimsg); |
| 595 |
wcsncat_s(caption, _countof(caption), uimsg, _TRUNCATE); |
aswprintf(&caption, L"Tera Term: %s", uimsg); |
| 596 |
|
free(uimsg); |
| 597 |
|
|
| 598 |
OPENFILENAMEW ofn = {}; |
OPENFILENAMEW ofn = {}; |
| 599 |
ofn.lStructSize = get_OPENFILENAME_SIZEW(); |
ofn.lStructSize = get_OPENFILENAME_SIZEW(); |
| 607 |
ofn.lpstrFile = fname; |
ofn.lpstrFile = fname; |
| 608 |
ofn.nMaxFile = _countof(fname); |
ofn.nMaxFile = _countof(fname); |
| 609 |
ofn.lpstrTitle = caption; |
ofn.lpstrTitle = caption; |
| 610 |
|
ofn.lpstrInitialDir = ToWcharA(work->pts->LogDefaultPath); |
| 611 |
BOOL Ok = GetSaveFileNameW(&ofn); |
BOOL Ok = GetSaveFileNameW(&ofn); |
| 612 |
|
free((void *)ofn.lpstrInitialDir); |
| 613 |
|
free(caption); |
| 614 |
free(FNFilter); |
free(FNFilter); |
| 615 |
if (Ok) { |
if (Ok) { |
| 616 |
SetDlgItemTextW(Dialog, IDC_FOPT_FILENAME_EDIT, fname); |
SetDlgItemTextW(Dialog, IDC_FOPT_FILENAME_EDIT, fname); |