[Ttssh2-commit] [6228] XMODEM 送受信のダイアログで指定できるオプションを整理した

svnno****@sourc***** svnno****@sourc*****
2016年 1月 1日 (金) 18:19:41 JST


Revision: 6228
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/6228
Author:   maya
Date:     2016-01-01 18:19:41 +0900 (Fri, 01 Jan 2016)
Log Message:
-----------
XMODEM 送受信のダイアログで指定できるオプションを整理した

Modified Paths:
--------------
    trunk/teraterm/ttpfile/ttfile.c
    trunk/teraterm/ttpfile/ttpfile.rc

-------------- next part --------------
Modified: trunk/teraterm/ttpfile/ttfile.c
===================================================================
--- trunk/teraterm/ttpfile/ttfile.c	2015-12-31 12:25:23 UTC (rev 6227)
+++ trunk/teraterm/ttpfile/ttfile.c	2016-01-01 09:19:41 UTC (rev 6228)
@@ -889,9 +889,27 @@
 			get_lang_msg("DLG_XOPT_BINARY", uimsg, sizeof(uimsg), uimsg2, UILanguageFile);
 			SetDlgItemText(Dialog, IDC_XOPTBIN, uimsg);
 
-			SetRB(Dialog,HIWORD(*pl),IDC_XOPTCHECK,IDC_XOPT1K);
-			if (LOWORD(*pl)!=0xFFFF)
+			if (LOWORD(*pl)==0xFFFF) // Send
 			{
+				ShowDlgItem(Dialog, IDC_XOPT1K, IDC_XOPT1K);
+				Hi = 0;
+				if (HIWORD(*pl) == Xopt1kCRC || HIWORD(*pl) == Xopt1kCksum) {
+					Hi = 1;
+				}
+				SetRB(Dialog, Hi, IDC_XOPT1K, IDC_XOPT1K);
+			}
+			else // Recv
+			{
+				ShowDlgItem(Dialog, IDC_XOPTCHECK, IDC_XOPTCRC);
+				Hi = HIWORD(*pl);
+				if (Hi == Xopt1kCRC) {
+					Hi = XoptCRC;
+				}
+				else if (Hi == Xopt1kCksum) {
+					Hi = XoptCheck;
+				}
+				SetRB(Dialog, Hi, IDC_XOPTCHECK, IDC_XOPTCRC);
+
 				ShowDlgItem(Dialog,IDC_XOPTBIN,IDC_XOPTBIN);
 				SetRB(Dialog,LOWORD(*pl),IDC_XOPTBIN,IDC_XOPTBIN);
 			}
@@ -902,11 +920,23 @@
 					pl = (LPLONG)GetWindowLong(Dialog,DWL_USER);
 					if (pl!=NULL)
 					{
-						GetRB(Dialog,&Hi,IDC_XOPTCHECK,IDC_XOPT1K);
-						if (LOWORD(*pl)==0xFFFF)
+						if (LOWORD(*pl)==0xFFFF) // Send
+						{
 							Lo = 0xFFFF;
-						else
-							GetRB(Dialog,&Lo,IDC_XOPTBIN,IDC_XOPTBIN);
+
+							GetRB(Dialog, &Hi, IDC_XOPT1K, IDC_XOPT1K);
+							if (Hi > 0) { // force CRC if 1K
+								Hi = Xopt1kCRC;
+							}
+							else {
+								Hi = XoptCRC;
+							}
+						}
+						else // Recv
+						{
+							GetRB(Dialog, &Lo, IDC_XOPTBIN, IDC_XOPTBIN);
+							GetRB(Dialog, &Hi, IDC_XOPTCHECK, IDC_XOPTCRC);
+						}
 						*pl = MAKELONG(Lo,Hi);
 					}
 					break;
@@ -921,12 +951,24 @@
 					pl = (LPLONG)GetWindowLong(Dialog,DWL_USER);
 					if (pl!=NULL)
 					{
-						GetRB(Dialog,&Hi,IDC_XOPTCHECK,IDC_XOPT1K);
-						if (LOWORD(*pl)==0xFFFF)
+						if (LOWORD(*pl) == 0xFFFF) // Send
+						{
 							Lo = 0xFFFF;
-						else
-							GetRB(Dialog,&Lo,IDC_XOPTBIN,IDC_XOPTBIN);
-						*pl = MAKELONG(Lo,Hi);
+
+							GetRB(Dialog, &Hi, IDC_XOPT1K, IDC_XOPT1K);
+							if (Hi > 0) { // force CRC if 1K
+								Hi = Xopt1kCRC;
+							}
+							else {
+								Hi = XoptCRC;
+							}
+						}
+						else // Recv
+						{
+							GetRB(Dialog, &Lo, IDC_XOPTBIN, IDC_XOPTBIN);
+							GetRB(Dialog, &Hi, IDC_XOPTCHECK, IDC_XOPTCRC);
+						}
+						*pl = MAKELONG(Lo, Hi);
 					}
 					if (DlgXoptFont != NULL) {
 						DeleteObject(DlgXoptFont);

Modified: trunk/teraterm/ttpfile/ttpfile.rc
===================================================================
--- trunk/teraterm/ttpfile/ttpfile.rc	2015-12-31 12:25:23 UTC (rev 6227)
+++ trunk/teraterm/ttpfile/ttpfile.rc	2016-01-01 09:19:41 UTC (rev 6228)
@@ -73,9 +73,9 @@
 FONT 8, "Tahoma", 0, 0, 0x0
 BEGIN
     GROUPBOX        "Option",IDC_XOPT,5,2,290,25
-    CONTROL         "Check&sum",IDC_XOPTCHECK,"Button",BS_AUTORADIOBUTTON | WS_GROUP,10,10,70,16
-    CONTROL         "&CRC",IDC_XOPTCRC,"Button",BS_AUTORADIOBUTTON,80,10,50,16
-    CONTROL         "1&K",IDC_XOPT1K,"Button",BS_AUTORADIOBUTTON,130,10,50,16
+    CONTROL         "Check&sum",IDC_XOPTCHECK,"Button",BS_AUTORADIOBUTTON | NOT WS_VISIBLE | WS_GROUP,10,10,70,16
+    CONTROL         "&CRC",IDC_XOPTCRC,"Button",BS_AUTORADIOBUTTON | NOT WS_VISIBLE,80,10,50,16
+    CONTROL         "1&K",IDC_XOPT1K,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE,130,10,50,16
     CONTROL         "Bina&ry",IDC_XOPTBIN,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,180,10,60,16
 END
 



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