svnno****@sourc*****
svnno****@sourc*****
2013年 9月 30日 (月) 00:30:39 JST
Revision: 5392 http://sourceforge.jp/projects/ttssh2/scm/svn/commits/5392 Author: yutakapon Date: 2013-09-30 00:30:39 +0900 (Mon, 30 Sep 2013) Log Message: ----------- チケット #32144 ログ採取開始時の現在バッファをあらかじめ含める ログ採取オプションに"ALl Buff In First"を追加した。 Ticket Links: ------------ http://sourceforge.jp/projects/ttssh2/tracker/detail/32144 Modified Paths: -------------- trunk/teraterm/common/tttypes.h trunk/teraterm/teraterm/buffer.c trunk/teraterm/teraterm/buffer.h trunk/teraterm/teraterm/filesys.cpp trunk/teraterm/ttpfile/file_res.h trunk/teraterm/ttpfile/ttfile.c trunk/teraterm/ttpfile/ttpfile.rc trunk/teraterm/ttpset/ttset.c -------------- next part -------------- Modified: trunk/teraterm/common/tttypes.h =================================================================== --- trunk/teraterm/common/tttypes.h 2013-09-17 13:53:54 UTC (rev 5391) +++ trunk/teraterm/common/tttypes.h 2013-09-29 15:30:39 UTC (rev 5392) @@ -569,6 +569,7 @@ DWORD BeepOverUsedCount; DWORD BeepOverUsedTime; DWORD BeepSuppressTime; + WORD LogAllBuffIncludedInFirst; }; typedef struct tttset TTTSet, *PTTSet; @@ -1032,6 +1033,9 @@ * Increment the number of this macro value * when you change TMap or member of TMap. * + * - At version 4.80, ttset_memfilemap was replaced with ttset_memfilemap_22. + * added tttset.LogAllBuffIncludedInFirst + * * - At version 4.79, ttset_memfilemap was replaced with ttset_memfilemap_21. * added TMap.WinUndoFlag * added tttset.FTHideDialog @@ -1162,4 +1166,4 @@ * added tttset.VTCompatTab. */ -#define TT_FILEMAPNAME "ttset_memfilemap_21" +#define TT_FILEMAPNAME "ttset_memfilemap_22" Modified: trunk/teraterm/teraterm/buffer.c =================================================================== --- trunk/teraterm/teraterm/buffer.c 2013-09-17 13:53:54 UTC (rev 5391) +++ trunk/teraterm/teraterm/buffer.c 2013-09-29 15:30:39 UTC (rev 5392) @@ -3857,6 +3857,24 @@ return (CursorX); } +// \x91S\x83o\x83b\x83t\x83@\x82\xA9\x82\xE7\x8Ew\x92肵\x82\xBD\x8Ds\x82\xF0\x95Ԃ\xB7\x81B +int BuffGetAnyLineData(int offset_y, char *buf, int bufsize) +{ + LONG Ptr; + int copysize = 0; + + if (offset_y >= BuffEnd) + return -1; + + Ptr = GetLinePtr(offset_y); + memset(buf, 0, bufsize); + copysize = min(NumOfColumns, bufsize - 1); + memcpy(buf, &CodeBuff[Ptr], copysize); + + return (copysize); +} + + BOOL BuffCheckMouseOnURL(int Xw, int Yw) { int X, Y; Modified: trunk/teraterm/teraterm/buffer.h =================================================================== --- trunk/teraterm/teraterm/buffer.h 2013-09-17 13:53:54 UTC (rev 5391) +++ trunk/teraterm/teraterm/buffer.h 2013-09-29 15:30:39 UTC (rev 5392) @@ -82,6 +82,7 @@ void BuffScrollLeft(int count); void BuffScrollRight(int count); int BuffGetCurrentLineData(char *buf, int bufsize); +int BuffGetAnyLineData(int offset_y, char *buf, int bufsize); BOOL BuffCheckMouseOnURL(int Xw, int Yw); extern int StatusLine; Modified: trunk/teraterm/teraterm/filesys.cpp =================================================================== --- trunk/teraterm/teraterm/filesys.cpp 2013-09-17 13:53:54 UTC (rev 5391) +++ trunk/teraterm/teraterm/filesys.cpp 2013-09-29 15:30:39 UTC (rev 5392) @@ -22,6 +22,8 @@ #include "filesys.h" #include "ftlib.h" +#include "buffer.h" + #include <io.h> #include <process.h> @@ -438,6 +440,8 @@ LONG Option; char *logdir; unsigned tid; + DWORD ofs, size, written_size; + char buf[512]; if ((FileLog) || (BinLog)) return FALSE; @@ -468,12 +472,15 @@ // 0x1000 = plain text (2005.2.20 yutaka) // 0x2000 = timestamp (2006.7.23 maya) // 0x4000 = hide file transfer dialog (2008.1.30 maya) + // 0x8000 = All buffer included in first (2013.9.29 yutaka) // teraterm.ini\x82̐ݒ\xE8\x82\xF0\x8C\xA9\x82Ă\xA9\x82\xE7\x83f\x83t\x83H\x83\x8B\x83g\x83I\x83v\x83V\x83\x87\x83\x93\x82\xF0\x8C\x88\x82߂\xE9\x81B(2005.5.7 yutaka) Option = MAKELONG(ts.LogBinary, ts.Append | (0x1000 * ts.LogTypePlainText) | (0x2000 * ts.LogTimestamp) | - (0x4000 * ts.LogHideDialog)); + (0x4000 * ts.LogHideDialog) | + (0x8000 * ts.LogAllBuffIncludedInFirst) + ); // \x83\x8D\x83O\x82̃f\x83t\x83H\x83\x8B\x83g\x83t\x83@\x83C\x83\x8B\x96\xBC\x82\xF0\x90ݒ\xE8 (2006.8.28 maya) strncat_s(LogVar->FullName, sizeof(LogVar->FullName), ts.LogDefaultName, _TRUNCATE); @@ -513,6 +520,13 @@ ts.LogHideDialog = 0; } + if (ts.Append & 0x8000) { + ts.LogAllBuffIncludedInFirst = 1; + } + else { + ts.LogAllBuffIncludedInFirst = 0; + } + ts.Append &= 0x1; // 1bit\x82Ƀ}\x83X\x83N\x82\xB7\x82\xE9 } @@ -622,6 +636,19 @@ LogVar->LogThread = (HANDLE)_beginthreadex(NULL, 0, DeferredLogWriteThread, LogVar, 0, &tid); LogVar->LogThreadId = tid; + // \x8C\xBB\x8D݃o\x83b\x83t\x83@\x82ɂ\xA0\x82\xE9\x83f\x81[\x83^\x82\xF0\x82\xB7\x82ׂď\x91\x82\xAB\x8Fo\x82\xB5\x82Ă\xA9\x82\xE7\x81A + // \x83\x8D\x83O\x8D̎\xE6\x82\xF0\x8AJ\x8En\x82\xB7\x82\xE9\x81B + // (2013.9.29 yutaka) + if (ts.LogAllBuffIncludedInFirst) { + for (ofs = 0 ; ; ofs++ ) { + size = BuffGetAnyLineData(ofs, buf, sizeof(buf)); + if (size == -1) + break; + WriteFile((HANDLE)LogVar->FileHandle, buf, size, &written_size, NULL); + WriteFile((HANDLE)LogVar->FileHandle, "\r\n", 2, &written_size, NULL); + } + } + return TRUE; } } Modified: trunk/teraterm/ttpfile/file_res.h =================================================================== --- trunk/teraterm/ttpfile/file_res.h 2013-09-17 13:53:54 UTC (rev 5391) +++ trunk/teraterm/ttpfile/file_res.h 2013-09-29 15:30:39 UTC (rev 5392) @@ -8,6 +8,7 @@ #define IDC_PLAINTEXT 1003 #define IDC_TIMESTAMP 1004 #define IDC_HIDEDIALOG 1005 +#define IDC_ALLBUFF_INFIRST 1006 #define IDD_XOPT 1100 #define IDC_XOPTCHECK 1101 #define IDC_XOPTCRC 1102 @@ -27,7 +28,7 @@ #define _APS_NO_MFC 1 #define _APS_NEXT_RESOURCE_VALUE 102 #define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1004 +#define _APS_NEXT_CONTROL_VALUE 1007 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif Modified: trunk/teraterm/ttpfile/ttfile.c =================================================================== --- trunk/teraterm/ttpfile/ttfile.c 2013-09-17 13:53:54 UTC (rev 5391) +++ trunk/teraterm/ttpfile/ttfile.c 2013-09-29 15:30:39 UTC (rev 5392) @@ -170,6 +170,7 @@ SendDlgItemMessage(Dialog, IDC_PLAINTEXT, WM_SETFONT, (WPARAM)DlgFoptFont, MAKELPARAM(TRUE,0)); SendDlgItemMessage(Dialog, IDC_TIMESTAMP, WM_SETFONT, (WPARAM)DlgFoptFont, MAKELPARAM(TRUE,0)); SendDlgItemMessage(Dialog, IDC_HIDEDIALOG, WM_SETFONT, (WPARAM)DlgFoptFont, MAKELPARAM(TRUE,0)); + SendDlgItemMessage(Dialog, IDC_ALLBUFF_INFIRST, WM_SETFONT, (WPARAM)DlgFoptFont, MAKELPARAM(TRUE,0)); } else { DlgFoptFont = NULL; @@ -193,6 +194,9 @@ GetDlgItemText(Dialog, IDC_HIDEDIALOG, uimsg2, sizeof(uimsg2)); get_lang_msg("DLG_FOPT_HIDEDIALOG", uimsg, sizeof(uimsg), uimsg2, UILanguageFile); SetDlgItemText(Dialog, IDC_HIDEDIALOG, uimsg); + GetDlgItemText(Dialog, IDC_ALLBUFF_INFIRST, uimsg2, sizeof(uimsg2)); + get_lang_msg("DLG_FOPT_ALLBUFFINFIRST", uimsg, sizeof(uimsg), uimsg2, UILanguageFile); + SetDlgItemText(Dialog, IDC_ALLBUFF_INFIRST, uimsg); Lo = LOWORD(*pl) & 1; Hi = HIWORD(*pl); @@ -227,6 +231,13 @@ if (Hi & 0x4000) { SetRB(Dialog,1,IDC_HIDEDIALOG,IDC_HIDEDIALOG); } + + // All Buff in first\x83`\x83F\x83b\x83N\x83{\x83b\x83N\x83X (2013.9.29 yutaka) + ShowDlgItem(Dialog,IDC_ALLBUFF_INFIRST,IDC_ALLBUFF_INFIRST); + if (Hi & 0x8000) { + SetRB(Dialog,1,IDC_ALLBUFF_INFIRST,IDC_ALLBUFF_INFIRST); + } + } return TRUE; @@ -290,6 +301,12 @@ Hi |= 0x4000; } + // All Buff in first\x83`\x83F\x83b\x83N\x83{\x83b\x83N\x83X (2013.9.29 yutaka) + GetRB(Dialog,&val,IDC_ALLBUFF_INFIRST,IDC_ALLBUFF_INFIRST); + if (val > 0) { + Hi |= 0x8000; + } + *pl = MAKELONG(Lo,Hi); } if (DlgFoptFont != NULL) { Modified: trunk/teraterm/ttpfile/ttpfile.rc =================================================================== --- trunk/teraterm/ttpfile/ttpfile.rc 2013-09-17 13:53:54 UTC (rev 5391) +++ trunk/teraterm/ttpfile/ttpfile.rc 2013-09-29 15:30:39 UTC (rev 5392) @@ -15,7 +15,7 @@ #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources +// \x89p\x8C\xEA (\x95č\x91) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #ifdef _WIN32 @@ -86,12 +86,13 @@ GROUPBOX "Option",IDC_FOPT,5,2,290,40 CONTROL "&Binary",IDC_FOPTBIN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,10,60,16 CONTROL "&Append",IDC_FOPTAPPEND,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,90,10,60,16 - CONTROL "&Plain text",IDC_PLAINTEXT,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,170,10,80,16 + CONTROL "&Plain text",IDC_PLAINTEXT,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,179,10,80,16 CONTROL "&Timestamp",IDC_TIMESTAMP,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,10,24,80,16 - CONTROL "Hide &dialog",IDC_HIDEDIALOG,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,90,24,113,16 + CONTROL "Hide &dialog",IDC_HIDEDIALOG,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,90,24,88,16 + CONTROL "All Buff in &first",IDC_ALLBUFF_INFIRST,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,179,27,83,10 END -#endif // English (U.S.) resources +#endif // \x89p\x8C\xEA (\x95č\x91) resources ///////////////////////////////////////////////////////////////////////////// Modified: trunk/teraterm/ttpset/ttset.c =================================================================== --- trunk/teraterm/ttpset/ttset.c 2013-09-17 13:53:54 UTC (rev 5391) +++ trunk/teraterm/ttpset/ttset.c 2013-09-29 15:30:39 UTC (rev 5392) @@ -762,6 +762,8 @@ /* Log without transfer dialog */ ts->LogHideDialog = GetOnOff(Section, "LogHideDialog", FName, FALSE); + ts->LogAllBuffIncludedInFirst = GetOnOff(Section, "LogAllBuffInFirst", FName, FALSE); + /* File Transfer dialog visibility */ ts->FTHideDialog = GetOnOff(Section, "FTHideDialog", FName, FALSE); @@ -2116,6 +2118,8 @@ /* Log without transfer dialog */ WriteOnOff(Section, "LogHideDialog", FName, ts->LogHideDialog); + WriteOnOff(Section, "LogAllBuffInFirst", FName, ts->LogAllBuffIncludedInFirst); + /* Default Log file name (2006.8.28 maya) */ WritePrivateProfileString(Section, "LogDefaultName", ts->LogDefaultName, FName);