• R/O
  • SSH
  • HTTPS

ttssh2: Commit


Commit MetaInfo

Revision7141 (tree)
Time2018-06-28 23:24:07
Authorzmatsuo

Log Message

drag and dropダイアログの調整
- 文言修正
- ラジオボタンの動作改良

Change Summary

Incremental Difference

--- branches/drag_and_drop/teraterm/common/tt_res.h (revision 7140)
+++ branches/drag_and_drop/teraterm/common/tt_res.h (revision 7141)
@@ -214,7 +214,7 @@
214214 #define IDC_CLIPBOARD_NOTIFY 2566
215215 #define IDC_LIST_HIDDEN_FONTS 2567
216216 #define IDC_BINARY_CHECK 2568
217-#define IDC_ADAPT_SAME_CHECK 2569
217+#define IDC_SAME_PROCESS_CHECK 2569
218218 #define IDC_FILENAME_EDIT 2570
219219 #define IDC_SCP_RADIO 2571
220220 #define IDC_SENDFILE_RADIO 2572
@@ -225,7 +225,7 @@
225225 #define IDC_SPACE_RADIO 2577
226226 #define IDC_NEWLINE_RADIO 2578
227227 #define IDC_DAD_NOTE 2579
228-#define IDC_SAME_PROCESS_CHECK 2580
228+#define IDC_SAME_PROCESS_NEXTDROP_CHECK 2580
229229 #define IDC_DONTSHOW_CHECK 2581
230230 #define ID_ACC_SENDBREAK 50001
231231 #define ID_ACC_COPY 50002
--- branches/drag_and_drop/teraterm/teraterm/vtwin.cpp (revision 7140)
+++ branches/drag_and_drop/teraterm/teraterm/vtwin.cpp (revision 7141)
@@ -2032,6 +2032,28 @@
20322032 }
20332033 }
20342034
2035+typedef struct {
2036+ int nIDDlgItem;
2037+ char *key;
2038+} DlgTextInfo;
2039+
2040+static void SetDlgTexts(HWND hDlgWnd, const DlgTextInfo *infos, int infoCount, char *UILanguageFile)
2041+{
2042+ for (int i = 0 ; i < infoCount; i++) {
2043+ char *key = infos[i].key;
2044+ char uimsg[MAX_UIMSG];
2045+ get_lang_msg(key, uimsg, sizeof(uimsg), "", UILanguageFile);
2046+ if (uimsg[0] != '\0') {
2047+ const int nIDDlgItem = infos[i].nIDDlgItem;
2048+ if (nIDDlgItem == 0) {
2049+ SetWindowText(hDlgWnd, uimsg);
2050+ } else {
2051+ SetDlgItemText(hDlgWnd, nIDDlgItem, uimsg);
2052+ }
2053+ }
2054+ }
2055+}
2056+
20352057 enum drop_type {
20362058 DROP_TYPE_CANCEL,
20372059 DROP_TYPE_SCP,
@@ -2053,8 +2075,8 @@
20532075 bool SendfileEnable;
20542076 bool PasteNewlineEnable;
20552077 int RemaingFileCount;
2056- bool AdaptSameProcess;
20572078 bool DoSameProcess;
2079+ bool DoSameProcessNextDrop;
20582080 bool DoNotShowDialogEnable;
20592081 bool DoNotShowDialog;
20602082 };
@@ -2071,7 +2093,6 @@
20712093 switch (msg) {
20722094 case WM_INITDIALOG:
20732095 {
2074- char uimsg[MAX_UIMSG];
20752096 LOGFONT logfont;
20762097 HFONT font;
20772098 HFONT DlgDragDropFont = NULL;
@@ -2082,7 +2103,7 @@
20822103 font = (HFONT)SendMessage(hDlgWnd, WM_GETFONT, 0, 0);
20832104 GetObject(font, sizeof(LOGFONT), &logfont);
20842105 if (get_lang_font("DLG_TAHOMA_FONT", hDlgWnd, &logfont, &DlgDragDropFont, ts.UILanguageFile)) {
2085- const static int IDs[] = {
2106+ static const int IDs[] = {
20862107 IDC_FILENAME_EDIT,
20872108 IDC_DAD_STATIC,
20882109 IDC_SCP_RADIO, IDC_SENDFILE_RADIO, IDC_PASTE_RADIO,
@@ -2089,7 +2110,7 @@
20892110 IDC_SCP_PATH_LABEL, IDC_SCP_PATH, IDC_SCP_PATH_NOTE,
20902111 IDC_BINARY_CHECK,
20912112 IDC_ESCAPE_CHECK, IDC_NEWLINE_RADIO, IDC_SPACE_RADIO,
2092- IDC_ADAPT_SAME_CHECK, IDC_DONTSHOW_CHECK,
2113+ IDC_SAME_PROCESS_CHECK, IDC_SAME_PROCESS_NEXTDROP_CHECK, IDC_DONTSHOW_CHECK,
20932114 IDC_DAD_NOTE,
20942115 IDOK, IDCANCEL,
20952116 };
@@ -2099,15 +2120,15 @@
20992120 }
21002121 DlgData->DlgDragDropFont = DlgDragDropFont;
21012122
2102- GetWindowText(hDlgWnd, uimsg, sizeof(uimsg));
2103- get_lang_msg("MSG_DANDD_CONF_TITLE", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
2104- SetWindowText(hDlgWnd, ts.UIMsg);
2123+ static const DlgTextInfo textInfos[] = {
2124+ { 0, "MSG_DANDD_CONF_TITLE" },
2125+ { IDC_DAD_STATIC, "MSG_DANDD_CONF" },
2126+ { IDC_SAME_PROCESS_CHECK, "MSG_DANDD_CONF_CONFLICTS" },
2127+ };
2128+ SetDlgTexts(hDlgWnd, textInfos, _countof(textInfos), ts.UILanguageFile);
21052129
2130+ // target file
21062131 SetDlgItemText(hDlgWnd, IDC_FILENAME_EDIT, Param->TargetFilename);
2107-
2108- get_lang_msg("MSG_DANDD_CONF", ts.UIMsg, sizeof(ts.UIMsg),
2109- "Are you sure that you want to send the file content?", ts.UILanguageFile);
2110- SetDlgItemText(hDlgWnd, IDC_DAD_STATIC, ts.UIMsg);
21112132
21122133 // checkbox
21132134 CheckRadioButton(hDlgWnd, IDC_SCP_RADIO, IDC_PASTE_RADIO,
@@ -2148,13 +2169,14 @@
21482169 EnableWindow(GetDlgItem(hDlgWnd, IDC_NEWLINE_RADIO), FALSE);
21492170 }
21502171
2151- // Adapt same process
2152- GetDlgItemText(hDlgWnd, IDC_ADAPT_SAME_CHECK, uimsg, sizeof(uimsg));
2153- char b[MAX_UIMSG];
2154- _snprintf_s(b, sizeof(b), _TRUNCATE, uimsg, Param->RemaingFileCount);
2155- SetDlgItemText(hDlgWnd, IDC_ADAPT_SAME_CHECK, b);
2172+ // Do this for the next %d conflicts
2173+ char orgmsg[MAX_UIMSG];
2174+ GetDlgItemText(hDlgWnd, IDC_SAME_PROCESS_CHECK, orgmsg, sizeof(orgmsg));
2175+ char uimsg[MAX_UIMSG];
2176+ _snprintf_s(uimsg, sizeof(uimsg), _TRUNCATE, orgmsg, Param->RemaingFileCount - 1);
2177+ SetDlgItemText(hDlgWnd, IDC_SAME_PROCESS_CHECK, uimsg);
21562178 if (Param->RemaingFileCount < 2) {
2157- EnableWindow(GetDlgItem(hDlgWnd, IDC_ADAPT_SAME_CHECK), FALSE);
2179+ EnableWindow(GetDlgItem(hDlgWnd, IDC_SAME_PROCESS_CHECK), FALSE);
21582180 }
21592181
21602182 // Dont Show Dialog
@@ -2194,6 +2216,17 @@
21942216 { // radio buttons double click
21952217 wID = IDOK;
21962218 }
2219+ if (wCMD == EN_SETFOCUS && wID == IDC_SCP_PATH) {
2220+ CheckRadioButton(hDlgWnd, IDC_SCP_RADIO, IDC_PASTE_RADIO, IDC_SCP_RADIO);
2221+ }
2222+ if (wID == IDC_BINARY_CHECK) {
2223+ CheckRadioButton(hDlgWnd, IDC_SCP_RADIO, IDC_PASTE_RADIO, IDC_SENDFILE_RADIO);
2224+ }
2225+ if (wID == IDC_ESCAPE_CHECK ||
2226+ wID == IDC_SPACE_RADIO || wID == IDC_NEWLINE_RADIO)
2227+ {
2228+ CheckRadioButton(hDlgWnd, IDC_SCP_RADIO, IDC_PASTE_RADIO, IDC_PASTE_RADIO);
2229+ }
21972230 if (wID == IDOK) {
21982231 if (IsDlgButtonChecked(hDlgWnd, IDC_SCP_RADIO) == BST_CHECKED) {
21992232 // SCP
@@ -2217,12 +2250,12 @@
22172250 (IsDlgButtonChecked(hDlgWnd, IDC_NEWLINE_RADIO) == BST_CHECKED) ?
22182251 DROP_TYPE_PASTE_NEWLINE : 0;
22192252 }
2220- DlgData->Param->AdaptSameProcess =
2221- (IsDlgButtonChecked(hDlgWnd, IDC_ADAPT_SAME_CHECK) == BST_CHECKED) ?
2222- true : false;
2223- DlgData->Param->DoSameProcess =
2253+ DlgData->Param->DoSameProcess =
22242254 (IsDlgButtonChecked(hDlgWnd, IDC_SAME_PROCESS_CHECK) == BST_CHECKED) ?
22252255 true : false;
2256+ DlgData->Param->DoSameProcessNextDrop =
2257+ (IsDlgButtonChecked(hDlgWnd, IDC_SAME_PROCESS_NEXTDROP_CHECK) == BST_CHECKED) ?
2258+ true : false;
22262259 DlgData->Param->DoNotShowDialog =
22272260 (IsDlgButtonChecked(hDlgWnd, IDC_DONTSHOW_CHECK) == BST_CHECKED) ?
22282261 true : false;
@@ -2256,8 +2289,8 @@
22562289 bool EnableSendFile,
22572290 bool EnableDoNotShowDialog,
22582291 unsigned char *DropTypePaste,
2259- bool *AdaptSameProcess,
22602292 bool *DoSameProcess,
2293+ bool *DoSameProcessNextDrop,
22612294 bool *DoNotShowDialog)
22622295 {
22632296 struct DrapDropDlgParam Param;
@@ -2280,8 +2313,8 @@
22802313 return DROP_TYPE_CANCEL;
22812314 }
22822315 *DropTypePaste = Param.DropTypePaste;
2283- *AdaptSameProcess = Param.AdaptSameProcess;
22842316 *DoSameProcess = Param.DoSameProcess;
2317+ *DoSameProcessNextDrop = Param.DoSameProcessNextDrop;
22852318 *DoNotShowDialog = Param.DoNotShowDialog;
22862319 return Param.DropType;
22872320 }
@@ -2404,7 +2437,7 @@
24042437 }
24052438 }
24062439
2407- bool AdapatSameProcess = false;
2440+ bool DoSameProcess = false;
24082441 const bool isSSH = (cv.isSSH == 2);
24092442 enum drop_type DropType;
24102443 unsigned char DropTypePaste = DROP_TYPE_PASTE_ESCAPE;
@@ -2418,17 +2451,17 @@
24182451 } else {
24192452 DropType = DROP_TYPE_SEND_FILE;
24202453 }
2421- AdapatSameProcess = false;
2454+ DoSameProcess = false;
24222455 } else {
24232456 DropType = DROP_TYPE_SEND_FILE;
2424- AdapatSameProcess = DefaultShowDialog ? false : true;
2457+ DoSameProcess = DefaultShowDialog ? false : true;
24252458 }
24262459 } else if (FileCount == 0 && DirectoryCount == 1) {
24272460 DropType = DROP_TYPE_PASTE_FILENAME;
2428- AdapatSameProcess = DefaultShowDialog ? false : true;
2461+ DoSameProcess = DefaultShowDialog ? false : true;
24292462 } else if (FileCount > 0 && DirectoryCount > 0) {
24302463 DropType = DROP_TYPE_PASTE_FILENAME;
2431- AdapatSameProcess = false;
2464+ DoSameProcess = false;
24322465 } else if (FileCount > 0 && DirectoryCount == 0) {
24332466 // filename only
24342467 if (isSSH) {
@@ -2436,11 +2469,11 @@
24362469 } else {
24372470 DropType = DROP_TYPE_SEND_FILE;
24382471 }
2439- AdapatSameProcess = false;
2472+ DoSameProcess = false;
24402473 } else {
24412474 // directory only
24422475 DropType = DROP_TYPE_PASTE_FILENAME;
2443- AdapatSameProcess = ts.ConfirmFileDragAndDrop ? false : true;
2476+ DoSameProcess = ts.ConfirmFileDragAndDrop ? false : true;
24442477 }
24452478 } else {
24462479 // show dialog
@@ -2453,7 +2486,7 @@
24532486 DropType = DROP_TYPE_SEND_FILE;
24542487 }
24552488 }
2456- AdapatSameProcess = false;
2489+ DoSameProcess = false;
24572490 }
24582491 } else {
24592492 if (DirectoryCount > 0 &&
@@ -2463,11 +2496,11 @@
24632496 { // デフォルトのままでは処理できない組み合わせ
24642497 DropType = DROP_TYPE_PASTE_FILENAME;
24652498 DropTypePaste = DefaultDropTypePaste;
2466- AdapatSameProcess = false;
2499+ DoSameProcess = false;
24672500 } else {
24682501 DropType = DefaultDropType;
24692502 DropTypePaste = DefaultDropTypePaste;
2470- AdapatSameProcess = (ShowDialog || DefaultShowDialog) ? false : true;
2503+ DoSameProcess = (ShowDialog || DefaultShowDialog) ? false : true;
24712504 }
24722505 }
24732506
@@ -2474,8 +2507,8 @@
24742507 for (int i = 0; i < DropListCount; i++) {
24752508 const char *FileName = DropLists[i];
24762509
2477- if (!AdapatSameProcess) {
2478- bool DoSameProcess;
2510+ if (!DoSameProcess) {
2511+ bool DoSameProcessNextDrop;
24792512 bool DoNotShowDialog = !DefaultShowDialog;
24802513 DropType =
24812514 ShowDropDialogBox(hInst, HVTWin,
@@ -2485,13 +2518,13 @@
24852518 DirectoryCount == 0 ? true : false,
24862519 ts.ConfirmFileDragAndDrop ? false : true,
24872520 &DropTypePaste,
2488- &AdapatSameProcess,
24892521 &DoSameProcess,
2522+ &DoSameProcessNextDrop,
24902523 &DoNotShowDialog);
24912524 if (DropType == DROP_TYPE_CANCEL) {
24922525 goto finish;
24932526 }
2494- if (DoSameProcess) {
2527+ if (DoSameProcessNextDrop) {
24952528 DefaultDropType = DropType;
24962529 DefaultDropTypePaste = DropTypePaste;
24972530 }
@@ -2543,7 +2576,7 @@
25432576 {
25442577 // send by scp
25452578 char **FileNames = &DropLists[i];
2546- int FileCount = AdapatSameProcess ? DropListCount - i : 1;
2579+ int FileCount = DoSameProcess ? DropListCount - i : 1;
25472580 if (!SendScp(FileNames, FileCount, ts.ScpSendDir)) {
25482581 goto finish;
25492582 }
Show on old repository browser