[Ttssh2-commit] [7173] marge trunk 7172

scmno****@osdn***** scmno****@osdn*****
2018年 8月 5日 (日) 19:54:39 JST


Revision: 7173
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/7173
Author:   zmatsuo
Date:     2018-08-05 19:54:39 +0900 (Sun, 05 Aug 2018)
Log Message:
-----------
marge trunk 7172

Modified Paths:
--------------
    branches/cmake/teraterm/common/dlglib.c
    branches/cmake/teraterm/common/dlglib.h
    branches/cmake/teraterm/common/ttftypes.h
    branches/cmake/teraterm/common/tttypes.h
    branches/cmake/teraterm/teraterm/dnddlg.cpp
    branches/cmake/teraterm/teraterm/dnddlg.h
    branches/cmake/teraterm/teraterm/vtwin.cpp

Property Changed:
----------------
    branches/cmake/
    branches/cmake/teraterm/

-------------- next part --------------
Index: branches/cmake
===================================================================
--- branches/cmake	2018-08-05 10:49:00 UTC (rev 7172)
+++ branches/cmake	2018-08-05 10:54:39 UTC (rev 7173)

Property changes on: branches/cmake
___________________________________________________________________
Modified: svn:mergeinfo
## -2,4 +2,4 ##
 /branches/ssh_ed25519:5495-5544
 /branches/vs2015_warn:6194-6285
 /tags/teraterm-4_89:6182
-/trunk:7164
\ No newline at end of property
+/trunk:7164,7172
\ No newline at end of property
Index: branches/cmake/teraterm
===================================================================
--- branches/cmake/teraterm	2018-08-05 10:49:00 UTC (rev 7172)
+++ branches/cmake/teraterm	2018-08-05 10:54:39 UTC (rev 7173)

Property changes on: branches/cmake/teraterm
___________________________________________________________________
Modified: svn:mergeinfo
## -1,3 +1,3 ##
 /branches/drag_and_drop/teraterm:7130,7139,7141,7143-7147
 /branches/vs2015_warn/teraterm:6194-6285
-/trunk/teraterm:7164
\ No newline at end of property
+/trunk/teraterm:7164,7172
\ No newline at end of property
Modified: branches/cmake/teraterm/common/dlglib.c
===================================================================
--- branches/cmake/teraterm/common/dlglib.c	2018-08-05 10:49:00 UTC (rev 7172)
+++ branches/cmake/teraterm/common/dlglib.c	2018-08-05 10:54:39 UTC (rev 7173)
@@ -30,6 +30,7 @@
 /* Routines for dialog boxes */
 #include <windows.h>
 #include "dlglib.h"
+#include "i18n.h"		// for MAX_UIMSG
 #include <stdio.h>
 #include <commctrl.h>
 
@@ -324,11 +325,13 @@
 	SetWindowLongPtr(dlg, GWLP_WNDPROC, (LONG_PTR)data->OrigProc);
 	SetWindowLongPtr(dlg, GWLP_USERDATA, (LONG_PTR)data->OrigUser);
 	Result = CallWindowProc(data->OrigProc, dlg, msg, wParam, lParam);
+	data->OrigProc = (WNDPROC)GetWindowLongPtr(dlg, GWLP_WNDPROC);
+	data->OrigUser = GetWindowLongPtr(dlg, GWLP_USERDATA);
 	SetWindowLongPtr(dlg, GWLP_WNDPROC, (LONG_PTR)HostnameEditProc);
 	SetWindowLongPtr(dlg, GWLP_USERDATA, (LONG_PTR)data);
 
 	switch (msg) {
-		case WM_DESTROY:
+		case WM_NCDESTROY:
 			SetWindowLongPtr(dlg, GWLP_WNDPROC, (LONG_PTR)data->OrigProc);
 			SetWindowLongPtr(dlg, GWLP_USERDATA, (LONG_PTR)data->OrigUser);
 			free(data);
@@ -353,3 +356,20 @@
 	SetWindowLongPtr(hWndEdit, GWL_WNDPROC, (LONG_PTR)HostnameEditProc);
 	SetWindowLongPtr(hWndEdit, GWLP_USERDATA, (LONG_PTR)data);
 }
+
+void SetDlgTexts(HWND hDlgWnd, const DlgTextInfo *infos, int infoCount, const char *UILanguageFile)
+{
+	for (int i = 0 ; i < infoCount; i++) {
+		char *key = infos[i].key;
+		char uimsg[MAX_UIMSG];
+		get_lang_msg(key, uimsg, sizeof(uimsg), "", UILanguageFile);
+		if (uimsg[0] != '\0') {
+			const int nIDDlgItem = infos[i].nIDDlgItem;
+			if (nIDDlgItem == 0) {
+				SetWindowText(hDlgWnd, uimsg);
+			} else {
+				SetDlgItemText(hDlgWnd, nIDDlgItem, uimsg);
+			}
+		}
+	}
+}

Modified: branches/cmake/teraterm/common/dlglib.h
===================================================================
--- branches/cmake/teraterm/common/dlglib.h	2018-08-05 10:49:00 UTC (rev 7172)
+++ branches/cmake/teraterm/common/dlglib.h	2018-08-05 10:54:39 UTC (rev 7173)
@@ -44,6 +44,11 @@
 LONG GetCurSel(HWND HDlg, int Id_Item);
 void InitDlgProgress(HWND HDlg, int id_Progress, int *CurProgStat);
 void SetEditboxSubclass(HWND hDlg, int nID, BOOL ComboBox);
+typedef struct {
+	int nIDDlgItem;
+	char *key;
+} DlgTextInfo;
+void SetDlgTexts(HWND hDlgWnd, const DlgTextInfo *infos, int infoCount, const char *UILanguageFile);
 
 #ifdef __cplusplus
 }

Modified: branches/cmake/teraterm/common/ttftypes.h
===================================================================
--- branches/cmake/teraterm/common/ttftypes.h	2018-08-05 10:49:00 UTC (rev 7172)
+++ branches/cmake/teraterm/common/ttftypes.h	2018-08-05 10:54:39 UTC (rev 7173)
@@ -28,6 +28,7 @@
  */
 
 /* Constants, types for file transfer */
+#pragma once
 
 /* GetSetupFname function id */
 #define GSF_SAVE	0 // Save setup

Modified: branches/cmake/teraterm/common/tttypes.h
===================================================================
--- branches/cmake/teraterm/common/tttypes.h	2018-08-05 10:49:00 UTC (rev 7172)
+++ branches/cmake/teraterm/common/tttypes.h	2018-08-05 10:54:39 UTC (rev 7173)
@@ -28,6 +28,8 @@
  */
 
 /* Constants and types for Tera Term */
+#pragma once
+
 #include <locale.h>
 #include "teraterm.h"
 #include "tt-version.h"

Modified: branches/cmake/teraterm/teraterm/dnddlg.cpp
===================================================================
--- branches/cmake/teraterm/teraterm/dnddlg.cpp	2018-08-05 10:49:00 UTC (rev 7172)
+++ branches/cmake/teraterm/teraterm/dnddlg.cpp	2018-08-05 10:54:39 UTC (rev 7173)
@@ -37,14 +37,7 @@
 #include "i18n.h"
 #include "ttlib.h"
 #include "dlglib.h"
-#include "tttypes.h"	// for ttwinman.h
-#include "ttwinman.h"	// for ts
 
-struct DlgTextInfo {
-	int nIDDlgItem;
-	char *key;
-};
-
 struct DrapDropDlgParam {
 	const char *TargetFilename;
 	enum drop_type DropType;
@@ -83,23 +76,6 @@
 	return hNewFont;
 }
 
-static void SetDlgTexts(HWND hDlgWnd, const DlgTextInfo *infos, int infoCount, const char *UILanguageFile)
-{
-	for (int i = 0 ; i < infoCount; i++) {
-		char *key = infos[i].key;
-		char uimsg[MAX_UIMSG];
-		get_lang_msg(key, uimsg, sizeof(uimsg), "", UILanguageFile);
-		if (uimsg[0] != '\0') {
-			const int nIDDlgItem = infos[i].nIDDlgItem;
-			if (nIDDlgItem == 0) {
-				SetWindowText(hDlgWnd, uimsg);
-			} else {
-				SetDlgItemText(hDlgWnd, nIDDlgItem, uimsg);
-			}
-		}
-	}
-}
-
 static LRESULT CALLBACK OnDragDropDlgProc(HWND hDlgWnd, UINT msg, WPARAM wp, LPARAM lp)
 {
 	static const int FontIDs[] = {
@@ -132,13 +108,13 @@
 		{ IDOK, "BTN_OK" },
 		{ IDCANCEL, "BTN_CANCEL" },
 	};
-	DrapDropDlgData *DlgData = (DrapDropDlgData *)GetWindowLongPtr(hDlgWnd, GWLP_USERDATA);
+	DrapDropDlgData *DlgData = (DrapDropDlgData *)GetWindowLongPtr(hDlgWnd, DWLP_USER);
 
 	switch (msg) {
 	case WM_INITDIALOG:
 	{
 		DlgData = (DrapDropDlgData *)malloc(sizeof(DrapDropDlgData));
-		SetWindowLongPtr(hDlgWnd, GWLP_USERDATA, (LONG_PTR)DlgData);
+		SetWindowLongPtr(hDlgWnd, DWLP_USER, (LONG_PTR)DlgData);
 		DrapDropDlgParam *Param = (DrapDropDlgParam *)lp;
 		DlgData->Param = Param;
 		DlgData->hPrevFont = SetDlgFonts(hDlgWnd, FontIDs, _countof(FontIDs), Param->UILanguageFile, NULL);
@@ -305,7 +281,7 @@
 	int RemaingFileCount,
 	bool EnableSCP,
 	bool EnableSendFile,
-	bool EnableDoNotShowDialog,
+	TTTSet *pts,
 	unsigned char *DropTypePaste,
 	bool *DoSameProcess,
 	bool *DoSameProcessNextDrop,
@@ -316,14 +292,15 @@
 	Param.DropType = DefaultDropType;
 	Param.DropTypePaste = *DropTypePaste;
 	Param.ScpEnable = EnableSCP;
-	Param.ScpSendDirPtr = ts.ScpSendDir;
-	Param.ScpSendDirSize = sizeof(ts.ScpSendDir);
 	Param.SendfileEnable = EnableSendFile;
 	Param.PasteNewlineEnable = true;
 	Param.RemaingFileCount = RemaingFileCount;
 	Param.DoNotShowDialog = *DoNotShowDialog;
-	Param.DoNotShowDialogEnable = EnableDoNotShowDialog;
-	Param.UILanguageFile = ts.UILanguageFile;
+	Param.DoNotShowDialogEnable = pts->ConfirmFileDragAndDrop ? false : true,
+	Param.ScpSendDirPtr = pts->ScpSendDir;
+	Param.ScpSendDirSize = _countof(pts->ScpSendDir);
+	Param.UILanguageFile = pts->UILanguageFile;
+
 	int ret = DialogBoxParam(
 		hInstance, MAKEINTRESOURCE(IDD_DAD_DIALOG),
 		hWndParent, (DLGPROC)OnDragDropDlgProc,

Modified: branches/cmake/teraterm/teraterm/dnddlg.h
===================================================================
--- branches/cmake/teraterm/teraterm/dnddlg.h	2018-08-05 10:49:00 UTC (rev 7172)
+++ branches/cmake/teraterm/teraterm/dnddlg.h	2018-08-05 10:54:39 UTC (rev 7173)
@@ -27,6 +27,7 @@
  */
 
 #include <windows.h>
+#include "tttypes.h"	// for TTTSet
 
 enum drop_type {
 	DROP_TYPE_CANCEL,
@@ -46,7 +47,7 @@
 	int RemaingFileCount,
 	bool EnableSCP,
 	bool EnableSendFile,
-	bool EnableDoNotShowDialog,
+	TTTSet *pts,
 	unsigned char *DropTypePaste,
 	bool *DoSameProcess,
 	bool *DoSameProcessNextDrop,

Modified: branches/cmake/teraterm/teraterm/vtwin.cpp
===================================================================
--- branches/cmake/teraterm/teraterm/vtwin.cpp	2018-08-05 10:49:00 UTC (rev 7172)
+++ branches/cmake/teraterm/teraterm/vtwin.cpp	2018-08-05 10:54:39 UTC (rev 7173)
@@ -2222,7 +2222,7 @@
 								  DropListCount - i,
 								  (DirectoryCount == 0 && isSSH) ? true : false,
 								  DirectoryCount == 0 ? true : false,
-								  ts.ConfirmFileDragAndDrop ? false : true,
+								  &ts,
 								  &DropTypePaste,
 								  &DoSameProcess,
 								  &DoSameProcessNextDrop,



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