OSDN Git Service

Change behavior of automatic IPv4/IPv6 selection.
[ffftp/ffftp.git] / hostman.c
index c6c4ecc..4fcdd9e 100644 (file)
--- a/hostman.c
+++ b/hostman.c
@@ -127,7 +127,7 @@ int SelectHost(int Type)
 \r
        /* ホスト設定を保存 */\r
        SetNodeLevelAll();\r
-       SaveRegistory();\r
+       SaveRegistry();\r
 \r
        return(Sts);\r
 }\r
@@ -319,8 +319,11 @@ static INT_PTR CALLBACK SelectHostProc(HWND hDlg, UINT message, WPARAM wParam, L
                                                CurrentHost = Item.lParam;\r
                                                Level1 = IsNodeGroup(CurrentHost);\r
 \r
-                                               if(((Level1 == YES) && (DialogBox(GetFtpInst(), MAKEINTRESOURCE(groupdel_dlg), GetMainHwnd(), ExeEscDialogProc) == YES)) ||\r
-                                                  ((Level1 == NO) && (DialogBox(GetFtpInst(), MAKEINTRESOURCE(hostdel_dlg), GetMainHwnd(), ExeEscDialogProc) == YES)))\r
+                                               // バグ修正\r
+//                                             if(((Level1 == YES) && (DialogBox(GetFtpInst(), MAKEINTRESOURCE(groupdel_dlg), GetMainHwnd(), ExeEscDialogProc) == YES)) ||\r
+//                                                ((Level1 == NO) && (DialogBox(GetFtpInst(), MAKEINTRESOURCE(hostdel_dlg), GetMainHwnd(), ExeEscDialogProc) == YES)))\r
+                                               if(((Level1 == YES) && (DialogBox(GetFtpInst(), MAKEINTRESOURCE(groupdel_dlg), hDlg, ExeEscDialogProc) == YES)) ||\r
+                                                  ((Level1 == NO) && (DialogBox(GetFtpInst(), MAKEINTRESOURCE(hostdel_dlg), hDlg, ExeEscDialogProc) == YES)))\r
                                                {\r
                                                        DelHostFromList(CurrentHost);\r
                                                        if(CurrentHost >= Hosts)\r
@@ -1344,7 +1347,8 @@ void CopyDefaultHost(HOSTDATA *Set)
        strcpy(Set->PrivateKey, "");\r
        // 同時接続対応\r
        Set->MaxThreadCount = 1;\r
-       Set->ReuseCmdSkt = NO;\r
+       Set->ReuseCmdSkt = YES;\r
+       Set->NoDisplayUI = NO;\r
        // MLSD対応\r
        Set->Feature = 0;\r
        Set->UseMLSD = YES;\r
@@ -2129,8 +2133,15 @@ static INT_PTR CALLBACK Adv2SettingProc(HWND hDlg, UINT iMessage, WPARAM wParam,
                        SendDlgItemMessage(hDlg, HSET_HOSTTYPE, CB_ADDSTRING, 0, (LPARAM)MSGJPN144);\r
                        SendDlgItemMessage(hDlg, HSET_HOSTTYPE, CB_ADDSTRING, 0, (LPARAM)MSGJPN289);\r
                        SendDlgItemMessage(hDlg, HSET_HOSTTYPE, CB_ADDSTRING, 0, (LPARAM)MSGJPN295);\r
+#if defined(HAVE_TANDEM)\r
+                       SendDlgItemMessage(hDlg, HSET_HOSTTYPE, CB_ADDSTRING, 0, (LPARAM)MSGJPN2000);\r
+#endif\r
                        SendDlgItemMessage(hDlg, HSET_HOSTTYPE, CB_SETCURSEL, TmpHost.HostType, 0);\r
+#if defined(HAVE_TANDEM)\r
+                       if(TmpHost.HostType == 2 || TmpHost.HostType == HTYPE_TANDEM)  /* VAX or Tandem */\r
+#else\r
                        if(TmpHost.HostType == 2)\r
+#endif\r
                        {\r
                                EnableWindow(GetDlgItem(hDlg, HSET_NLST_R), FALSE);\r
                                EnableWindow(GetDlgItem(hDlg, HSET_LISTCMD), FALSE);\r
@@ -2199,12 +2210,34 @@ static INT_PTR CALLBACK Adv2SettingProc(HWND hDlg, UINT iMessage, WPARAM wParam,
                                                EnableWindow(GetDlgItem(hDlg, HSET_LISTCMD), FALSE);\r
                                                EnableWindow(GetDlgItem(hDlg, HSET_FULLPATH), FALSE);\r
                                        }\r
+#if defined(HAVE_TANDEM)\r
+                                       else if(Num == HTYPE_TANDEM) /* Tandem */\r
+                                       {\r
+                                               /* Tandem を選択すると自動的に LIST にチェックをいれる */\r
+                                               SendDlgItemMessage(hDlg, HSET_LISTCMD, BM_SETCHECK, 1, 0);\r
+                                               EnableWindow(GetDlgItem(hDlg, HSET_NLST_R), FALSE);\r
+                                               EnableWindow(GetDlgItem(hDlg, HSET_LISTCMD), FALSE);\r
+                                               EnableWindow(GetDlgItem(hDlg, HSET_FULLPATH), FALSE);\r
+                                       }\r
+                                       else\r
+                                       {\r
+                                               if(SendDlgItemMessage(hDlg, HSET_LISTCMD, BM_GETCHECK, 0, 0) == 0) {\r
+                                                       EnableWindow(GetDlgItem(hDlg, HSET_NLST_R), TRUE);\r
+                                                       EnableWindow(GetDlgItem(hDlg, HSET_LISTCMD), TRUE);\r
+                                               } else {\r
+                                                       EnableWindow(GetDlgItem(hDlg, HSET_NLST_R), FALSE);\r
+                                                       EnableWindow(GetDlgItem(hDlg, HSET_LISTCMD), TRUE);\r
+                                               }\r
+                                               EnableWindow(GetDlgItem(hDlg, HSET_FULLPATH), TRUE);\r
+                                       }\r
+#else\r
                                        else\r
                                        {\r
                                                EnableWindow(GetDlgItem(hDlg, HSET_NLST_R), TRUE);\r
                                                EnableWindow(GetDlgItem(hDlg, HSET_LISTCMD), TRUE);\r
                                                EnableWindow(GetDlgItem(hDlg, HSET_FULLPATH), TRUE);\r
                                        }\r
+#endif\r
                                        break;\r
                        }\r
                        return(TRUE);\r
@@ -2235,13 +2268,18 @@ static INT_PTR CALLBACK CryptSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam
                                SendDlgItemMessage(hDlg, HSET_FTPIS, BM_SETCHECK, BST_UNCHECKED, 0);\r
                                EnableWindow(GetDlgItem(hDlg, HSET_FTPIS), FALSE);\r
                        }\r
-                       SendDlgItemMessage(hDlg, HSET_SFTP, BM_SETCHECK, TmpHost.UseSFTP, 0);\r
-                       SendDlgItemMessage(hDlg, HSET_PRIVATE_KEY, WM_SETTEXT, 0, (LPARAM)TmpHost.PrivateKey);\r
-                       // TODO: SFTP対応\r
-                       SendDlgItemMessage(hDlg, HSET_SFTP, BM_SETCHECK, BST_UNCHECKED, 0);\r
-                       EnableWindow(GetDlgItem(hDlg, HSET_SFTP), FALSE);\r
-                       EnableWindow(GetDlgItem(hDlg, PKEY_FILE_BR), FALSE);\r
-                       EnableWindow(GetDlgItem(hDlg, HSET_PRIVATE_KEY), FALSE);\r
+                       if(IsPuTTYLoaded())\r
+                       {\r
+                               SendDlgItemMessage(hDlg, HSET_SFTP, BM_SETCHECK, TmpHost.UseSFTP, 0);\r
+                               SendDlgItemMessage(hDlg, HSET_PRIVATE_KEY, WM_SETTEXT, 0, (LPARAM)TmpHost.PrivateKey);\r
+                       }\r
+                       else\r
+                       {\r
+                               SendDlgItemMessage(hDlg, HSET_SFTP, BM_SETCHECK, BST_UNCHECKED, 0);\r
+                               EnableWindow(GetDlgItem(hDlg, HSET_SFTP), FALSE);\r
+                               EnableWindow(GetDlgItem(hDlg, PKEY_FILE_BR), FALSE);\r
+                               EnableWindow(GetDlgItem(hDlg, HSET_PRIVATE_KEY), FALSE);\r
+                       }\r
                        return(TRUE);\r
 \r
                case WM_NOTIFY:\r
@@ -2255,9 +2293,11 @@ static INT_PTR CALLBACK CryptSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam
                                                TmpHost.UseFTPES = SendDlgItemMessage(hDlg, HSET_FTPES, BM_GETCHECK, 0, 0);\r
                                                TmpHost.UseFTPIS = SendDlgItemMessage(hDlg, HSET_FTPIS, BM_GETCHECK, 0, 0);\r
                                        }\r
-                                       // TODO: SFTP対応\r
-//                                     TmpHost.UseSFTP = SendDlgItemMessage(hDlg, HSET_SFTP, BM_GETCHECK, 0, 0);\r
-                                       SendDlgItemMessage(hDlg, HSET_PRIVATE_KEY, WM_GETTEXT, PRIVATE_KEY_LEN+1, (LPARAM)TmpHost.PrivateKey);\r
+                                       if(IsPuTTYLoaded())\r
+                                       {\r
+                                               TmpHost.UseSFTP = SendDlgItemMessage(hDlg, HSET_SFTP, BM_GETCHECK, 0, 0);\r
+                                               SendDlgItemMessage(hDlg, HSET_PRIVATE_KEY, WM_GETTEXT, PRIVATE_KEY_LEN+1, (LPARAM)TmpHost.PrivateKey);\r
+                                       }\r
                                        Apply = YES;\r
                                        break;\r
 \r