Develop and Download Open Source Software

Browse CVS Repository

Diff of /ttssh2/teraterm/source/teraterm/filesys.cpp

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

revision 1.7 by yutakapon, Mon Dec 25 16:13:54 2006 UTC revision 1.8 by maya, Thu Jan 4 15:11:44 2007 UTC
# Line 165  static PProtoDlg PtDlg = NULL; Line 165  static PProtoDlg PtDlg = NULL;
165  BOOL OpenFTDlg(PFileVar fv)  BOOL OpenFTDlg(PFileVar fv)
166  {  {
167    PFileTransDlg FTDlg;    PFileTransDlg FTDlg;
168    #ifdef I18N
169      HWND HFTDlg;
170    #endif
171    
172    FTDlg = new CFileTransDlg();    FTDlg = new CFileTransDlg();
173        
174    if (FTDlg!=NULL)    if (FTDlg!=NULL)
175    {    {
176    #ifdef I18N
177        FTDlg->Create(fv, &cv, &ts);
178    #else
179      FTDlg->Create(fv, &cv);      FTDlg->Create(fv, &cv);
180    #endif
181      FTDlg->RefreshNum();      FTDlg->RefreshNum();
182      if (fv->OpId == OpLog)      if (fv->OpId == OpLog)
183        FTDlg->ShowWindow(SW_MINIMIZE);        FTDlg->ShowWindow(SW_MINIMIZE);
# Line 181  BOOL OpenFTDlg(PFileVar fv) Line 188  BOOL OpenFTDlg(PFileVar fv)
188    else    else
189      SendDlg = FTDlg; /* File send */      SendDlg = FTDlg; /* File send */
190    
191    #ifdef I18N
192      HFTDlg=FTDlg->GetSafeHwnd();
193    
194      GetDlgItemText(HFTDlg, IDC_TRANS_FILENAME, ts.UIMsg, sizeof(ts.UIMsg));
195      get_lang_msg("DLG_FILETRANS_FILENAME", ts.UIMsg, ts.UILanguageFile);
196      SetDlgItemText(HFTDlg, IDC_TRANS_FILENAME, ts.UIMsg);
197      GetDlgItemText(HFTDlg, IDC_FULLPATH_LABEL, ts.UIMsg, sizeof(ts.UIMsg));
198      get_lang_msg("DLG_FILETRANS_FULLPATH", ts.UIMsg, ts.UILanguageFile);
199      SetDlgItemText(HFTDlg, IDC_FULLPATH_LABEL, ts.UIMsg);
200      GetDlgItemText(HFTDlg, IDC_TRANS_TRANS, ts.UIMsg, sizeof(ts.UIMsg));
201      get_lang_msg("DLG_FILETRANS_TRNAS", ts.UIMsg, ts.UILanguageFile);
202      SetDlgItemText(HFTDlg, IDC_TRANS_TRANS, ts.UIMsg);
203      GetDlgItemText(HFTDlg, IDCANCEL, ts.UIMsg, sizeof(ts.UIMsg));
204      get_lang_msg("BTN_CANCEL", ts.UIMsg, ts.UILanguageFile);
205      SetDlgItemText(HFTDlg, IDCANCEL, ts.UIMsg);
206      GetDlgItemText(HFTDlg, IDC_TRANSPAUSESTART, ts.UIMsg, sizeof(ts.UIMsg));
207      get_lang_msg("DLG_FILETRANS_PAUSE", ts.UIMsg, ts.UILanguageFile);
208      SetDlgItemText(HFTDlg, IDC_TRANSPAUSESTART, ts.UIMsg);
209      GetDlgItemText(HFTDlg, IDC_TRANSHELP, ts.UIMsg, sizeof(ts.UIMsg));
210      get_lang_msg("BTN_HELP", ts.UIMsg, ts.UILanguageFile);
211      SetDlgItemText(HFTDlg, IDC_TRANSHELP, ts.UIMsg);
212    #endif
213    
214    return (FTDlg!=NULL);    return (FTDlg!=NULL);
215  }  }
216    
# Line 253  void LogStart() Line 283  void LogStart()
283                  strncat(LogVar->FullName, ts.LogDefaultName, sizeof(LogVar->FullName));                  strncat(LogVar->FullName, ts.LogDefaultName, sizeof(LogVar->FullName));
284                  ParseStrftimeFileName(LogVar->FullName);                  ParseStrftimeFileName(LogVar->FullName);
285    
286    #ifdef I18N
287                    if (! (*GetTransFname)(LogVar, ts.FileDir, GTF_LOG, &Option, &ts))
288    #else
289                  if (! (*GetTransFname)(LogVar, ts.FileDir, GTF_LOG, &Option))                  if (! (*GetTransFname)(LogVar, ts.FileDir, GTF_LOG, &Option))
290    #endif
291                  {                  {
292                          FreeFileVar(&LogVar);                          FreeFileVar(&LogVar);
293                          FreeTTFILE();                          FreeTTFILE();
# Line 279  void LogStart() Line 313  void LogStart()
313    
314          }          }
315          else          else
316    #ifdef I18N
317                    (*SetFileVar)(FileVar, &ts);
318    #else
319                  (*SetFileVar)(LogVar);                  (*SetFileVar)(LogVar);
320    #endif
321    
322          if (ts.TransBin > 0)          if (ts.TransBin > 0)
323          {          {
# Line 415  void CommentLogToFile(char *buf, int siz Line 453  void CommentLogToFile(char *buf, int siz
453          DWORD wrote;          DWORD wrote;
454    
455          if (LogVar == NULL || !LogVar->FileOpen) {          if (LogVar == NULL || !LogVar->FileOpen) {
456    #ifdef I18N
457                    char uimsg[MAX_UIMSG];
458                    strcpy(uimsg, "ERROR");
459                    get_lang_msg("MSG_ERROR", uimsg, ts.UILanguageFile);
460                    strcpy(ts.UIMsg, "It is not opened by the log file yet.");
461                    get_lang_msg("MSG_COMMENT_LOG_OPEN_ERROR", ts.UIMsg, ts.UILanguageFile);
462                    ::MessageBox(NULL, ts.UIMsg, uimsg, MB_OK|MB_ICONEXCLAMATION);
463    #else
464                  ::MessageBox(NULL, "It is not opened by the log file yet.", "ERROR", MB_OK|MB_ICONEXCLAMATION);                  ::MessageBox(NULL, "It is not opened by the log file yet.", "ERROR", MB_OK|MB_ICONEXCLAMATION);
465    #endif
466                  return;                  return;
467          }          }
468    
# Line 587  void FileSendStart() Line 634  void FileSendStart()
634    {    {
635      Option = MAKELONG(ts.TransBin,0);      Option = MAKELONG(ts.TransBin,0);
636          SendVar->FullName[0] = 0;          SendVar->FullName[0] = 0;
637    #ifdef I18N
638            if (! (*GetTransFname)(SendVar, ts.FileDir, GTF_SEND, &Option, &ts))
639    #else
640      if (! (*GetTransFname)(SendVar, ts.FileDir, GTF_SEND, &Option))      if (! (*GetTransFname)(SendVar, ts.FileDir, GTF_SEND, &Option))
641      {  #endif
642            {
643        FileTransEnd(OpSendFile);        FileTransEnd(OpSendFile);
644        return;        return;
645      }      }
646      ts.TransBin = LOWORD(Option);      ts.TransBin = LOWORD(Option);
647    }    }
648    else    else
649    #ifdef I18N
650        (*SetFileVar)(FileVar, &ts);
651    #else
652      (*SetFileVar)(SendVar);      (*SetFileVar)(SendVar);
653    #endif
654    
655    SendVar->FileHandle = _lopen(SendVar->FullName,OF_READ);    SendVar->FileHandle = _lopen(SendVar->FullName,OF_READ);
656    SendVar->FileOpen = (SendVar->FileHandle>0);    SendVar->FileOpen = (SendVar->FileHandle>0);
# Line 761  BOOL OpenProtoDlg(PFileVar fv, int IdPro Line 816  BOOL OpenProtoDlg(PFileVar fv, int IdPro
816  {  {
817    int vsize;    int vsize;
818    PProtoDlg pd;    PProtoDlg pd;
819    #ifdef I18N
820      HWND Hpd;
821    #endif
822    
823    ProtoId = IdProto;    ProtoId = IdProto;
824    
# Line 812  BOOL OpenProtoDlg(PFileVar fv, int IdPro Line 870  BOOL OpenProtoDlg(PFileVar fv, int IdPro
870      ProtoVar = NULL;      ProtoVar = NULL;
871      return FALSE;      return FALSE;
872    }    }
873    #ifdef I18N
874      pd->Create(fv,&ts);
875    #else
876    pd->Create(fv);    pd->Create(fv);
877    #endif
878    
879    #ifdef I18N
880      Hpd=pd->GetSafeHwnd();
881    
882      GetDlgItemText(Hpd, IDC_PROT_FILENAME, ts.UIMsg, sizeof(ts.UIMsg));
883      get_lang_msg("DLG_PROT_FIELNAME", ts.UIMsg, ts.UILanguageFile);
884      SetDlgItemText(Hpd, IDC_PROT_FILENAME, ts.UIMsg);
885      GetDlgItemText(Hpd, IDC_PROT_PROT, ts.UIMsg, sizeof(ts.UIMsg));
886      get_lang_msg("DLG_PROT_PROTO", ts.UIMsg, ts.UILanguageFile);
887      SetDlgItemText(Hpd, IDC_PROT_PROT, ts.UIMsg);
888      GetDlgItemText(Hpd, IDC_PROT_PACKET, ts.UIMsg, sizeof(ts.UIMsg));
889      get_lang_msg("DLG_PROT_PACKET", ts.UIMsg, ts.UILanguageFile);
890      SetDlgItemText(Hpd, IDC_PROT_PACKET, ts.UIMsg);
891      GetDlgItemText(Hpd, IDC_PROT_TRANS, ts.UIMsg, sizeof(ts.UIMsg));
892      get_lang_msg("DLG_PROT_TRANS", ts.UIMsg, ts.UILanguageFile);
893      SetDlgItemText(Hpd, IDC_PROT_TRANS, ts.UIMsg);
894      GetDlgItemText(Hpd, IDCANCEL, ts.UIMsg, sizeof(ts.UIMsg));
895      get_lang_msg("BTN_CANCEL", ts.UIMsg, ts.UILanguageFile);
896      SetDlgItemText(Hpd, IDCANCEL, ts.UIMsg);
897    #endif
898        
899    (*ProtoInit)(ProtoId,FileVar,ProtoVar,&cv,&ts);    (*ProtoInit)(ProtoId,FileVar,ProtoVar,&cv,&ts);
900    
# Line 893  int ProtoDlgParse() Line 975  int ProtoDlgParse()
975    P = ActiveWin;    P = ActiveWin;
976    if (PtDlg==NULL) return P;    if (PtDlg==NULL) return P;
977    
978    #ifdef I18N
979      if ((*ProtoParse)(ProtoId,FileVar,ProtoVar,&cv,&ts))
980    #else
981    if ((*ProtoParse)(ProtoId,FileVar,ProtoVar,&cv))    if ((*ProtoParse)(ProtoId,FileVar,ProtoVar,&cv))
982    #endif
983      P = 0; /* continue */      P = 0; /* continue */
984    else {    else {
985      CommSend(&cv);      CommSend(&cv);
# Line 932  void KermitStart(int mode) Line 1018  void KermitStart(int mode)
1018        FileVar->OpId = OpKmtSend;        FileVar->OpId = OpKmtSend;
1019        if (strlen(&(FileVar->FullName[FileVar->DirLen]))==0)        if (strlen(&(FileVar->FullName[FileVar->DirLen]))==0)
1020        {        {
1021    #ifdef I18N
1022            if (! (*GetMultiFname)(FileVar,ts.FileDir,GMF_KERMIT,&w,&ts) ||
1023    #else
1024          if (! (*GetMultiFname)(FileVar,ts.FileDir,GMF_KERMIT,&w) ||          if (! (*GetMultiFname)(FileVar,ts.FileDir,GMF_KERMIT,&w) ||
1025    #endif
1026              (FileVar->NumFname==0))              (FileVar->NumFname==0))
1027          {          {
1028            ProtoEnd();            ProtoEnd();
# Line 940  void KermitStart(int mode) Line 1030  void KermitStart(int mode)
1030          }          }
1031        }        }
1032        else        else
1033    #ifdef I18N
1034        (*SetFileVar)(FileVar, &ts);
1035    #else
1036          (*SetFileVar)(FileVar);          (*SetFileVar)(FileVar);
1037        break;  #endif
1038              break;
1039      case IdKmtReceive:      case IdKmtReceive:
1040        FileVar->OpId = OpKmtRcv;        FileVar->OpId = OpKmtRcv;
1041        break;        break;
# Line 957  void KermitStart(int mode) Line 1051  void KermitStart(int mode)
1051          }          }
1052        }        }
1053        else        else
1054    #ifdef I18N
1055        (*SetFileVar)(FileVar, &ts);
1056    #else
1057          (*SetFileVar)(FileVar);          (*SetFileVar)(FileVar);
1058        break;  #endif
1059              break;
1060      case IdKmtFinish:      case IdKmtFinish:
1061        FileVar->OpId = OpKmtFin;        FileVar->OpId = OpKmtFin;
1062        break;        break;
# Line 991  void XMODEMStart(int mode) Line 1089  void XMODEMStart(int mode)
1089    if (strlen(&(FileVar->FullName[FileVar->DirLen]))==0)    if (strlen(&(FileVar->FullName[FileVar->DirLen]))==0)
1090    {    {
1091      Option = MAKELONG(ts.XmodemBin,ts.XmodemOpt);      Option = MAKELONG(ts.XmodemBin,ts.XmodemOpt);
1092    #ifdef I18N
1093        if (! (*GetXFname)(FileVar->HMainWin,
1094          mode==IdXReceive,&Option,FileVar,ts.FileDir,&ts))
1095    #else
1096      if (! (*GetXFname)(FileVar->HMainWin,      if (! (*GetXFname)(FileVar->HMainWin,
1097        mode==IdXReceive,&Option,FileVar,ts.FileDir))        mode==IdXReceive,&Option,FileVar,ts.FileDir))
1098    #endif
1099      {      {
1100        ProtoEnd();        ProtoEnd();
1101        return;        return;
# Line 1001  void XMODEMStart(int mode) Line 1104  void XMODEMStart(int mode)
1104      ts.XmodemBin = LOWORD(Option);      ts.XmodemBin = LOWORD(Option);
1105    }    }
1106    else    else
1107    #ifdef I18N
1108        (*SetFileVar)(FileVar, &ts);
1109    #else
1110      (*SetFileVar)(FileVar);      (*SetFileVar)(FileVar);
1111    #endif
1112    
1113    if (mode==IdXReceive)    if (mode==IdXReceive)
1114      FileVar->FileHandle = _lcreat(FileVar->FullName,0);      FileVar->FileHandle = _lcreat(FileVar->FullName,0);
# Line 1038  void ZMODEMStart(int mode) Line 1145  void ZMODEMStart(int mode)
1145      FileVar->OpId = OpZSend;      FileVar->OpId = OpZSend;
1146      if (strlen(&(FileVar->FullName[FileVar->DirLen]))==0)      if (strlen(&(FileVar->FullName[FileVar->DirLen]))==0)
1147      {      {
1148    #ifdef I18N
1149          if (! (*GetMultiFname)(FileVar,ts.FileDir,GMF_Z,&Opt,&ts) ||
1150    #else
1151        if (! (*GetMultiFname)(FileVar,ts.FileDir,GMF_Z,&Opt) ||        if (! (*GetMultiFname)(FileVar,ts.FileDir,GMF_Z,&Opt) ||
1152    #endif
1153            (FileVar->NumFname==0))            (FileVar->NumFname==0))
1154        {        {
1155          ProtoEnd();          ProtoEnd();
# Line 1047  void ZMODEMStart(int mode) Line 1158  void ZMODEMStart(int mode)
1158        ts.XmodemBin = Opt;        ts.XmodemBin = Opt;
1159      }      }
1160      else      else
1161    #ifdef I18N
1162          (*SetFileVar)(FileVar, &ts);
1163    #else
1164        (*SetFileVar)(FileVar);        (*SetFileVar)(FileVar);
1165    #endif
1166    }    }
1167    else /* IdZReceive or IdZAuto */    else /* IdZReceive or IdZAuto */
1168      FileVar->OpId = OpZRcv;      FileVar->OpId = OpZRcv;
# Line 1074  void BPStart(int mode) Line 1189  void BPStart(int mode)
1189      if (strlen(&(FileVar->FullName[FileVar->DirLen]))==0)      if (strlen(&(FileVar->FullName[FileVar->DirLen]))==0)
1190      {      {
1191            FileVar->FullName[0] = 0;            FileVar->FullName[0] = 0;
1192    #ifdef I18N
1193          if (! (*GetTransFname)(FileVar, ts.FileDir, GTF_BP, &Option, &ts))
1194    #else
1195        if (! (*GetTransFname)(FileVar, ts.FileDir, GTF_BP, &Option))        if (! (*GetTransFname)(FileVar, ts.FileDir, GTF_BP, &Option))
1196        {  #endif
1197              {
1198          ProtoEnd();          ProtoEnd();
1199          return;          return;
1200        }        }
1201      }      }
1202      else      else
1203    #ifdef I18N
1204          (*SetFileVar)(FileVar, &ts);
1205    #else
1206        (*SetFileVar)(FileVar);        (*SetFileVar)(FileVar);
1207    #endif
1208    }    }
1209    else /* IdBPReceive or IdBPAuto */    else /* IdBPReceive or IdBPAuto */
1210      FileVar->OpId = OpBPRcv;      FileVar->OpId = OpBPRcv;
# Line 1109  void QVStart(int mode) Line 1231  void QVStart(int mode)
1231      FileVar->OpId = OpQVSend;      FileVar->OpId = OpQVSend;
1232      if (strlen(&(FileVar->FullName[FileVar->DirLen]))==0)      if (strlen(&(FileVar->FullName[FileVar->DirLen]))==0)
1233      {      {
1234    #ifdef I18N
1235          if (! (*GetMultiFname)(FileVar,ts.FileDir,GMF_QV, &W, &ts) ||
1236    #else
1237        if (! (*GetMultiFname)(FileVar,ts.FileDir,GMF_QV, &W) ||        if (! (*GetMultiFname)(FileVar,ts.FileDir,GMF_QV, &W) ||
1238    #endif
1239            (FileVar->NumFname==0))            (FileVar->NumFname==0))
1240        {        {
1241          ProtoEnd();          ProtoEnd();
# Line 1117  void QVStart(int mode) Line 1243  void QVStart(int mode)
1243        }        }
1244      }      }
1245      else      else
1246    #ifdef I18N
1247          (*SetFileVar)(FileVar, &ts);
1248    #else
1249        (*SetFileVar)(FileVar);        (*SetFileVar)(FileVar);
1250    #endif
1251    }    }
1252    else    else
1253      FileVar->OpId = OpQVRcv;      FileVar->OpId = OpQVRcv;
# Line 1134  void QVStart(int mode) Line 1264  void QVStart(int mode)
1264    
1265  /*  /*
1266   * $Log$   * $Log$
1267     * Revision 1.8  2007/01/04 15:11:44  maya
1268     * 表示メッセージの読み込み対応
1269     *
1270   * Revision 1.7  2006/12/25 16:13:54  yutakapon   * Revision 1.7  2006/12/25 16:13:54  yutakapon
1271   * ログ採取中にマクロがストールする問題への修正。   * ログ採取中にマクロがストールする問題への修正。
1272   * ログ採取中に一度マクロを止めると、バッファのインデックスが同期取れなくなり、   * ログ採取中に一度マクロを止めると、バッファのインデックスが同期取れなくなり、

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

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