| 563 |
SetI18nListW("Tera Term", Dialog, IDC_TIMESTAMPTYPE, timestamp_list, _countof(timestamp_list), |
SetI18nListW("Tera Term", Dialog, IDC_TIMESTAMPTYPE, timestamp_list, _countof(timestamp_list), |
| 564 |
pts->UILanguageFileW, 0); |
pts->UILanguageFileW, 0); |
| 565 |
|
|
| 566 |
SendDlgItemMessage(Dialog, IDC_TEXTCODING_DROPDOWN, CB_ADDSTRING, 0, (LPARAM)"UTF-8"); |
SendDlgItemMessageA(Dialog, IDC_TEXTCODING_DROPDOWN, CB_ADDSTRING, 0, (LPARAM)"UTF-8"); |
| 567 |
SendDlgItemMessage(Dialog, IDC_TEXTCODING_DROPDOWN, CB_ADDSTRING, 0, (LPARAM)"UTF-16LE"); |
SendDlgItemMessageA(Dialog, IDC_TEXTCODING_DROPDOWN, CB_ADDSTRING, 0, (LPARAM)"UTF-16LE"); |
| 568 |
SendDlgItemMessage(Dialog, IDC_TEXTCODING_DROPDOWN, CB_ADDSTRING, 0, (LPARAM)"UTF-16BE"); |
SendDlgItemMessageA(Dialog, IDC_TEXTCODING_DROPDOWN, CB_ADDSTRING, 0, (LPARAM)"UTF-16BE"); |
| 569 |
SendDlgItemMessage(Dialog, IDC_TEXTCODING_DROPDOWN, CB_SETCURSEL, 0, 0); |
SendDlgItemMessageA(Dialog, IDC_TEXTCODING_DROPDOWN, CB_SETCURSEL, 0, 0); |
| 570 |
|
|
| 571 |
|
// ファイル名を設定する |
| 572 |
|
// ファイルのチェック、コントロールの設定も行われる |
| 573 |
|
// WM_COMMAND, EN_CHANGE が発生する |
| 574 |
SetDlgItemTextW(Dialog, IDC_FOPT_FILENAME_EDIT, work->info->filename); |
SetDlgItemTextW(Dialog, IDC_FOPT_FILENAME_EDIT, work->info->filename); |
| 575 |
|
work->info->filename = NULL; |
| 576 |
|
|
| 577 |
// timestamp 種別 |
// timestamp 種別 |
| 578 |
int tstype = pts->LogTimestampType == TIMESTAMP_LOCAL ? 0 : |
int tstype = pts->LogTimestampType == TIMESTAMP_LOCAL ? 0 : |
| 579 |
pts->LogTimestampType == TIMESTAMP_UTC ? 1 : |
pts->LogTimestampType == TIMESTAMP_UTC ? 1 : |
| 580 |
pts->LogTimestampType == TIMESTAMP_ELAPSED_LOGSTART ? 2 : |
pts->LogTimestampType == TIMESTAMP_ELAPSED_LOGSTART ? 2 : |
| 581 |
pts->LogTimestampType == TIMESTAMP_ELAPSED_CONNECTED ? 3 : 0; |
pts->LogTimestampType == TIMESTAMP_ELAPSED_CONNECTED ? 3 : 0; |
| 582 |
SendDlgItemMessage(Dialog, IDC_TIMESTAMPTYPE, CB_SETCURSEL, tstype, 0); |
SendDlgItemMessageA(Dialog, IDC_TIMESTAMPTYPE, CB_SETCURSEL, tstype, 0); |
|
|
|
|
|
|
|
CheckLogFile(Dialog, work->info->filename, work); |
|
|
ArrangeControls(Dialog, work, pts->Append, pts->LogBinary, pts->LogTypePlainText, pts->LogTimestamp); |
|
|
work->info->filename = NULL; |
|
| 583 |
|
|
| 584 |
// Hide dialog チェックボックス |
// Hide dialog チェックボックス |
| 585 |
if (pts->LogHideDialog) { |
if (pts->LogHideDialog) { |
| 618 |
case IDC_FOPT_FILENAME_BUTTON: { |
case IDC_FOPT_FILENAME_BUTTON: { |
| 619 |
/* save current dir */ |
/* save current dir */ |
| 620 |
const wchar_t *UILanguageFile = work->pts->UILanguageFileW; |
const wchar_t *UILanguageFile = work->pts->UILanguageFileW; |
|
wchar_t *curdir; |
|
|
hGetCurrentDirectoryW(&curdir); |
|
| 621 |
|
|
| 622 |
wchar_t fname[MAX_PATH]; |
wchar_t *fname_ini; |
| 623 |
GetDlgItemTextW(Dialog, IDC_FOPT_FILENAME_EDIT, fname, _countof(fname)); |
hGetDlgItemTextW(Dialog, IDC_FOPT_FILENAME_EDIT, &fname_ini); |
| 624 |
|
|
| 625 |
const wchar_t* simple_log_filter = L"*.txt;*.log"; |
const wchar_t* simple_log_filter = L"*.txt;*.log"; |
| 626 |
wchar_t *FNFilter = GetCommonDialogFilterWW(simple_log_filter, UILanguageFile); |
wchar_t *FNFilter = GetCommonDialogFilterWW(simple_log_filter, UILanguageFile); |
| 632 |
aswprintf(&caption, L"Tera Term: %s", uimsg); |
aswprintf(&caption, L"Tera Term: %s", uimsg); |
| 633 |
free(uimsg); |
free(uimsg); |
| 634 |
|
|
| 635 |
OPENFILENAMEW ofn = {}; |
TTOPENFILENAMEW ofn = {}; |
|
ofn.lStructSize = get_OPENFILENAME_SIZEW(); |
|
| 636 |
//ofn.Flags = OFN_PATHMUSTEXIST | OFN_OVERWRITEPROMPT; |
//ofn.Flags = OFN_PATHMUSTEXIST | OFN_OVERWRITEPROMPT; |
| 637 |
ofn.Flags |= OFN_EXPLORER | OFN_ENABLESIZING; |
ofn.Flags |= OFN_EXPLORER | OFN_ENABLESIZING; |
| 638 |
ofn.Flags |= OFN_SHOWHELP; |
ofn.Flags |= OFN_SHOWHELP; |
|
ofn.Flags |= OFN_NOCHANGEDIR; // うまく動作しない環境もあるようだ |
|
| 639 |
ofn.hwndOwner = Dialog; |
ofn.hwndOwner = Dialog; |
| 640 |
ofn.lpstrFilter = FNFilter; |
ofn.lpstrFilter = FNFilter; |
| 641 |
ofn.nFilterIndex = 1; |
ofn.nFilterIndex = 1; |
| 642 |
ofn.lpstrFile = fname; |
ofn.lpstrFile = fname_ini; |
|
ofn.nMaxFile = _countof(fname); |
|
| 643 |
ofn.lpstrTitle = caption; |
ofn.lpstrTitle = caption; |
| 644 |
ofn.lpstrInitialDir = work->pts->LogDefaultPathW; |
ofn.lpstrInitialDir = work->pts->LogDefaultPathW; |
| 645 |
BOOL Ok = GetSaveFileNameW(&ofn); |
wchar_t *fname; |
| 646 |
free(caption); |
BOOL Ok = TTGetSaveFileNameW(&ofn, &fname); |
|
free(FNFilter); |
|
| 647 |
if (Ok) { |
if (Ok) { |
| 648 |
SetDlgItemTextW(Dialog, IDC_FOPT_FILENAME_EDIT, fname); |
SetDlgItemTextW(Dialog, IDC_FOPT_FILENAME_EDIT, fname); |
| 649 |
|
free(fname); |
| 650 |
} |
} |
| 651 |
|
free(caption); |
| 652 |
/* restore dir */ |
free(FNFilter); |
| 653 |
SetCurrentDirectoryW(curdir); |
free(fname_ini); |
|
free(curdir); |
|
| 654 |
|
|
| 655 |
break; |
break; |
| 656 |
} |
} |