Commit MetaInfo
Log Message
drag and dropダイアログの調整
- 文言修正
- ラジオボタンの動作改良
Change Summary
Incremental Difference
| | @@ -214,7 +214,7 @@ | 214 | 214 | #define IDC_CLIPBOARD_NOTIFY 2566
| 215 | 215 | #define IDC_LIST_HIDDEN_FONTS 2567
| 216 | 216 | #define IDC_BINARY_CHECK 2568
| 217 | | -#define IDC_ADAPT_SAME_CHECK 2569
| | 217 | +#define IDC_SAME_PROCESS_CHECK 2569
| 218 | 218 | #define IDC_FILENAME_EDIT 2570
| 219 | 219 | #define IDC_SCP_RADIO 2571
| 220 | 220 | #define IDC_SENDFILE_RADIO 2572
|
| | @@ -225,7 +225,7 @@ | 225 | 225 | #define IDC_SPACE_RADIO 2577
| 226 | 226 | #define IDC_NEWLINE_RADIO 2578
| 227 | 227 | #define IDC_DAD_NOTE 2579
| 228 | | -#define IDC_SAME_PROCESS_CHECK 2580
| | 228 | +#define IDC_SAME_PROCESS_NEXTDROP_CHECK 2580
| 229 | 229 | #define IDC_DONTSHOW_CHECK 2581
| 230 | 230 | #define ID_ACC_SENDBREAK 50001
| 231 | 231 | #define ID_ACC_COPY 50002
|
| | @@ -2032,6 +2032,28 @@ | 2032 | 2032 | }
| 2033 | 2033 | }
| 2034 | 2034 |
| | 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 | +
| 2035 | 2057 | enum drop_type {
| 2036 | 2058 | DROP_TYPE_CANCEL,
| 2037 | 2059 | DROP_TYPE_SCP,
|
| | @@ -2053,8 +2075,8 @@ | 2053 | 2075 | bool SendfileEnable;
| 2054 | 2076 | bool PasteNewlineEnable;
| 2055 | 2077 | int RemaingFileCount;
| 2056 | | - bool AdaptSameProcess;
| 2057 | 2078 | bool DoSameProcess;
| | 2079 | + bool DoSameProcessNextDrop;
| 2058 | 2080 | bool DoNotShowDialogEnable;
| 2059 | 2081 | bool DoNotShowDialog;
| 2060 | 2082 | };
|
| | @@ -2071,7 +2093,6 @@ | 2071 | 2093 | switch (msg) {
| 2072 | 2094 | case WM_INITDIALOG:
| 2073 | 2095 | {
| 2074 | | - char uimsg[MAX_UIMSG];
| 2075 | 2096 | LOGFONT logfont;
| 2076 | 2097 | HFONT font;
| 2077 | 2098 | HFONT DlgDragDropFont = NULL;
|
| | @@ -2082,7 +2103,7 @@ | 2082 | 2103 | font = (HFONT)SendMessage(hDlgWnd, WM_GETFONT, 0, 0);
| 2083 | 2104 | GetObject(font, sizeof(LOGFONT), &logfont);
| 2084 | 2105 | if (get_lang_font("DLG_TAHOMA_FONT", hDlgWnd, &logfont, &DlgDragDropFont, ts.UILanguageFile)) {
| 2085 | | - const static int IDs[] = {
| | 2106 | + static const int IDs[] = {
| 2086 | 2107 | IDC_FILENAME_EDIT,
| 2087 | 2108 | IDC_DAD_STATIC,
| 2088 | 2109 | IDC_SCP_RADIO, IDC_SENDFILE_RADIO, IDC_PASTE_RADIO,
|
| | @@ -2089,7 +2110,7 @@ | 2089 | 2110 | IDC_SCP_PATH_LABEL, IDC_SCP_PATH, IDC_SCP_PATH_NOTE,
| 2090 | 2111 | IDC_BINARY_CHECK,
| 2091 | 2112 | 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,
| 2093 | 2114 | IDC_DAD_NOTE,
| 2094 | 2115 | IDOK, IDCANCEL,
| 2095 | 2116 | };
|
| | @@ -2099,15 +2120,15 @@ | 2099 | 2120 | }
| 2100 | 2121 | DlgData->DlgDragDropFont = DlgDragDropFont;
| 2101 | 2122 |
| 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);
| 2105 | 2129 |
| | 2130 | + // target file
| 2106 | 2131 | 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);
| 2111 | 2132 |
| 2112 | 2133 | // checkbox
| 2113 | 2134 | CheckRadioButton(hDlgWnd, IDC_SCP_RADIO, IDC_PASTE_RADIO,
|
| | @@ -2148,13 +2169,14 @@ | 2148 | 2169 | EnableWindow(GetDlgItem(hDlgWnd, IDC_NEWLINE_RADIO), FALSE);
| 2149 | 2170 | }
| 2150 | 2171 |
| 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);
| 2156 | 2178 | if (Param->RemaingFileCount < 2) {
| 2157 | | - EnableWindow(GetDlgItem(hDlgWnd, IDC_ADAPT_SAME_CHECK), FALSE);
| | 2179 | + EnableWindow(GetDlgItem(hDlgWnd, IDC_SAME_PROCESS_CHECK), FALSE);
| 2158 | 2180 | }
| 2159 | 2181 |
| 2160 | 2182 | // Dont Show Dialog
|
| | @@ -2194,6 +2216,17 @@ | 2194 | 2216 | { // radio buttons double click
| 2195 | 2217 | wID = IDOK;
| 2196 | 2218 | }
| | 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 | + }
| 2197 | 2230 | if (wID == IDOK) {
| 2198 | 2231 | if (IsDlgButtonChecked(hDlgWnd, IDC_SCP_RADIO) == BST_CHECKED) {
| 2199 | 2232 | // SCP
|
| | @@ -2217,12 +2250,12 @@ | 2217 | 2250 | (IsDlgButtonChecked(hDlgWnd, IDC_NEWLINE_RADIO) == BST_CHECKED) ?
| 2218 | 2251 | DROP_TYPE_PASTE_NEWLINE : 0;
| 2219 | 2252 | }
| 2220 | | - DlgData->Param->AdaptSameProcess =
| 2221 | | - (IsDlgButtonChecked(hDlgWnd, IDC_ADAPT_SAME_CHECK) == BST_CHECKED) ?
| 2222 | | - true : false;
| 2223 | | - DlgData->Param->DoSameProcess =
| | 2253 | + DlgData->Param->DoSameProcess =
| 2224 | 2254 | (IsDlgButtonChecked(hDlgWnd, IDC_SAME_PROCESS_CHECK) == BST_CHECKED) ?
| 2225 | 2255 | true : false;
| | 2256 | + DlgData->Param->DoSameProcessNextDrop =
| | 2257 | + (IsDlgButtonChecked(hDlgWnd, IDC_SAME_PROCESS_NEXTDROP_CHECK) == BST_CHECKED) ?
| | 2258 | + true : false;
| 2226 | 2259 | DlgData->Param->DoNotShowDialog =
| 2227 | 2260 | (IsDlgButtonChecked(hDlgWnd, IDC_DONTSHOW_CHECK) == BST_CHECKED) ?
| 2228 | 2261 | true : false;
|
| | @@ -2256,8 +2289,8 @@ | 2256 | 2289 | bool EnableSendFile,
| 2257 | 2290 | bool EnableDoNotShowDialog,
| 2258 | 2291 | unsigned char *DropTypePaste,
| 2259 | | - bool *AdaptSameProcess,
| 2260 | 2292 | bool *DoSameProcess,
| | 2293 | + bool *DoSameProcessNextDrop,
| 2261 | 2294 | bool *DoNotShowDialog)
| 2262 | 2295 | {
| 2263 | 2296 | struct DrapDropDlgParam Param;
|
| | @@ -2280,8 +2313,8 @@ | 2280 | 2313 | return DROP_TYPE_CANCEL;
| 2281 | 2314 | }
| 2282 | 2315 | *DropTypePaste = Param.DropTypePaste;
| 2283 | | - *AdaptSameProcess = Param.AdaptSameProcess;
| 2284 | 2316 | *DoSameProcess = Param.DoSameProcess;
| | 2317 | + *DoSameProcessNextDrop = Param.DoSameProcessNextDrop;
| 2285 | 2318 | *DoNotShowDialog = Param.DoNotShowDialog;
| 2286 | 2319 | return Param.DropType;
| 2287 | 2320 | }
|
| | @@ -2404,7 +2437,7 @@ | 2404 | 2437 | }
| 2405 | 2438 | }
| 2406 | 2439 |
| 2407 | | - bool AdapatSameProcess = false;
| | 2440 | + bool DoSameProcess = false;
| 2408 | 2441 | const bool isSSH = (cv.isSSH == 2);
| 2409 | 2442 | enum drop_type DropType;
| 2410 | 2443 | unsigned char DropTypePaste = DROP_TYPE_PASTE_ESCAPE;
|
| | @@ -2418,17 +2451,17 @@ | 2418 | 2451 | } else {
| 2419 | 2452 | DropType = DROP_TYPE_SEND_FILE;
| 2420 | 2453 | }
| 2421 | | - AdapatSameProcess = false;
| | 2454 | + DoSameProcess = false;
| 2422 | 2455 | } else {
| 2423 | 2456 | DropType = DROP_TYPE_SEND_FILE;
| 2424 | | - AdapatSameProcess = DefaultShowDialog ? false : true;
| | 2457 | + DoSameProcess = DefaultShowDialog ? false : true;
| 2425 | 2458 | }
| 2426 | 2459 | } else if (FileCount == 0 && DirectoryCount == 1) {
| 2427 | 2460 | DropType = DROP_TYPE_PASTE_FILENAME;
| 2428 | | - AdapatSameProcess = DefaultShowDialog ? false : true;
| | 2461 | + DoSameProcess = DefaultShowDialog ? false : true;
| 2429 | 2462 | } else if (FileCount > 0 && DirectoryCount > 0) {
| 2430 | 2463 | DropType = DROP_TYPE_PASTE_FILENAME;
| 2431 | | - AdapatSameProcess = false;
| | 2464 | + DoSameProcess = false;
| 2432 | 2465 | } else if (FileCount > 0 && DirectoryCount == 0) {
| 2433 | 2466 | // filename only
| 2434 | 2467 | if (isSSH) {
|
| | @@ -2436,11 +2469,11 @@ | 2436 | 2469 | } else {
| 2437 | 2470 | DropType = DROP_TYPE_SEND_FILE;
| 2438 | 2471 | }
| 2439 | | - AdapatSameProcess = false;
| | 2472 | + DoSameProcess = false;
| 2440 | 2473 | } else {
| 2441 | 2474 | // directory only
| 2442 | 2475 | DropType = DROP_TYPE_PASTE_FILENAME;
| 2443 | | - AdapatSameProcess = ts.ConfirmFileDragAndDrop ? false : true;
| | 2476 | + DoSameProcess = ts.ConfirmFileDragAndDrop ? false : true;
| 2444 | 2477 | }
| 2445 | 2478 | } else {
| 2446 | 2479 | // show dialog
|
| | @@ -2453,7 +2486,7 @@ | 2453 | 2486 | DropType = DROP_TYPE_SEND_FILE;
| 2454 | 2487 | }
| 2455 | 2488 | }
| 2456 | | - AdapatSameProcess = false;
| | 2489 | + DoSameProcess = false;
| 2457 | 2490 | }
| 2458 | 2491 | } else {
| 2459 | 2492 | if (DirectoryCount > 0 &&
|
| | @@ -2463,11 +2496,11 @@ | 2463 | 2496 | { // デフォルトのままでは処理できない組み合わせ
| 2464 | 2497 | DropType = DROP_TYPE_PASTE_FILENAME;
| 2465 | 2498 | DropTypePaste = DefaultDropTypePaste;
| 2466 | | - AdapatSameProcess = false;
| | 2499 | + DoSameProcess = false;
| 2467 | 2500 | } else {
| 2468 | 2501 | DropType = DefaultDropType;
| 2469 | 2502 | DropTypePaste = DefaultDropTypePaste;
| 2470 | | - AdapatSameProcess = (ShowDialog || DefaultShowDialog) ? false : true;
| | 2503 | + DoSameProcess = (ShowDialog || DefaultShowDialog) ? false : true;
| 2471 | 2504 | }
| 2472 | 2505 | }
| 2473 | 2506 |
|
| | @@ -2474,8 +2507,8 @@ | 2474 | 2507 | for (int i = 0; i < DropListCount; i++) {
| 2475 | 2508 | const char *FileName = DropLists[i];
| 2476 | 2509 |
| 2477 | | - if (!AdapatSameProcess) {
| 2478 | | - bool DoSameProcess;
| | 2510 | + if (!DoSameProcess) {
| | 2511 | + bool DoSameProcessNextDrop;
| 2479 | 2512 | bool DoNotShowDialog = !DefaultShowDialog;
| 2480 | 2513 | DropType =
| 2481 | 2514 | ShowDropDialogBox(hInst, HVTWin,
|
| | @@ -2485,13 +2518,13 @@ | 2485 | 2518 | DirectoryCount == 0 ? true : false,
| 2486 | 2519 | ts.ConfirmFileDragAndDrop ? false : true,
| 2487 | 2520 | &DropTypePaste,
| 2488 | | - &AdapatSameProcess,
| 2489 | 2521 | &DoSameProcess,
| | 2522 | + &DoSameProcessNextDrop,
| 2490 | 2523 | &DoNotShowDialog);
| 2491 | 2524 | if (DropType == DROP_TYPE_CANCEL) {
| 2492 | 2525 | goto finish;
| 2493 | 2526 | }
| 2494 | | - if (DoSameProcess) {
| | 2527 | + if (DoSameProcessNextDrop) {
| 2495 | 2528 | DefaultDropType = DropType;
| 2496 | 2529 | DefaultDropTypePaste = DropTypePaste;
| 2497 | 2530 | }
|
| | @@ -2543,7 +2576,7 @@ | 2543 | 2576 | {
| 2544 | 2577 | // send by scp
| 2545 | 2578 | char **FileNames = &DropLists[i];
| 2546 | | - int FileCount = AdapatSameProcess ? DropListCount - i : 1;
| | 2579 | + int FileCount = DoSameProcess ? DropListCount - i : 1;
| 2547 | 2580 | if (!SendScp(FileNames, FileCount, ts.ScpSendDir)) {
| 2548 | 2581 | goto finish;
| 2549 | 2582 | }
|
Show on old repository browser
|