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 8856 by zmatsuo, Mon Jul 13 15:31:46 2020 UTC revision 8857 by zmatsuo, Sat Jul 25 15:59:47 2020 UTC
# Line 89  static char BracketEndStr[] = "\033[201~ Line 89  static char BracketEndStr[] = "\033[201~
89    
90  static BOOL FSend = FALSE;  static BOOL FSend = FALSE;
91    
 HWND HWndLog = NULL; //steven add  
   
92  static HMODULE HTTFILE = NULL;  static HMODULE HTTFILE = NULL;
93  static int TTFILECount = 0;  static int TTFILECount = 0;
94    
# Line 101  PGetGetFname GetGetFname; Line 99  PGetGetFname GetGetFname;
99  PSetFileVar SetFileVar;  PSetFileVar SetFileVar;
100  PGetXFname GetXFname;  PGetXFname GetXFname;
101  PProtoInit ProtoInit;  PProtoInit ProtoInit;
102  PProtoParse ProtoParse;  static PProtoParse ProtoParse;
103  PProtoTimeOutProc ProtoTimeOutProc;  PProtoTimeOutProc ProtoTimeOutProc;
104  PProtoCancel ProtoCancel;  PProtoCancel ProtoCancel;
105  PTTFILESetUILanguageFile TTFILESetUILanguageFile;  PTTFILESetUILanguageFile TTFILESetUILanguageFile;
# Line 266  static BOOL OpenFTDlg(PFileVar fv) Line 264  static BOOL OpenFTDlg(PFileVar fv)
264    
265          fv->StartTime = 0;          fv->StartTime = 0;
266          fv->ProgStat = 0;          fv->ProgStat = 0;
267            cv.FilePause &= ~fv->OpId;
268    
269          if (fv->OpId != OpLog) {          if (fv->OpId != OpLog) {
270                  fv->HideDialog = ts.FTHideDialog;                  fv->HideDialog = ts.FTHideDialog;
# Line 275  static BOOL OpenFTDlg(PFileVar fv) Line 274  static BOOL OpenFTDlg(PFileVar fv)
274          {          {
275                  FTDlg->Create(hInst, HVTWin, fv, &cv, &ts);                  FTDlg->Create(hInst, HVTWin, fv, &cv, &ts);
276                  FTDlg->RefreshNum();                  FTDlg->RefreshNum();
                 if (fv->OpId == OpLog) {  
                         HWndLog = FTDlg->m_hWnd; // steven add  
                 }  
277          }          }
278    
279          if (fv->OpId==OpLog)          if (fv->OpId==OpLog)
# Line 286  static BOOL OpenFTDlg(PFileVar fv) Line 282  static BOOL OpenFTDlg(PFileVar fv)
282                  SendDlg = FTDlg; /* File send */                  SendDlg = FTDlg; /* File send */
283    
284          fv->StartTime = GetTickCount();          fv->StartTime = GetTickCount();
         if (fv->OpId == OpSendFile) {  
                 HWND HFTDlg = FTDlg->GetSafeHwnd();  
                 InitDlgProgress(HFTDlg, IDC_TRANSPROGRESS, &fv->ProgStat);  
                 ShowWindow(GetDlgItem(HFTDlg, IDC_TRANS_ELAPSED), SW_SHOW);  
         }  
285    
286          return (FTDlg!=NULL);          return (FTDlg!=NULL);
287  }  }
288    
289  void ShowFTDlg(WORD OpId)  static void ShowFTDlg(WORD OpId)
290  {  {
291          if (OpId == OpLog) {          if (OpId == OpLog) {
292                  if (FLogDlg != NULL) {                  if (FLogDlg != NULL) {
# Line 1173  void LogToFile() Line 1164  void LogToFile()
1164                  WriteBufLen = 0;                  WriteBufLen = 0;
1165                  WriteBuf = (PCHAR)malloc(WriteBufMax);                  WriteBuf = (PCHAR)malloc(WriteBufMax);
1166                  while (Get1(Buf,&Start,&Count,&b)) {                  while (Get1(Buf,&Start,&Count,&b)) {
1167                          if (((cv.FilePause & OpLog)==0) && (! cv.ProtoFlag))                          if (!FLogIsPause() && (! cv.ProtoFlag))
1168                          {                          {
1169                                  tmp[0] = 0;                                  tmp[0] = 0;
1170                                  if ( ts.LogTimestamp && eLineEnd ) {                                  if ( ts.LogTimestamp && eLineEnd ) {
# Line 1229  void LogToFile() Line 1220  void LogToFile()
1220    
1221                  while (Get1(Buf,&Start,&Count,&b))                  while (Get1(Buf,&Start,&Count,&b))
1222                  {                  {
1223                          if (((cv.FilePause & OpLog)==0) && (! cv.ProtoFlag))                          if (!FLogIsPause() && (! cv.ProtoFlag))
1224                          {                          {
1225                                  if ( ts.LogTimestamp && eLineEnd ) {                                  if ( ts.LogTimestamp && eLineEnd ) {
1226                                          char *strtime = NULL;                                          char *strtime = NULL;
# Line 1279  void LogToFile() Line 1270  void LogToFile()
1270                  cv.BStart = Start;                  cv.BStart = Start;
1271                  cv.BCount = Count;                  cv.BCount = Count;
1272          }          }
1273          if (((cv.FilePause & OpLog) !=0) || cv.ProtoFlag) return;          if (FLogIsPause() || cv.ProtoFlag) return;
1274          if (FLogDlg!=NULL)          if (FLogDlg!=NULL)
1275                  FLogDlg->RefreshNum();                  FLogDlg->RefreshNum();
1276    
# Line 1430  void FileTransEnd(WORD OpId) Line 1421  void FileTransEnd(WORD OpId)
1421                  {                  {
1422                          FLogDlg->DestroyWindow();                          FLogDlg->DestroyWindow();
1423                          FLogDlg = NULL;                          FLogDlg = NULL;
                         HWndLog = NULL; // steven add  
1424                  }                  }
1425                  FreeFileVar(&LogVar);                  FreeFileVar(&LogVar);
1426                  FreeLogBuf();                  FreeLogBuf();
# Line 1454  void FileTransEnd(WORD OpId) Line 1444  void FileTransEnd(WORD OpId)
1444          EndDdeCmnd(0);          EndDdeCmnd(0);
1445  }  }
1446    
1447    void FileTransPause(WORD OpId, BOOL Pause)
1448    {
1449            if (Pause) {
1450                    cv.FilePause |= OpId;
1451            }
1452            else {
1453                    cv.FilePause &= ~OpId;
1454            }
1455    }
1456    
1457  int FSOut1(BYTE b)  int FSOut1(BYTE b)
1458  {  {
1459          if (BinaryMode)          if (BinaryMode)
# Line 1637  void FileSend() Line 1637  void FileSend()
1637          FileTransEnd(OpSendFile);          FileTransEnd(OpSendFile);
1638  }  }
1639    
1640  void FLogChangeButton(BOOL Pause)  /**
1641     *      ログをポーズする
1642     *      元は FLogChangeButton() だった
1643     */
1644    void FLogPause(BOOL Pause)
1645  {  {
1646          if (FLogDlg!=NULL)          if (FLogDlg!=NULL)
1647                  FLogDlg->ChangeButton(Pause);                  FLogDlg->ChangeButton(Pause);
1648            FileTransPause(OpLog, Pause);
1649  }  }
1650    
1651  void FLogRefreshNum()  static BOOL OpenProtoDlg(PFileVar fv, int IdProto, int Mode, WORD Opt1, WORD Opt2)
 {  
         if (FLogDlg!=NULL)  
                 FLogDlg->RefreshNum();  
 }  
   
 BOOL OpenProtoDlg(PFileVar fv, int IdProto, int Mode, WORD Opt1, WORD Opt2)  
1652  {  {
1653          int vsize;          int vsize;
1654          PProtoDlg pd;          PProtoDlg pd;
# Line 1724  BOOL OpenProtoDlg(PFileVar fv, int IdPro Line 1723  BOOL OpenProtoDlg(PFileVar fv, int IdPro
1723          return TRUE;          return TRUE;
1724  }  }
1725    
1726  void CloseProtoDlg()  static void CloseProtoDlg()
1727  {  {
1728          if (PtDlg!=NULL)          if (PtDlg!=NULL)
1729          {          {
# Line 1746  void CloseProtoDlg() Line 1745  void CloseProtoDlg()
1745          }          }
1746  }  }
1747    
1748  BOOL ProtoStart()  static BOOL ProtoStart()
1749  {  {
1750          if (cv.ProtoFlag)          if (cv.ProtoFlag)
1751                  return FALSE;                  return FALSE;
# Line 1790  void ProtoEnd() Line 1789  void ProtoEnd()
1789          FreeFileVar(&FileVar);          FreeFileVar(&FileVar);
1790  }  }
1791    
1792    /**
1793     *      OnIdle()#teraterm.cppからコールされる
1794     *              cv.ProtoFlag が 0 以外のとき
1795     *      @retval         0               continue
1796     *                              1/2             ActiveWin(グローバル変数)の値(IdVT=1/IdTek=2)
1797     *                              注 今のところ捨てられている
1798     */
1799  int ProtoDlgParse()  int ProtoDlgParse()
1800  {  {
1801          int P;          int P;
# Line 2245  void LogWriteStr(const char *str) Line 2251  void LogWriteStr(const char *str)
2251                  WriteFile(LogVar->FileHandle, str, len, &wrote, NULL);                  WriteFile(LogVar->FileHandle, str, len, &wrote, NULL);
2252                  LogVar->ByteCount =                  LogVar->ByteCount =
2253                          LogVar->ByteCount + len;                          LogVar->ByteCount + len;
2254                  FLogRefreshNum();                  if (FLogDlg!=NULL)
2255                            FLogDlg->RefreshNum();
2256          }          }
2257  }  }
2258    
# Line 2343  char *LogGetLogFilename(const char *log_ Line 2350  char *LogGetLogFilename(const char *log_
2350    
2351          return _strdup(full_path);          return _strdup(full_path);
2352  }  }
2353    
2354    BOOL FLogIsPause()
2355    {
2356            return ((cv.FilePause & OpLog) !=0);
2357    }
2358    
2359    void FLogWindow(int nCmdShow)
2360    {
2361            if (FLogDlg == NULL)
2362                    return;
2363    
2364            HWND HWndLog = FLogDlg->m_hWnd;
2365            ShowWindow(HWndLog, nCmdShow);
2366            if (nCmdShow == SW_RESTORE) {
2367                    // 拡張スタイル WS_EX_NOACTIVATE 状態を解除する
2368                    SetForegroundWindow(HWndLog);
2369            }
2370    }
2371    
2372    void FLogShowDlg(void)
2373    {
2374            ShowFTDlg(OpLog);
2375    }

Legend:
Removed from v.8856  
changed lines
  Added in v.8857

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