• R/O
  • SSH
  • HTTPS

ttssh2: コミット


コミットメタ情報

リビジョン7139 (tree)
日時2018-06-18 11:56:00
作者zmatsuo

ログメッセージ

drag and dropダイアログのデザイン変更

変更サマリ

差分

--- branches/drag_and_drop/teraterm/common/tt_res.h (revision 7138)
+++ branches/drag_and_drop/teraterm/common/tt_res.h (revision 7139)
@@ -64,7 +64,6 @@
6464 #define IDC_SHELL 1038
6565 #define IDC_TERM_EDIT 1039
6666 #define IDC_ENV1 1040
67-#define IDC_EDIT7 1041
6867 #define IDC_ENV2 1041
6968 #define IDC_MOUSE 1042
7069 #define IDC_DELIMITER 1043
@@ -129,7 +128,6 @@
129128 #define IDC_REALTIME_CHECK 2508
130129 #define IDC_LIST1 2509
131130 #define IDC_LIST 2509
132-#define IDC_EDIT1 2510
133131 #define IDC_EDIT 2510
134132 #define IDC_SCROLL_LINE 2510
135133 #define IDC_PASTEDELAY_EDIT 2510
@@ -138,7 +136,6 @@
138136 #define IDC_ROTATE_SIZE 2510
139137 #define IDC_INI_SETUPDIR_EDIT 2510
140138 #define IDC_KEYCNF_SETUPDIR_EDIT 2511
141-#define IDC_CHECK1 2512
142139 #define IDC_CONFIRM_CHANGE_PASTE 2512
143140 #define IDC_CURSOR_CTRL_SEQ 2512
144141 #define IDC_LOG_ROTATE 2512
@@ -199,7 +196,6 @@
199196 #define IDC_CYGTERM_SETUPDIR_BUTTON_FILE2 2551
200197 #define IDC_SSH_SETUPDIR_BUTTON_FILE 2551
201198 #define IDC_BGIMG_BRIGHTNESS 2551
202-#define IDC_EDIT2 2552
203199 #define IDC_EDIT_BGIMG_BRIGHTNESS 2552
204200 #define IDC_INI_SETUPDIR_EDIT_VSTORE 2552
205201 #define IDC_INI_SETUPDIR_STATIC_VSTORE 2553
@@ -224,9 +220,13 @@
224220 #define IDC_SENDFILE_RADIO 2572
225221 #define IDC_PASTE_RADIO 2573
226222 #define IDC_ESCAPE_CHECK 2574
227-#define IDC_DEFAULT_CHECK 2575
228-#define IDC_SCP_PATH_LABEL 2576
229-#define IDC_SCP_PATH_NOTE 2577
223+#define IDC_SCP_PATH_LABEL 2575
224+#define IDC_SCP_PATH_NOTE 2576
225+#define IDC_SPACE_RADIO 2577
226+#define IDC_NEWLINE_RADIO 2578
227+#define IDC_DAD_NOTE 2579
228+#define IDC_SAME_PROCESS_CHECK 2580
229+#define IDC_DONTSHOW_CHECK 2581
230230 #define ID_ACC_SENDBREAK 50001
231231 #define ID_ACC_COPY 50002
232232 #define ID_ACC_NEWCONNECTION 50003
@@ -324,7 +324,7 @@
324324 #define _APS_NO_MFC 1
325325 #define _APS_NEXT_RESOURCE_VALUE 126
326326 #define _APS_NEXT_COMMAND_VALUE 52031
327-#define _APS_NEXT_CONTROL_VALUE 2578
327+#define _APS_NEXT_CONTROL_VALUE 2582
328328 #define _APS_NEXT_SYMED_VALUE 101
329329 #endif
330330 #endif
--- branches/drag_and_drop/teraterm/teraterm/vtwin.cpp (revision 7138)
+++ branches/drag_and_drop/teraterm/teraterm/vtwin.cpp (revision 7139)
@@ -2038,19 +2038,25 @@
20382038 DROP_TYPE_SEND_FILE, // past contents of file
20392039 DROP_TYPE_SEND_FILE_BINARY,
20402040 DROP_TYPE_PASTE_FILENAME,
2041- DROP_TYPE_PASTE_FILENAME_WITH_ESCAPE,
20422041 };
20432042
2043+#define DROP_TYPE_PASTE_ESCAPE 0x01
2044+#define DROP_TYPE_PASTE_NEWLINE 0x02
2045+
20442046 struct DrapDropDlgParam {
20452047 const char *TargetFilename;
20462048 enum drop_type DropType;
2049+ unsigned char DropTypePaste;
20472050 bool ScpEnable;
20482051 char *ScpSendDirPtr;
20492052 int ScpSendDirSize;
20502053 bool SendfileEnable;
2054+ bool PasteNewlineEnable;
20512055 int RemaingFileCount;
20522056 bool AdaptSameProcess;
2053- bool DefaultProcess;
2057+ bool DoSameProcess;
2058+ bool DoNotShowDialogEnable;
2059+ bool DoNotShowDialog;
20542060 };
20552061
20562062 struct DrapDropDlgData {
@@ -2081,8 +2087,10 @@
20812087 IDC_DAD_STATIC,
20822088 IDC_SCP_RADIO, IDC_SENDFILE_RADIO, IDC_PASTE_RADIO,
20832089 IDC_SCP_PATH_LABEL, IDC_SCP_PATH, IDC_SCP_PATH_NOTE,
2084- IDC_BINARY_CHECK, IDC_ESCAPE_CHECK,
2085- IDC_ADAPT_SAME_CHECK, IDC_DEFAULT_CHECK,
2090+ IDC_BINARY_CHECK,
2091+ IDC_ESCAPE_CHECK, IDC_NEWLINE_RADIO, IDC_SPACE_RADIO,
2092+ IDC_ADAPT_SAME_CHECK, IDC_DONTSHOW_CHECK,
2093+ IDC_DAD_NOTE,
20862094 IDOK, IDCANCEL,
20872095 };
20882096 SetDlgFonts(hDlgWnd, IDs, _countof(IDs), DlgDragDropFont);
@@ -2105,8 +2113,7 @@
21052113 CheckRadioButton(hDlgWnd, IDC_SCP_RADIO, IDC_PASTE_RADIO,
21062114 (Param->DropType == DROP_TYPE_SEND_FILE ||
21072115 Param->DropType == DROP_TYPE_SEND_FILE_BINARY) ? IDC_SENDFILE_RADIO :
2108- (Param->DropType == DROP_TYPE_PASTE_FILENAME ||
2109- Param->DropType == DROP_TYPE_PASTE_FILENAME_WITH_ESCAPE) ? IDC_PASTE_RADIO :
2116+ Param->DropType == DROP_TYPE_PASTE_FILENAME ? IDC_PASTE_RADIO :
21102117 IDC_SCP_RADIO);
21112118
21122119 // SCP
@@ -2130,9 +2137,16 @@
21302137 }
21312138
21322139 // Paste Filename
2133- if (Param->DropType != DROP_TYPE_PASTE_FILENAME) {
2140+ if (Param->DropTypePaste & DROP_TYPE_PASTE_ESCAPE) {
21342141 SendMessage(GetDlgItem(hDlgWnd, IDC_ESCAPE_CHECK), BM_SETCHECK, BST_CHECKED, 0);
21352142 }
2143+ CheckRadioButton(hDlgWnd, IDC_SPACE_RADIO, IDC_NEWLINE_RADIO,
2144+ Param->DropTypePaste & DROP_TYPE_PASTE_NEWLINE?
2145+ IDC_NEWLINE_RADIO : IDC_SPACE_RADIO);
2146+ if (Param->RemaingFileCount < 2) {
2147+ EnableWindow(GetDlgItem(hDlgWnd, IDC_SPACE_RADIO), FALSE);
2148+ EnableWindow(GetDlgItem(hDlgWnd, IDC_NEWLINE_RADIO), FALSE);
2149+ }
21362150
21372151 // Adapt same process
21382152 GetDlgItemText(hDlgWnd, IDC_ADAPT_SAME_CHECK, uimsg, sizeof(uimsg));
@@ -2143,6 +2157,15 @@
21432157 EnableWindow(GetDlgItem(hDlgWnd, IDC_ADAPT_SAME_CHECK), FALSE);
21442158 }
21452159
2160+ // Dont Show Dialog
2161+ if (Param->DoNotShowDialog) {
2162+ SendMessage(GetDlgItem(hDlgWnd, IDC_DONTSHOW_CHECK), BM_SETCHECK, BST_CHECKED, 0);
2163+ }
2164+ if (!Param->DoNotShowDialogEnable) {
2165+ EnableWindow(GetDlgItem(hDlgWnd, IDC_DONTSHOW_CHECK), FALSE);
2166+ EnableWindow(GetDlgItem(hDlgWnd, IDC_DAD_NOTE), FALSE);
2167+ }
2168+
21462169 // focus to "SCP dest textbox" or "Cancel"
21472170 if (Param->ScpEnable) {
21482171 // "SCP" 有効時は Cancel にフォーカスを当て、最終的に SCP PATH にフォーカスが
@@ -2185,16 +2208,24 @@
21852208 DROP_TYPE_SEND_FILE_BINARY : DROP_TYPE_SEND_FILE;
21862209 } else /* if (IsDlgButtonChecked(hDlgWnd, IDC_PASTE_RADIO) == BST_CHECKED) */ {
21872210 // Paste Filename
2188- DlgData->Param->DropType =
2211+ DlgData->Param->DropType = DROP_TYPE_PASTE_FILENAME;
2212+ DlgData->Param->DropTypePaste = 0;
2213+ DlgData->Param->DropTypePaste |=
21892214 (IsDlgButtonChecked(hDlgWnd, IDC_ESCAPE_CHECK) == BST_CHECKED) ?
2190- DROP_TYPE_PASTE_FILENAME_WITH_ESCAPE : DROP_TYPE_PASTE_FILENAME;
2215+ DROP_TYPE_PASTE_ESCAPE : 0;
2216+ DlgData->Param->DropTypePaste |=
2217+ (IsDlgButtonChecked(hDlgWnd, IDC_NEWLINE_RADIO) == BST_CHECKED) ?
2218+ DROP_TYPE_PASTE_NEWLINE : 0;
21912219 }
21922220 DlgData->Param->AdaptSameProcess =
21932221 (IsDlgButtonChecked(hDlgWnd, IDC_ADAPT_SAME_CHECK) == BST_CHECKED) ?
21942222 true : false;
2195- DlgData->Param->DefaultProcess =
2196- (IsDlgButtonChecked(hDlgWnd, IDC_DEFAULT_CHECK) == BST_CHECKED) ?
2223+ DlgData->Param->DoSameProcess =
2224+ (IsDlgButtonChecked(hDlgWnd, IDC_SAME_PROCESS_CHECK) == BST_CHECKED) ?
21972225 true : false;
2226+ DlgData->Param->DoNotShowDialog =
2227+ (IsDlgButtonChecked(hDlgWnd, IDC_DONTSHOW_CHECK) == BST_CHECKED) ?
2228+ true : false;
21982229 }
21992230 if (wID == IDCANCEL) {
22002231 DlgData->Param->DropType = DROP_TYPE_CANCEL;
@@ -2223,17 +2254,24 @@
22232254 int RemaingFileCount,
22242255 bool EnableSCP,
22252256 bool EnableSendFile,
2257+ bool EnableDoNotShowDialog,
2258+ unsigned char *DropTypePaste,
22262259 bool *AdaptSameProcess,
2227- bool *DefaultProcess)
2260+ bool *DoSameProcess,
2261+ bool *DoNotShowDialog)
22282262 {
22292263 struct DrapDropDlgParam Param;
22302264 Param.TargetFilename = TargetFilename;
22312265 Param.DropType = DefaultDropType;
2266+ Param.DropTypePaste = *DropTypePaste;
22322267 Param.ScpEnable = EnableSCP;
22332268 Param.ScpSendDirPtr = ts.ScpSendDir;
22342269 Param.ScpSendDirSize = sizeof(ts.ScpSendDir);
22352270 Param.SendfileEnable = EnableSendFile;
2271+ Param.PasteNewlineEnable = true;
22362272 Param.RemaingFileCount = RemaingFileCount;
2273+ Param.DoNotShowDialog = *DoNotShowDialog;
2274+ Param.DoNotShowDialogEnable = EnableDoNotShowDialog;
22372275 int ret = DialogBoxParam(
22382276 hInstance, MAKEINTRESOURCE(IDD_DAD_DIALOG),
22392277 hWndParent, (DLGPROC)OnDragDropDlgProc,
@@ -2241,8 +2279,10 @@
22412279 if (ret != IDOK) {
22422280 return DROP_TYPE_CANCEL;
22432281 }
2282+ *DropTypePaste = Param.DropTypePaste;
22442283 *AdaptSameProcess = Param.AdaptSameProcess;
2245- *DefaultProcess = Param.DefaultProcess;
2284+ *DoSameProcess = Param.DoSameProcess;
2285+ *DoNotShowDialog = Param.DoNotShowDialog;
22462286 return Param.DropType;
22472287 }
22482288
@@ -2343,7 +2383,10 @@
23432383
23442384 LONG CVTWindow::OnDropNotify(UINT ShowDialog, LONG lParam)
23452385 {
2386+ // iniに保存されない、今実行しているTera Termでのみ有効な設定
23462387 static enum drop_type DefaultDropType = DROP_TYPE_CANCEL;
2388+ static unsigned char DefaultDropTypePaste = DROP_TYPE_PASTE_ESCAPE;
2389+ static bool DefaultShowDialog = ts.ConfirmFileDragAndDrop ? true : false;
23472390
23482391 (void)lParam;
23492392 int FileCount = 0;
@@ -2364,6 +2407,7 @@
23642407 bool AdapatSameProcess = false;
23652408 const bool isSSH = (cv.isSSH == 2);
23662409 enum drop_type DropType;
2410+ unsigned char DropTypePaste = DROP_TYPE_PASTE_ESCAPE;
23672411 if (DefaultDropType == DROP_TYPE_CANCEL) {
23682412 // default is not set
23692413 if (!ShowDialog) {
@@ -2377,13 +2421,13 @@
23772421 AdapatSameProcess = false;
23782422 } else {
23792423 DropType = DROP_TYPE_SEND_FILE;
2380- AdapatSameProcess = true;
2424+ AdapatSameProcess = DefaultShowDialog ? false : true;
23812425 }
23822426 } else if (FileCount == 0 && DirectoryCount == 1) {
2383- DropType = DROP_TYPE_PASTE_FILENAME_WITH_ESCAPE;
2384- AdapatSameProcess = true;
2427+ DropType = DROP_TYPE_PASTE_FILENAME;
2428+ AdapatSameProcess = DefaultShowDialog ? false : true;
23852429 } else if (FileCount > 0 && DirectoryCount > 0) {
2386- DropType = DROP_TYPE_PASTE_FILENAME_WITH_ESCAPE;
2430+ DropType = DROP_TYPE_PASTE_FILENAME;
23872431 AdapatSameProcess = false;
23882432 } else if (FileCount > 0 && DirectoryCount == 0) {
23892433 // filename only
@@ -2395,13 +2439,13 @@
23952439 AdapatSameProcess = false;
23962440 } else {
23972441 // directory only
2398- DropType = DROP_TYPE_PASTE_FILENAME_WITH_ESCAPE;
2442+ DropType = DROP_TYPE_PASTE_FILENAME;
23992443 AdapatSameProcess = ts.ConfirmFileDragAndDrop ? false : true;
24002444 }
24012445 } else {
24022446 // show dialog
24032447 if (DirectoryCount > 0) {
2404- DropType = DROP_TYPE_PASTE_FILENAME_WITH_ESCAPE;
2448+ DropType = DROP_TYPE_PASTE_FILENAME;
24052449 } else {
24062450 if (isSSH) {
24072451 DropType = DROP_TYPE_SCP;
@@ -2417,11 +2461,13 @@
24172461 DefaultDropType == DROP_TYPE_SEND_FILE_BINARY ||
24182462 DefaultDropType == DROP_TYPE_SCP))
24192463 { // デフォルトのままでは処理できない組み合わせ
2420- DropType = DROP_TYPE_PASTE_FILENAME_WITH_ESCAPE;
2464+ DropType = DROP_TYPE_PASTE_FILENAME;
2465+ DropTypePaste = DefaultDropTypePaste;
24212466 AdapatSameProcess = false;
24222467 } else {
24232468 DropType = DefaultDropType;
2424- AdapatSameProcess = ShowDialog ? false : true;
2469+ DropTypePaste = DefaultDropTypePaste;
2470+ AdapatSameProcess = (ShowDialog || DefaultShowDialog) ? false : true;
24252471 }
24262472 }
24272473
@@ -2429,7 +2475,8 @@
24292475 const char *FileName = DropLists[i];
24302476
24312477 if (!AdapatSameProcess) {
2432- bool DefaultProcess;
2478+ bool DoSameProcess;
2479+ bool DoNotShowDialog = !DefaultShowDialog;
24332480 DropType =
24342481 ShowDropDialogBox(hInst, HVTWin,
24352482 FileName, DropType,
@@ -2436,13 +2483,21 @@
24362483 DropListCount - i,
24372484 (DirectoryCount == 0 && isSSH) ? true : false,
24382485 DirectoryCount == 0 ? true : false,
2439- &AdapatSameProcess, &DefaultProcess);
2486+ ts.ConfirmFileDragAndDrop ? false : true,
2487+ &DropTypePaste,
2488+ &AdapatSameProcess,
2489+ &DoSameProcess,
2490+ &DoNotShowDialog);
24402491 if (DropType == DROP_TYPE_CANCEL) {
24412492 goto finish;
24422493 }
2443- if (DefaultProcess) {
2494+ if (DoSameProcess) {
24442495 DefaultDropType = DropType;
2496+ DefaultDropTypePaste = DropTypePaste;
24452497 }
2498+ if (!ts.ConfirmFileDragAndDrop) {
2499+ DefaultShowDialog = !DoNotShowDialog;
2500+ }
24462501 }
24472502
24482503 switch (DropType) {
@@ -2475,12 +2530,12 @@
24752530 }
24762531 break;
24772532 case DROP_TYPE_PASTE_FILENAME:
2478- case DROP_TYPE_PASTE_FILENAME_WITH_ESCAPE:
24792533 {
2480- const bool escape = DropType == DROP_TYPE_PASTE_FILENAME ? false : true;
2534+ const bool escape = (DropTypePaste & DROP_TYPE_PASTE_ESCAPE) ? true : false;
24812535 PasteString(&cv, FileName, escape);
2482- if (DropListCount > 1) {
2483- PasteString(&cv, "\n", false);
2536+ if (DropListCount > 1 && i < DropListCount - 1) {
2537+ const char *separator = (DropTypePaste & DROP_TYPE_PASTE_NEWLINE) ? "\n" : " ";
2538+ PasteString(&cv, separator, false);
24842539 }
24852540 break;
24862541 }
旧リポジトリブラウザで表示