OSDN Git Service

Fix copyrights.
[ffftp/ffftp.git] / hostman.c
index fdecf28..96b1099 100644 (file)
--- a/hostman.c
+++ b/hostman.c
@@ -151,7 +151,9 @@ static BOOL CALLBACK SelectHostProc(HWND hDlg, UINT message, WPARAM wParam, LPAR
        int Level2;\r
        HOSTLISTDATA *Data1;\r
        HOSTLISTDATA *Data2;\r
-       NM_TREEVIEW *tView;\r
+       // UTF-8対応\r
+//     NM_TREEVIEW *tView;\r
+       NM_TREEVIEWW *tView;\r
        HTREEITEM tViewPos;\r
        TV_HITTESTINFO HitInfo;\r
 \r
@@ -550,7 +552,9 @@ static BOOL CALLBACK SelectHostProc(HWND hDlg, UINT message, WPARAM wParam, LPAR
                        break;\r
 \r
                case WM_NOTIFY:\r
-                       tView = (NM_TREEVIEW FAR *)lParam;\r
+                       // UTF-8対応\r
+//                     tView = (NM_TREEVIEW FAR *)lParam;\r
+                       tView = (NM_TREEVIEWW FAR *)lParam;\r
                        switch(tView->hdr.idFrom)\r
                        {\r
                                case HOST_LIST :\r
@@ -558,7 +562,9 @@ static BOOL CALLBACK SelectHostProc(HWND hDlg, UINT message, WPARAM wParam, LPAR
                                        hItem = tView->itemNew.hItem;\r
                                        switch(tView->hdr.code)\r
                                        {\r
-                                               case TVN_SELCHANGED :\r
+                                               // UTF-8対応\r
+//                                             case TVN_SELCHANGED :\r
+                                               case TVN_SELCHANGEDW :\r
                                                        /* フォルダが選ばれたときは接続、コピーボタンは禁止 */\r
                                                        Item.hItem = hItem;\r
                                                        Item.mask = TVIF_PARAM;\r
@@ -1024,6 +1030,7 @@ int CopyHostFromListInConnect(int Num, HOSTDATA *Set)
                Set->LastDir = Pos->Set.LastDir;\r
                Set->TimeZone = Pos->Set.TimeZone;\r
                // 暗号化通信対応\r
+               Set->UseNoEncryption = Pos->Set.UseNoEncryption;\r
                Set->UseFTPES = Pos->Set.UseFTPES;\r
                Set->UseFTPIS = Pos->Set.UseFTPIS;\r
                Set->UseSFTP = Pos->Set.UseSFTP;\r
@@ -1031,6 +1038,8 @@ int CopyHostFromListInConnect(int Num, HOSTDATA *Set)
                Set->MaxThreadCount = Pos->Set.MaxThreadCount;\r
                // MLSD対応\r
                Set->UseMLSD = Pos->Set.UseMLSD;\r
+               // IPv6対応\r
+               Set->UseIPv6 = Pos->Set.UseIPv6;\r
                Sts = FFFTP_SUCCESS;\r
        }\r
        return(Sts);\r
@@ -1306,14 +1315,18 @@ void CopyDefaultHost(HOSTDATA *Set)
        strcpy(Set->DialEntry, "");\r
        // 暗号化通信対応\r
        Set->CryptMode = CRYPT_NONE;\r
+       Set->UseNoEncryption = YES;\r
        Set->UseFTPES = YES;\r
        Set->UseFTPIS = YES;\r
        Set->UseSFTP = YES;\r
+       strcpy(Set->PrivateKey, "");\r
        // 同時接続対応\r
        Set->MaxThreadCount = 1;\r
        // MLSD対応\r
        Set->Feature = 0;\r
        Set->UseMLSD = YES;\r
+       // IPv6対応\r
+       Set->UseIPv6 = YES;\r
        return;\r
 }\r
 \r
@@ -2130,16 +2143,16 @@ static BOOL CALLBACK Adv2SettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LP
 static BOOL CALLBACK CryptSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
 {\r
        NMHDR *pnmhdr;\r
-       int Num;\r
+//     int Num;\r
 \r
        switch (iMessage)\r
        {\r
                case WM_INITDIALOG :\r
+                       SendDlgItemMessage(hDlg, HSET_NO_ENCRYPTION, BM_SETCHECK, TmpHost.UseNoEncryption, 0);\r
                        if(IsOpenSSLLoaded())\r
                        {\r
                                SendDlgItemMessage(hDlg, HSET_FTPES, BM_SETCHECK, TmpHost.UseFTPES, 0);\r
                                SendDlgItemMessage(hDlg, HSET_FTPIS, BM_SETCHECK, TmpHost.UseFTPIS, 0);\r
-                               SendDlgItemMessage(hDlg, HSET_SFTP, BM_SETCHECK, TmpHost.UseSFTP, 0);\r
                        }\r
                        else\r
                        {\r
@@ -2147,12 +2160,9 @@ static BOOL CALLBACK CryptSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, L
                                EnableWindow(GetDlgItem(hDlg, HSET_FTPES), FALSE);\r
                                SendDlgItemMessage(hDlg, HSET_FTPIS, BM_SETCHECK, BST_UNCHECKED, 0);\r
                                EnableWindow(GetDlgItem(hDlg, HSET_FTPIS), FALSE);\r
-                               SendDlgItemMessage(hDlg, HSET_SFTP, BM_SETCHECK, BST_UNCHECKED, 0);\r
-                               EnableWindow(GetDlgItem(hDlg, HSET_SFTP), FALSE);\r
                        }\r
-                       // TODO: FTPIS対応\r
-                       SendDlgItemMessage(hDlg, HSET_FTPIS, BM_SETCHECK, BST_UNCHECKED, 0);\r
-                       EnableWindow(GetDlgItem(hDlg, HSET_FTPIS), FALSE);\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
@@ -2163,14 +2173,15 @@ static BOOL CALLBACK CryptSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, L
                        switch(pnmhdr->code)\r
                        {\r
                                case PSN_APPLY :\r
+                                       TmpHost.UseNoEncryption = SendDlgItemMessage(hDlg, HSET_NO_ENCRYPTION, BM_GETCHECK, 0, 0);\r
                                        if(IsOpenSSLLoaded())\r
                                        {\r
                                                TmpHost.UseFTPES = SendDlgItemMessage(hDlg, HSET_FTPES, BM_GETCHECK, 0, 0);\r
-                                               // TODO: FTPIS対応\r
-//                                             TmpHost.UseFTPIS = SendDlgItemMessage(hDlg, HSET_FTPIS, BM_GETCHECK, 0, 0);\r
-                                               // TODO: SFTP対応\r
-//                                             TmpHost.UseSFTP = SendDlgItemMessage(hDlg, HSET_SFTP, 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
                                        Apply = YES;\r
                                        break;\r
 \r
@@ -2190,7 +2201,7 @@ static BOOL CALLBACK CryptSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, L
 static BOOL CALLBACK Adv3SettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
 {\r
        NMHDR *pnmhdr;\r
-       int Num;\r
+//     int Num;\r
 \r
        switch (iMessage)\r
        {\r