Develop and Download Open Source Software

Browse Subversion Repository

Diff of /trunk/teraterm/teraterm/filesys_log.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 9854 by zmatsuo, Tue Apr 12 13:20:46 2022 UTC revision 9856 by zmatsuo, Tue Apr 12 13:21:09 2022 UTC
# Line 578  static INT_PTR CALLBACK LogFnHook(HWND D Line 578  static INT_PTR CALLBACK LogFnHook(HWND D
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();
# Line 605  static INT_PTR CALLBACK LogFnHook(HWND D Line 607  static INT_PTR CALLBACK LogFnHook(HWND D
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);

Legend:
Removed from v.9854  
changed lines
  Added in v.9856

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26