[Ttssh2-commit] [4454] ファイル転送ダイアログ / ファイル送信ダイアログで、経過時間と転送速度を表示するようにした。

svnno****@sourc***** svnno****@sourc*****
2011年 4月 19日 (火) 22:23:37 JST


Revision: 4454
          http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=4454
Author:   doda
Date:     2011-04-19 22:23:37 +0900 (Tue, 19 Apr 2011)

Log Message:
-----------
ファイル転送ダイアログ/ファイル送信ダイアログで、経過時間と転送速度を表示するようにした。

Modified Paths:
--------------
    trunk/teraterm/common/dlglib.c
    trunk/teraterm/common/dlglib.h
    trunk/teraterm/common/tt_res.h
    trunk/teraterm/common/ttftypes.h
    trunk/teraterm/common/tttypes.h
    trunk/teraterm/teraterm/filesys.cpp
    trunk/teraterm/teraterm/ftdlg.cpp
    trunk/teraterm/teraterm/ttermpro.rc
    trunk/teraterm/ttpfile/bplus.c
    trunk/teraterm/ttpfile/ftlib.c
    trunk/teraterm/ttpfile/kermit.c
    trunk/teraterm/ttpfile/quickvan.c
    trunk/teraterm/ttpfile/xmodem.c
    trunk/teraterm/ttpfile/ymodem.c
    trunk/teraterm/ttpfile/zmodem.c


-------------- next part --------------
Modified: trunk/teraterm/common/dlglib.c
===================================================================
--- trunk/teraterm/common/dlglib.c	2011-04-19 07:13:07 UTC (rev 4453)
+++ trunk/teraterm/common/dlglib.c	2011-04-19 13:23:37 UTC (rev 4454)
@@ -116,6 +116,39 @@
 	}
 }
 
+void SetDlgTime(HWND HDlg, int id_Item, DWORD stime, int bytes)
+{
+	static int prev_elapsed;
+	int elapsed, rate;
+	char buff[64];
+
+	elapsed = (GetTickCount() - stime) / 1000;
+
+	if (elapsed == 0) {
+		prev_elapsed = 0;
+		SetDlgItemText(HDlg, id_Item, "0:00");
+		return;
+	}
+
+	if (elapsed == prev_elapsed) {
+		return;
+	}
+	prev_elapsed = elapsed;
+
+	rate = bytes / elapsed;
+	if (rate < 1200) {
+		_snprintf_s(buff, sizeof(buff), _TRUNCATE, "%d:%02d (%dBytes/s)", elapsed / 60, elapsed % 60, rate); 
+	}
+	else if (rate < 1200000) {
+		_snprintf_s(buff, sizeof(buff), _TRUNCATE, "%d:%02d (%d.%02dKB/s)", elapsed / 60, elapsed % 60, rate / 1000, rate / 10 % 100); 
+	}
+	else {
+		_snprintf_s(buff, sizeof(buff), _TRUNCATE, "%d:%02d (%d.%02dMB/s)", elapsed / 60, elapsed % 60, rate / (1000 * 1000), rate / 10000 % 100); 
+	}
+
+	SetDlgItemText(HDlg, id_Item, buff);
+}
+
 void SetDropDownList(HWND HDlg, int Id_Item, PCHAR far *List, int nsel)
 {
 	int i;

Modified: trunk/teraterm/common/dlglib.h
===================================================================
--- trunk/teraterm/common/dlglib.h	2011-04-19 07:13:07 UTC (rev 4453)
+++ trunk/teraterm/common/dlglib.h	2011-04-19 13:23:37 UTC (rev 4454)
@@ -14,6 +14,7 @@
 void GetRB(HWND HDlg, LPWORD R, int FirstId, int LastId);
 void SetDlgNum(HWND HDlg, int id_Item, LONG Num);
 void SetDlgPercent(HWND HDlg, int id_Item, int id_Progress, LONG a, LONG b, int *prog);
+void SetDlgTime(HWND HDlg, int id_Item, DWORD elapsed, int bytes);
 void SetDropDownList(HWND HDlg, int Id_Item, PCHAR far *List, int nsel);
 LONG GetCurSel(HWND HDlg, int Id_Item);
 void InitDlgProgress(HWND HDlg, int id_Progress, int *CurProgStat);

Modified: trunk/teraterm/common/tt_res.h
===================================================================
--- trunk/teraterm/common/tt_res.h	2011-04-19 07:13:07 UTC (rev 4453)
+++ trunk/teraterm/common/tt_res.h	2011-04-19 13:23:37 UTC (rev 4454)
@@ -1,6 +1,6 @@
 //{{NO_DEPENDENCIES}}
 // Microsoft Visual C++ generated include file.
-// Used by t:\ttssh2\teraterm\teraterm\ttermpro.rc
+// Used by i:\My Documents\Visual Studio 2005\Projects\TeraTerm\teraterm\teraterm\ttermpro.rc
 //
 #define IDI_TTERM                       100
 #define IDR_ACC                         100
@@ -144,6 +144,10 @@
 #define IDC_CONFIRM_STRING_FILE_LABEL   2522
 #define IDC_CLEAR_ON_RESIZE             2523
 #define IDC_CURSOR_CHANGE_IME           2524
+#define IDC_PROT_ELAPSED                2525
+#define IDC_PROTOELAPSEDTIME            2526
+#define IDC_ELAPSEDTEXT                 2527
+#define IDC_ELAPSEDTIME                 2528
 #define ID_ACC_SENDBREAK                50001
 #define ID_ACC_COPY                     50002
 #define ID_ACC_NEWCONNECTION            50003

Modified: trunk/teraterm/common/ttftypes.h
===================================================================
--- trunk/teraterm/common/ttftypes.h	2011-04-19 07:13:07 UTC (rev 4453)
+++ trunk/teraterm/common/ttftypes.h	2011-04-19 13:23:37 UTC (rev 4454)
@@ -97,6 +97,8 @@
   int FlushLogLineBuf;
 
   int ProgStat;
+
+  DWORD StartTime;
 } TFileVar;
 typedef TFileVar far *PFileVar;
 

Modified: trunk/teraterm/common/tttypes.h
===================================================================
--- trunk/teraterm/common/tttypes.h	2011-04-19 07:13:07 UTC (rev 4453)
+++ trunk/teraterm/common/tttypes.h	2011-04-19 13:23:37 UTC (rev 4454)
@@ -578,6 +578,7 @@
 #define IdMouseTrackBtnEvent 5
 #define IdMouseTrackAllEvent 6
 #define IdMouseTrackNetTerm  7
+#define IdMouseTrackJSBTerm  8
 
   /* Mouse event */
 #define IdMouseEventCurStat  0

Modified: trunk/teraterm/teraterm/filesys.cpp
===================================================================
--- trunk/teraterm/teraterm/filesys.cpp	2011-04-19 07:13:07 UTC (rev 4453)
+++ trunk/teraterm/teraterm/filesys.cpp	2011-04-19 13:23:37 UTC (rev 4454)
@@ -195,6 +195,9 @@
 
 	FTDlg = new CFileTransDlg();
 
+	fv->StartTime = 0;
+	fv->ProgStat = 0;
+
 	if (FTDlg!=NULL)
 	{
 		FTDlg->Create(fv, &cv, &ts);
@@ -231,11 +234,10 @@
 	SetDlgItemText(HFTDlg, IDC_TRANSHELP, ts.UIMsg);
 
 	if (fv->OpId == OpSendFile) {
+		fv->StartTime = GetTickCount();
 		InitDlgProgress(HFTDlg, IDC_TRANSPROGRESS, &fv->ProgStat);
+		ShowWindow(GetDlgItem(HFTDlg, IDC_ELAPSEDTEXT), SW_SHOW);
 	}
-	else {
-		fv->ProgStat = -1;
-	}
 
 	return (FTDlg!=NULL);
 }

Modified: trunk/teraterm/teraterm/ftdlg.cpp
===================================================================
--- trunk/teraterm/teraterm/ftdlg.cpp	2011-04-19 07:13:07 UTC (rev 4453)
+++ trunk/teraterm/teraterm/ftdlg.cpp	2011-04-19 13:23:37 UTC (rev 4454)
@@ -108,7 +108,34 @@
 {
 	char NumStr[24];
 	double rate;
+	int rate2;
+	static DWORD prev_elapsed;
+	DWORD elapsed;
 
+	if (fv->OpId == OpSendFile) {
+		if (fv->StartTime == 0) {
+			SetDlgItemText(IDC_ELAPSEDTIME, "0:00");
+			prev_elapsed = 0;
+		}
+		else {
+			elapsed = (GetTickCount() - fv->StartTime) / 1000;
+			if (elapsed != prev_elapsed && elapsed != 0) {
+				rate2 = fv->ByteCount / elapsed;
+				if (rate2 < 1200) {
+					_snprintf_s(NumStr, sizeof(NumStr), _TRUNCATE, "%d:%02d (%dBytes/s)", elapsed / 60, elapsed % 60, rate2);
+				}
+				else if (rate2 < 1200000) {
+					_snprintf_s(NumStr, sizeof(NumStr), _TRUNCATE, "%d:%02d (%d.%02dKB/s)", elapsed / 60, elapsed % 60, rate2 / 1000, rate2 / 10 % 100);
+				}
+				else {
+					_snprintf_s(NumStr, sizeof(NumStr), _TRUNCATE, "%d:%02d (%d.%02dMB/s)", elapsed / 60, elapsed % 60, rate2 / (1000*1000), rate2 / 10000 % 100);
+				}
+				SetDlgItemText(IDC_ELAPSEDTIME, NumStr);
+				prev_elapsed = elapsed;
+			}
+		}
+	}
+
 	if (fv->OpId == OpSendFile && fv->FileSize > 0) {
 		rate = 100.0 * (double)fv->ByteCount / (double)fv->FileSize;
 		if (fv->ProgStat < (int)rate) {

Modified: trunk/teraterm/teraterm/ttermpro.rc
===================================================================
--- trunk/teraterm/teraterm/ttermpro.rc	2011-04-19 07:13:07 UTC (rev 4453)
+++ trunk/teraterm/teraterm/ttermpro.rc	2011-04-19 13:23:37 UTC (rev 4454)
@@ -219,7 +219,7 @@
     DEFPUSHBUTTON   "Cancel",IDCANCEL,14,22,42,14
 END
 
-IDD_FILETRANSDLG DIALOGEX 20, 20, 176, 86
+IDD_FILETRANSDLG DIALOGEX 20, 20, 176, 96
 STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
 CLASS "FTDlg32"
 FONT 14, "System", 0, 0, 0x0
@@ -230,13 +230,15 @@
     EDITTEXT        IDC_EDIT_FULLPATH,55,24,106,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,WS_EX_CLIENTEDGE
     CONTROL         "Bytes transfered:",IDC_TRANS_TRANS,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,15,38,76,10
     RTEXT           "",IDC_TRANSBYTES,97,38,64,10
-    CONTROL         "",IDC_TRANSPROGRESS,"msctls_progress32",NOT WS_VISIBLE | WS_BORDER,15,50,146,12
-    DEFPUSHBUTTON   "Close",IDCANCEL,18,66,40,14
-    PUSHBUTTON      "Pau&se",IDC_TRANSPAUSESTART,68,66,40,14
-    PUSHBUTTON      "&Help",IDC_TRANSHELP,118,66,40,14
+    CONTROL         "Elapsed time:",IDC_ELAPSEDTEXT,"Static",SS_LEFTNOWORDWRAP | NOT WS_VISIBLE, 15,48,46,8
+    RTEXT           "",IDC_ELAPSEDTIME,60,48,101,8
+    CONTROL         "",IDC_TRANSPROGRESS,"msctls_progress32",NOT WS_VISIBLE | WS_BORDER,15,60,146,12
+    DEFPUSHBUTTON   "Close",IDCANCEL,18,76,40,14
+    PUSHBUTTON      "Pau&se",IDC_TRANSPAUSESTART,68,76,40,14
+    PUSHBUTTON      "&Help",IDC_TRANSHELP,118,76,40,14
 END
 
-IDD_PROTDLG DIALOGEX 20, 20, 142, 85
+IDD_PROTDLG DIALOGEX 20, 20, 142, 95
 STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
 FONT 14, "System", 0, 0, 0x0
 BEGIN
@@ -248,9 +250,11 @@
     RTEXT           "",IDC_PROTOPKTNUM,90,28,40,8
     CONTROL         "Bytes transfered:",IDC_PROT_TRANS,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,12,38,70,8
     RTEXT           "",IDC_PROTOBYTECOUNT,90,38,40,8
-    RTEXT           "",IDC_PROTOPERCENT,104,51,26,8,0,WS_EX_TRANSPARENT
-    CONTROL         "",IDC_PROTOPROGRESS,"msctls_progress32",NOT WS_VISIBLE | WS_BORDER | 0x1,12,48,92,14,WS_EX_TRANSPARENT
-    DEFPUSHBUTTON   "Cancel",IDCANCEL,51,67,40,14
+    LTEXT           "Elapsed Time:",IDC_PROT_ELAPSED,12,48,46,8
+    RTEXT           "",IDC_PROTOELAPSEDTIME,60,48,70,8
+    RTEXT           "",IDC_PROTOPERCENT,104,61,26,8,0,WS_EX_TRANSPARENT
+    CONTROL         "",IDC_PROTOPROGRESS,"msctls_progress32",NOT WS_VISIBLE | WS_BORDER | 0x1,12,58,92,14,WS_EX_TRANSPARENT
+    DEFPUSHBUTTON   "Cancel",IDCANCEL,51,77,40,14
 END
 
 IDD_CLIPBOARD_DIALOG DIALOGEX 0, 0, 216, 132

Modified: trunk/teraterm/ttpfile/bplus.c
===================================================================
--- trunk/teraterm/ttpfile/bplus.c	2011-04-19 07:13:07 UTC (rev 4453)
+++ trunk/teraterm/ttpfile/bplus.c	2011-04-19 13:23:37 UTC (rev 4454)
@@ -66,6 +66,7 @@
   SetDlgItemText(fv->HWin, IDC_PROTOPROT, "B-Plus");
 
   InitDlgProgress(fv->HWin, IDC_PROTOPROGRESS, &fv->ProgStat);
+  fv->StartTime = GetTickCount();
 
   /* file name, file size */
   if (bv->BPMode==IdBPSend)
@@ -442,6 +443,7 @@
   if (fv->FileSize>0)
     SetDlgPercent(fv->HWin, IDC_PROTOPERCENT, IDC_PROTOPROGRESS,
       fv->ByteCount, fv->FileSize, &fv->ProgStat);
+  SetDlgTime(fv->HWin, IDC_PROTOELAPSEDTIME, fv->StartTime, fv->ByteCount);
 }
 
 void BPCheckPacket(PFileVar fv, PBPVar bv, PComVar cv)
@@ -639,6 +641,7 @@
       if (fv->FileSize>0)
 	SetDlgPercent(fv->HWin, IDC_PROTOPERCENT, IDC_PROTOPROGRESS,
 	  fv->ByteCount, fv->FileSize, &fv->ProgStat);
+      SetDlgTime(fv->HWin, IDC_PROTOELAPSEDTIME, fv->StartTime, fv->ByteCount);
       break;
     case 'T':
       BPParseTPacket(fv,bv); /* File transfer */

Modified: trunk/teraterm/ttpfile/ftlib.c
===================================================================
--- trunk/teraterm/ttpfile/ftlib.c	2011-04-19 07:13:07 UTC (rev 4453)
+++ trunk/teraterm/ttpfile/ftlib.c	2011-04-19 13:23:37 UTC (rev 4454)
@@ -185,5 +185,7 @@
     fv->ProgStat = 0;
   }
 
+  fv->StartTime = GetTickCount();
+
   return fv->FileOpen;
 }

Modified: trunk/teraterm/ttpfile/kermit.c
===================================================================
--- trunk/teraterm/ttpfile/kermit.c	2011-04-19 07:13:07 UTC (rev 4453)
+++ trunk/teraterm/ttpfile/kermit.c	2011-04-19 13:23:37 UTC (rev 4454)
@@ -348,6 +348,7 @@
   if (Buff==NULL)
     SetDlgNum(fv->HWin, IDC_PROTOBYTECOUNT, fv->ByteCount);
   *BuffLen = BuffPtr;
+  SetDlgTime(fv->HWin, IDC_PROTOELAPSEDTIME, fv->StartTime, fv->ByteCount);
 }
 
 BOOL KmtEncode(PFileVar fv, PKmtVar kv)
@@ -464,6 +465,7 @@
   SetDlgNum(fv->HWin, IDC_PROTOBYTECOUNT, fv->ByteCount);
   SetDlgPercent(fv->HWin, IDC_PROTOPERCENT, IDC_PROTOPROGRESS,
                 fv->ByteCount, fv->FileSize, &fv->ProgStat);
+  SetDlgTime(fv->HWin, IDC_PROTOELAPSEDTIME, fv->StartTime, fv->ByteCount);
   DataLen = 0;
   DataLenNew = 0;
 
@@ -484,6 +486,7 @@
     SetDlgNum(fv->HWin, IDC_PROTOBYTECOUNT, fv->ByteCount);
     SetDlgPercent(fv->HWin, IDC_PROTOPERCENT, IDC_PROTOPROGRESS,
                   fv->ByteCount, fv->FileSize, &fv->ProgStat);
+    SetDlgTime(fv->HWin, IDC_PROTOELAPSEDTIME, fv->StartTime, fv->ByteCount);
     KmtSendEOFPacket(fv,kv,cv);
   }
   else {
@@ -533,11 +536,13 @@
 
   fv->ByteCount = 0;
   fv->ProgStat = 0;
+  fv->StartTime = GetTickCount();
 
   SetDlgItemText(fv->HWin, IDC_PROTOFNAME, &(fv->FullName[fv->DirLen]));
   SetDlgNum(fv->HWin, IDC_PROTOBYTECOUNT, fv->ByteCount);
   SetDlgPercent(fv->HWin, IDC_PROTOPERCENT, IDC_PROTOPROGRESS,
                 fv->ByteCount, fv->FileSize, &fv->ProgStat);
+  SetDlgTime(fv->HWin, IDC_PROTOELAPSEDTIME, fv->StartTime, fv->ByteCount);
 
   KmtIncPacketNum(kv);
   strncpy_s(&(kv->PktOut[4]),sizeof(kv->PktOut)-4,&(fv->FullName[fv->DirLen]),_TRUNCATE); // put FName
@@ -611,9 +616,11 @@
 
   if (kv->KmtMode == IdKmtSend) {
     InitDlgProgress(fv->HWin, IDC_PROTOPROGRESS, &fv->ProgStat);
+    fv->StartTime = GetTickCount();
   }
   else {
     fv->ProgStat = -1;
+    fv->StartTime = 0;
   }
 
   fv->FileOpen = FALSE;

Modified: trunk/teraterm/ttpfile/quickvan.c
===================================================================
--- trunk/teraterm/ttpfile/quickvan.c	2011-04-19 07:13:07 UTC (rev 4453)
+++ trunk/teraterm/ttpfile/quickvan.c	2011-04-19 13:23:37 UTC (rev 4454)
@@ -112,6 +112,7 @@
   SetDlgItemText(fv->HWin, IDC_PROTOPROT, "Quick-VAN");
 
   InitDlgProgress(fv->HWin, IDC_PROTOPROGRESS, &fv->ProgStat);
+  fv->StartTime = GetTickCount();
 
   qv->SeqNum = 0;
   qv->FileNum = 0;
@@ -398,6 +399,7 @@
   if (fv->FileSize>0)
     SetDlgPercent(fv->HWin, IDC_PROTOPERCENT, IDC_PROTOPROGRESS,
       0, fv->FileSize, &fv->ProgStat);
+  SetDlgTime(fv->HWin, IDC_PROTOELAPSEDTIME, fv->StartTime, fv->ByteCount);
 
   /* Send VRPOS */
   QVSetResPacket(qv,'P',0,0);
@@ -477,6 +479,7 @@
   if (fv->FileSize>0)
     SetDlgPercent(fv->HWin, IDC_PROTOPERCENT, IDC_PROTOPROGRESS,
       fv->ByteCount, fv->FileSize, &fv->ProgStat);
+  SetDlgTime(fv->HWin, IDC_PROTOELAPSEDTIME, fv->StartTime, fv->ByteCount);
 }
 
 BOOL QVCheckWindow8(PQVVar qv, WORD w0, WORD w1, BYTE b, LPWORD  w)
@@ -786,6 +789,7 @@
   /* file no. */
   qv->FileNum++;
   fv->ProgStat = 0;
+  fv->StartTime = GetTickCount();
   i = 3;
   QVPutNum2(qv,qv->FileNum,&i);
   /* file name */
@@ -852,6 +856,7 @@
     SetDlgNum(fv->HWin, IDC_PROTOBYTECOUNT, fv->ByteCount);
     SetDlgPercent(fv->HWin, IDC_PROTOPERCENT, IDC_PROTOPROGRESS,
 		  fv->ByteCount, fv->FileSize, &fv->ProgStat);
+    SetDlgTime(fv->HWin, IDC_PROTOELAPSEDTIME, fv->StartTime, fv->ByteCount);
     for (i = C ; i <= 127 ; i++)
       qv->PktOut[3+i] = 0;
     /* send VDAT */

Modified: trunk/teraterm/ttpfile/xmodem.c
===================================================================
--- trunk/teraterm/ttpfile/xmodem.c	2011-04-19 07:13:07 UTC (rev 4453)
+++ trunk/teraterm/ttpfile/xmodem.c	2011-04-19 13:23:37 UTC (rev 4454)
@@ -175,6 +175,7 @@
 	} else {
 		fv->ProgStat = -1;
 	}
+	fv->StartTime = GetTickCount();
 
 	SetWindowText(fv->HWin, fv->DlgCaption);
 	SetDlgItemText(fv->HWin, IDC_PROTOFNAME, &(fv->FullName[fv->DirLen]));
@@ -372,6 +373,7 @@
 
 	SetDlgNum(fv->HWin, IDC_PROTOPKTNUM, xv->PktNumOffset + xv->PktNum);
 	SetDlgNum(fv->HWin, IDC_PROTOBYTECOUNT, fv->ByteCount);
+	SetDlgTime(fv->HWin, IDC_PROTOELAPSEDTIME, fv->StartTime, fv->ByteCount);
 
 	FTSetTimeOut(fv, xv->TOutLong);
 
@@ -503,6 +505,7 @@
 		SetDlgNum(fv->HWin, IDC_PROTOBYTECOUNT, fv->ByteCount);
 		SetDlgPercent(fv->HWin, IDC_PROTOPERCENT, IDC_PROTOPROGRESS,
 					  fv->ByteCount, fv->FileSize, &fv->ProgStat);
+		SetDlgTime(fv->HWin, IDC_PROTOELAPSEDTIME, fv->StartTime, fv->ByteCount);
 	}
 
 	return TRUE;

Modified: trunk/teraterm/ttpfile/ymodem.c
===================================================================
--- trunk/teraterm/ttpfile/ymodem.c	2011-04-19 07:13:07 UTC (rev 4453)
+++ trunk/teraterm/ttpfile/ymodem.c	2011-04-19 13:23:37 UTC (rev 4454)
@@ -197,6 +197,7 @@
 	} else {
 		fv->ProgStat = -1;
 	}
+	fv->StartTime = GetTickCount();
 	SetDlgItemText(fv->HWin, IDC_PROTOFNAME, &(fv->FullName[fv->DirLen]));
 
 	yv->PktNumOffset = 0;
@@ -538,6 +539,7 @@
 
 	SetDlgNum(fv->HWin, IDC_PROTOPKTNUM, yv->PktNumOffset+yv->PktNum);
 	SetDlgNum(fv->HWin, IDC_PROTOBYTECOUNT, fv->ByteCount);
+	SetDlgTime(fv->HWin, IDC_PROTOELAPSEDTIME, fv->StartTime, fv->ByteCount);
 
 	FTSetTimeOut(fv,yv->TOutLong);
 
@@ -824,6 +826,7 @@
 		SetDlgNum(fv->HWin, IDC_PROTOBYTECOUNT, fv->ByteCount);
 		SetDlgPercent(fv->HWin, IDC_PROTOPERCENT, IDC_PROTOPROGRESS,
 			fv->ByteCount, fv->FileSize, &fv->ProgStat);
+		SetDlgTime(fv->HWin, IDC_PROTOELAPSEDTIME, fv->StartTime, fv->ByteCount);
 	}
 
 	return TRUE;

Modified: trunk/teraterm/ttpfile/zmodem.c
===================================================================
--- trunk/teraterm/ttpfile/zmodem.c	2011-04-19 07:13:07 UTC (rev 4453)
+++ trunk/teraterm/ttpfile/zmodem.c	2011-04-19 13:23:37 UTC (rev 4454)
@@ -532,9 +532,11 @@
 
 	fv->ByteCount = 0;
 	fv->ProgStat = 0;
+	fv->StartTime = GetTickCount();
 	SetDlgNum(fv->HWin, IDC_PROTOBYTECOUNT, fv->ByteCount);
 	SetDlgPercent(fv->HWin, IDC_PROTOPERCENT, IDC_PROTOPROGRESS,
 				  fv->ByteCount, fv->FileSize, &fv->ProgStat);
+	SetDlgTime(fv->HWin, IDC_PROTOELAPSEDTIME, fv->StartTime, fv->ByteCount);
 
 	add_sendbuf("%s: ZFILE: ZF0=%x ZF1=%x ZF2=%x file=%s size=%lu",
 		__FUNCTION__,
@@ -579,6 +581,7 @@
 	SetDlgNum(fv->HWin, IDC_PROTOBYTECOUNT, fv->ByteCount);
 	SetDlgPercent(fv->HWin, IDC_PROTOPERCENT, IDC_PROTOPROGRESS,
 				  fv->ByteCount, fv->FileSize, &fv->ProgStat);
+	SetDlgTime(fv->HWin, IDC_PROTOELAPSEDTIME, fv->StartTime, fv->ByteCount);
 	zv->Pos = fv->ByteCount;
 
 	zv->PktOut[zv->PktOutCount] = ZDLE;
@@ -643,6 +646,7 @@
 	SetDlgItemText(fv->HWin, IDC_PROTOPROT, "ZMODEM");
 
 	InitDlgProgress(fv->HWin, IDC_PROTOPROGRESS, &fv->ProgStat);
+	fv->StartTime = GetTickCount();
 
 	fv->FileSize = 0;
 
@@ -984,6 +988,8 @@
 	if (fv->FileSize > 0)
 		SetDlgPercent(fv->HWin, IDC_PROTOPERCENT, IDC_PROTOPROGRESS,
 					  0, fv->FileSize, &fv->ProgStat);
+	SetDlgTime(fv->HWin, IDC_PROTOELAPSEDTIME, GetTickCount(), fv->ByteCount);
+
 	/* set timeout for data */
 	FTSetTimeOut(fv, zv->TimeOut);
 	return TRUE;
@@ -1019,6 +1025,7 @@
 	if (fv->FileSize > 0)
 		SetDlgPercent(fv->HWin, IDC_PROTOPERCENT, IDC_PROTOPROGRESS,
 					  fv->ByteCount, fv->FileSize, &fv->ProgStat);
+	SetDlgTime(fv->HWin, IDC_PROTOELAPSEDTIME, fv->StartTime, fv->ByteCount);
 
 	/* set timeout for data */
 	FTSetTimeOut(fv, zv->TimeOut);



Ttssh2-commit メーリングリストの案内