[Ttssh2-commit] [3699] disconnect マクロコマンドに、TCP / IP 接続切断時の確認ダイアログを制御するオプションを追加した。

アーカイブの一覧に戻る

svnno****@sourc***** svnno****@sourc*****
2009年 11月 23日 (月) 15:15:47 JST


Revision: 3699
          http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=3699
Author:   maya
Date:     2009-11-23 15:15:47 +0900 (Mon, 23 Nov 2009)

Log Message:
-----------
disconnect マクロコマンドに、TCP/IP 接続切断時の確認ダイアログを制御するオプションを追加した。

Modified Paths:
--------------
    trunk/doc/en/html/about/history.html
    trunk/doc/en/html/macro/command/disconnect.html
    trunk/doc/ja/html/about/history.html
    trunk/doc/ja/html/macro/command/disconnect.html
    trunk/teraterm/teraterm/ttdde.c
    trunk/teraterm/teraterm/vtwin.cpp
    trunk/teraterm/teraterm/vtwin.h
    trunk/teraterm/ttpmacro/ttl.c


-------------- next part --------------
Modified: trunk/doc/en/html/about/history.html
===================================================================
--- trunk/doc/en/html/about/history.html	2009-11-23 05:11:28 UTC (rev 3698)
+++ trunk/doc/en/html/about/history.html	2009-11-23 06:15:47 UTC (rev 3699)
@@ -35,6 +35,7 @@
   <li>Changes
     <ul>
       <!--li>ƒRƒ}ƒ“ƒhƒ‰ƒCƒ“‚Ń^ƒu‚àƒpƒ‰ƒ[ƒ^‚Ì‹æØ‚è‚Æ‚µ‚Ä”FŽ¯‚·‚é‚悤‚É‚µ‚½B</li-->
+      <!--li>ƒ}ƒNƒƒRƒ}ƒ“ƒh "<a href="../macro/command/disconnect.html">disconnect</a>" ‚ɁATCP/IP Ú‘±Ø’fŽž‚ÌŠm”Fƒ_ƒCƒAƒƒO‚𐧌䂷‚éƒIƒvƒVƒ‡ƒ“‚ð’ljÁ‚µ‚½B</li-->
     </ul>
   </li>
 

Modified: trunk/doc/en/html/macro/command/disconnect.html
===================================================================
--- trunk/doc/en/html/macro/command/disconnect.html	2009-11-23 05:11:28 UTC (rev 3698)
+++ trunk/doc/en/html/macro/command/disconnect.html	2009-11-23 06:15:47 UTC (rev 3699)
@@ -18,7 +18,7 @@
 </p>
 
 <pre class="macro-syntax">
-disconnect
+disconnect [&lt;intval&gt;]
 </pre>
 
 <h2>Remarks</h2>
@@ -28,6 +28,11 @@
 If Tera Term is not terminated by this command, the link between Tera Term and MACRO is kept.
 </p>
 
+<!--p>
+&lt;intval&gt; ‚É 0 ‚ªŽw’肳‚ê‚Ä‚¢‚éê‡‚ɂ́ATCP/IP Ú‘±Ø’fŽž‚ÌŠm”Fƒ_ƒCƒAƒƒO‚ð•\Ž¦‚¹‚¸‚ɒʐM‚ðI—¹‚·‚éB<br>
+&lt;intval&gt; ‚ªŽw’肳‚ê‚Ä‚¢‚È‚¢‚© 0 ˆÈŠO‚̏ꍇ‚ɂ́ATCP/IP Ú‘±Ø’fŽž‚ÌŠm”Fƒ_ƒCƒAƒƒO‚ð•\Ž¦‚·‚éB
+</p-->
+
 <h2>See also</h2>
 
 <ul>

Modified: trunk/doc/ja/html/about/history.html
===================================================================
--- trunk/doc/ja/html/about/history.html	2009-11-23 05:11:28 UTC (rev 3698)
+++ trunk/doc/ja/html/about/history.html	2009-11-23 06:15:47 UTC (rev 3699)
@@ -35,6 +35,7 @@
   <li>•ÏX
     <ul>
       <li>ƒRƒ}ƒ“ƒhƒ‰ƒCƒ“‚Ń^ƒu‚àƒpƒ‰ƒ[ƒ^‚Ì‹æØ‚è‚Æ‚µ‚Ä”FŽ¯‚·‚é‚悤‚É‚µ‚½B</li>
+      <li>ƒ}ƒNƒƒRƒ}ƒ“ƒh "<a href="../macro/command/disconnect.html">disconnect</a>" ‚ɁATCP/IP Ú‘±Ø’fŽž‚ÌŠm”Fƒ_ƒCƒAƒƒO‚𐧌䂷‚éƒIƒvƒVƒ‡ƒ“‚ð’ljÁ‚µ‚½B</li>
     </ul>
   </li>
 

Modified: trunk/doc/ja/html/macro/command/disconnect.html
===================================================================
--- trunk/doc/ja/html/macro/command/disconnect.html	2009-11-23 05:11:28 UTC (rev 3698)
+++ trunk/doc/ja/html/macro/command/disconnect.html	2009-11-23 06:15:47 UTC (rev 3699)
@@ -18,7 +18,7 @@
 </p>
 
 <pre class="macro-syntax">
-disconnect
+disconnect [&lt;intval&gt;]
 </pre>
 
 <h2>‰ðà</h2>
@@ -28,6 +28,11 @@
 ‚à‚µ‚±‚̃Rƒ}ƒ“ƒh‚É‚æ‚Á‚Ä Tera Term ‚ªI—¹‚µ‚È‚¯‚ê‚΁ATera Term ‚Æ MACRO ‚̊Ԃ̃Šƒ“ƒN‚Í•ÛŽ‚³‚ê‚éB
 </p>
 
+<p>
+&lt;intval&gt; ‚É 0 ‚ªŽw’肳‚ê‚Ä‚¢‚éê‡‚ɂ́ATCP/IP Ú‘±Ø’fŽž‚ÌŠm”Fƒ_ƒCƒAƒƒO‚ð•\Ž¦‚¹‚¸‚ɒʐM‚ðI—¹‚·‚éB<br>
+&lt;intval&gt; ‚ªŽw’肳‚ê‚Ä‚¢‚È‚¢‚© 0 ˆÈŠO‚̏ꍇ‚ɂ́ATCP/IP Ú‘±Ø’fŽž‚ÌŠm”Fƒ_ƒCƒAƒƒO‚ð•\Ž¦‚·‚éB
+</p>
+
 <h2>ŽQÆ</h2>
 
 <ul>

Modified: trunk/teraterm/teraterm/ttdde.c
===================================================================
--- trunk/teraterm/teraterm/ttdde.c	2009-11-23 05:11:28 UTC (rev 3698)
+++ trunk/teraterm/teraterm/ttdde.c	2009-11-23 06:15:47 UTC (rev 3699)
@@ -431,7 +431,12 @@
 		PostMessage(HVTWin,WM_USER_COMMSTART,0,0);
 		break;
 	case CmdDisconnect:
-		PostMessage(HVTWin,WM_USER_ACCELCOMMAND,IdCmdDisconnect,0);
+		if (ParamFileName[0] == '0') {
+			PostMessage(HVTWin,WM_USER_ACCELCOMMAND,IdCmdDisconnect,0);
+		}
+		else {
+			PostMessage(HVTWin,WM_USER_ACCELCOMMAND,IdCmdDisconnect,1);
+		}
 		break;
 	case CmdEnableKeyb:
 		KeybEnabled = (ParamBinaryFlag!=0);

Modified: trunk/teraterm/teraterm/vtwin.cpp
===================================================================
--- trunk/teraterm/teraterm/vtwin.cpp	2009-11-23 05:11:28 UTC (rev 3698)
+++ trunk/teraterm/teraterm/vtwin.cpp	2009-11-23 06:15:47 UTC (rev 3699)
@@ -1592,7 +1592,7 @@
 				OnEditPaste();
 				return TRUE;
 			case ID_ACC_DISCONNECT:
-				OnFileDisconnect();
+				Disconnect(TRUE);
 				return TRUE;
 			case ID_FILE_DUPLICATESESSION:
 				// added DisableAcceleratorDuplicateSession (2009.4.6 maya)
@@ -2975,7 +2975,7 @@
 			}
 			break;
 		case IdCmdDisconnect: // called by TTMACRO
-			OnFileDisconnect();
+			Disconnect(lParam);
 			break;
 		case IdCmdLoadKeyMap: // called by TTMACRO
 			SetKeyMap();
@@ -3868,24 +3868,31 @@
 	BuffPrint(FALSE);
 }
 
-void CVTWindow::OnFileDisconnect()
+void CVTWindow::Disconnect(BOOL confirm)
 {
 	if (! cv.Ready) {
 		return;
 	}
 
-	get_lang_msg("MSG_DISCONNECT_CONF", ts.UIMsg, sizeof(ts.UIMsg),
-	             "Disconnect?", ts.UILanguageFile);
 	if ((cv.PortType==IdTCPIP) &&
 	    ((ts.PortFlag & PF_CONFIRMDISCONN) != 0) &&
-	    (::MessageBox(HVTWin, ts.UIMsg, "Tera Term",
-	                  MB_OKCANCEL | MB_ICONEXCLAMATION | MB_DEFBUTTON2)==IDCANCEL)) {
-		return;
+	    (confirm)) {
+		get_lang_msg("MSG_DISCONNECT_CONF", ts.UIMsg, sizeof(ts.UIMsg),
+		             "Disconnect?", ts.UILanguageFile);
+		if (::MessageBox(HVTWin, ts.UIMsg, "Tera Term",
+		                 MB_OKCANCEL | MB_ICONEXCLAMATION | MB_DEFBUTTON2)==IDCANCEL) {
+			return;
+		}
 	}
 
 	::PostMessage(HVTWin, WM_USER_COMMNOTIFY, 0, FD_CLOSE);
 }
 
+void CVTWindow::OnFileDisconnect()
+{
+	Disconnect(TRUE);
+}
+
 void CVTWindow::OnFileExit()
 {
 	OnClose();

Modified: trunk/teraterm/teraterm/vtwin.h
===================================================================
--- trunk/teraterm/teraterm/vtwin.h	2009-11-23 05:11:28 UTC (rev 3698)
+++ trunk/teraterm/teraterm/vtwin.h	2009-11-23 06:15:47 UTC (rev 3699)
@@ -174,7 +174,8 @@
 	afx_msg void OnHelpUsing();
 	afx_msg void OnHelpAbout();
 	//}}AFX_MSG
-    DECLARE_MESSAGE_MAP();
+	DECLARE_MESSAGE_MAP();
+	void Disconnect(BOOL confirm);
 };
 #endif
 

Modified: trunk/teraterm/ttpmacro/ttl.c
===================================================================
--- trunk/teraterm/ttpmacro/ttl.c	2009-11-23 05:11:28 UTC (rev 3698)
+++ trunk/teraterm/ttpmacro/ttl.c	2009-11-23 06:15:47 UTC (rev 3699)
@@ -684,6 +684,32 @@
 	return Err;
 }
 
+WORD TTLDisconnect()
+{
+	WORD Err;
+	int Val = 1;
+	char Str[21];
+
+	Err = 0;
+	// get 1rd arg(optional) if given
+	if (CheckParameterGiven()) {
+		GetIntVal(&Val, &Err);
+	}
+
+	if ((Err==0) &&
+	    (GetFirstChar()!=0))
+		Err = ErrSyntax;
+	if ((Err==0) && (! Linked))
+		Err = ErrLinkFirst;
+	if (Err==0)
+	{
+		_snprintf_s(Str,sizeof(Str),_TRUNCATE,"%d",Val);
+		SetFile(Str);
+		Err = SendCmnd(CmdDisconnect,0);
+	}
+	return Err;
+}
+
 WORD TTLDo()
 {
 	WORD WId, Err;
@@ -3806,7 +3832,7 @@
 		case RsvDelPassword:
 			Err = TTLDelPassword(); break;
 		case RsvDisconnect:
-			Err = TTLCommCmd(CmdDisconnect,0); break;
+			Err = TTLDisconnect(); break;
 		case RsvDo:
 			Err = TTLDo(); break;
 		case RsvElse:



Ttssh2-commit メーリングリストの案内
アーカイブの一覧に戻る