OSDN Git Service

Change behavior of automatic IPv4/IPv6 selection.
[ffftp/ffftp.git] / filelist.c
index 1a6e3ff..b3e1da2 100644 (file)
@@ -147,6 +147,8 @@ static WNDPROC LocalProcPtr;
 static WNDPROC RemoteProcPtr;\r
 \r
 static HIMAGELIST ListImg = NULL;\r
 static WNDPROC RemoteProcPtr;\r
 \r
 static HIMAGELIST ListImg = NULL;\r
+// ファイルアイコン表示対応\r
+static HIMAGELIST ListImgFileIcon = NULL;\r
 \r
 static char FindStr[40+1] = { "*" };           /* 検索文字列 */\r
 static int IgnoreNew = NO;\r
 \r
 static char FindStr[40+1] = { "*" };           /* 検索文字列 */\r
 static int IgnoreNew = NO;\r
@@ -786,6 +788,9 @@ static LRESULT FileListCommonWndProc(HWND hWnd, UINT message, WPARAM wParam, LPA
                        return(CallWindowProc(ProcPtr, hWnd, message, wParam, lParam));\r
 \r
                case WM_DROPFILES :\r
                        return(CallWindowProc(ProcPtr, hWnd, message, wParam, lParam));\r
 \r
                case WM_DROPFILES :\r
+                       // 同時接続対応\r
+                       if(AskUserOpeDisabled() == YES)\r
+                               break;\r
                        // ドラッグ中は処理しない。ドラッグ後にWM_LBUTTONDOWNが飛んでくるため、そこで処理する。\r
                        if (Dragging == YES) \r
                                return (FALSE);\r
                        // ドラッグ中は処理しない。ドラッグ後にWM_LBUTTONDOWNが飛んでくるため、そこで処理する。\r
                        if (Dragging == YES) \r
                                return (FALSE);\r
@@ -793,7 +798,7 @@ static LRESULT FileListCommonWndProc(HWND hWnd, UINT message, WPARAM wParam, LPA
                        if(hWnd == hWndListRemote)\r
                        {\r
                                if(AskConnecting() == YES)\r
                        if(hWnd == hWndListRemote)\r
                        {\r
                                if(AskConnecting() == YES)\r
-                                       UpLoadDragProc(wParam);\r
+                                       UploadDragProc(wParam);\r
                        }\r
                        else if(hWnd == hWndListLocal)\r
                        {\r
                        }\r
                        else if(hWnd == hWndListLocal)\r
                        {\r
@@ -818,6 +823,9 @@ static LRESULT FileListCommonWndProc(HWND hWnd, UINT message, WPARAM wParam, LPA
                                hCsrDrg = LoadCursor(NULL, IDC_ARROW);\r
                                SetCursor(hCsrDrg);\r
 \r
                                hCsrDrg = LoadCursor(NULL, IDC_ARROW);\r
                                SetCursor(hCsrDrg);\r
 \r
+                               // 同時接続対応\r
+                               if(AskUserOpeDisabled() == YES)\r
+                                       break;\r
                                Point.x = (long)(short)LOWORD(lParam);\r
                                Point.y = (long)(short)HIWORD(lParam);\r
                                ClientToScreen(hWnd, &Point);\r
                                Point.x = (long)(short)LOWORD(lParam);\r
                                Point.y = (long)(short)HIWORD(lParam);\r
                                ClientToScreen(hWnd, &Point);\r
@@ -1334,22 +1342,22 @@ void RefreshIconImageList(FLISTANCHOR *Anchor)
        int i;\r
        char Cur[FMAX_PATH+1];\r
        SHFILEINFO FileInfo;\r
        int i;\r
        char Cur[FMAX_PATH+1];\r
        SHFILEINFO FileInfo;\r
-       SendMessage(hWndListLocal, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)NULL);\r
-       ShowWindow(hWndListLocal, SW_SHOW);\r
-       SendMessage(hWndListRemote, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)NULL);\r
-       ShowWindow(hWndListRemote, SW_SHOW);\r
-       ImageList_Destroy(ListImg);\r
-       ListImg = ImageList_Create(16, 16, ILC_MASK | ILC_COLOR24, 0, 1);\r
-       hBitmap = LoadBitmap(GetFtpInst(), MAKEINTRESOURCE(dirattr_bmp));\r
-       ImageList_AddMasked(ListImg, hBitmap, RGB(255,0,0));\r
-       DeleteObject(hBitmap);\r
-       ImageId = 0;\r
-       Pos = Anchor->Top;\r
-       for(i = 0; i < Anchor->Files; i++)\r
+       if(AskDispFileIcon() == YES)\r
        {\r
        {\r
-               Pos->ImageId = -1;\r
-               if(AskDispFileIcon() == YES)\r
+               SendMessage(hWndListLocal, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)NULL);\r
+               ShowWindow(hWndListLocal, SW_SHOW);\r
+               SendMessage(hWndListRemote, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)NULL);\r
+               ShowWindow(hWndListRemote, SW_SHOW);\r
+               ImageList_Destroy(ListImgFileIcon);\r
+               ListImgFileIcon = ImageList_Create(16, 16, ILC_MASK | ILC_COLOR32, 0, 1);\r
+               hBitmap = LoadBitmap(GetFtpInst(), MAKEINTRESOURCE(dirattr16_bmp));\r
+               ImageList_AddMasked(ListImgFileIcon, hBitmap, RGB(255, 0, 0));\r
+               DeleteObject(hBitmap);\r
+               ImageId = 0;\r
+               Pos = Anchor->Top;\r
+               for(i = 0; i < Anchor->Files; i++)\r
                {\r
                {\r
+                       Pos->ImageId = -1;\r
                        if(Pos->Node == NODE_DRIVE)\r
                                strcpy(Cur, Pos->File);\r
                        else\r
                        if(Pos->Node == NODE_DRIVE)\r
                                strcpy(Cur, Pos->File);\r
                        else\r
@@ -1360,20 +1368,27 @@ void RefreshIconImageList(FLISTANCHOR *Anchor)
                        }\r
                        if(SHGetFileInfoM(Cur, 0, &FileInfo, sizeof(SHFILEINFO), SHGFI_SMALLICON | SHGFI_ICON) != 0)\r
                        {\r
                        }\r
                        if(SHGetFileInfoM(Cur, 0, &FileInfo, sizeof(SHFILEINFO), SHGFI_SMALLICON | SHGFI_ICON) != 0)\r
                        {\r
-                               if(ImageList_AddIcon(ListImg, FileInfo.hIcon) >= 0)\r
+                               if(ImageList_AddIcon(ListImgFileIcon, FileInfo.hIcon) >= 0)\r
                                {\r
                                        Pos->ImageId = ImageId;\r
                                        ImageId++;\r
                                }\r
                                DestroyIcon(FileInfo.hIcon);\r
                        }\r
                                {\r
                                        Pos->ImageId = ImageId;\r
                                        ImageId++;\r
                                }\r
                                DestroyIcon(FileInfo.hIcon);\r
                        }\r
+                       Pos = Pos->Next;\r
                }\r
                }\r
-               Pos = Pos->Next;\r
+               SendMessage(hWndListLocal, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)ListImgFileIcon);\r
+               ShowWindow(hWndListLocal, SW_SHOW);\r
+               SendMessage(hWndListRemote, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)ListImgFileIcon);\r
+               ShowWindow(hWndListRemote, SW_SHOW);\r
+       }\r
+       else\r
+       {\r
+               SendMessage(hWndListLocal, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)ListImg);\r
+               ShowWindow(hWndListLocal, SW_SHOW);\r
+               SendMessage(hWndListRemote, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)ListImg);\r
+               ShowWindow(hWndListRemote, SW_SHOW);\r
        }\r
        }\r
-       SendMessage(hWndListLocal, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)ListImg);\r
-       ShowWindow(hWndListLocal, SW_SHOW);\r
-       SendMessage(hWndListRemote, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)ListImg);\r
-       ShowWindow(hWndListRemote, SW_SHOW);\r
 }\r
 \r
 void GetLocalDirForWnd(void)\r
 }\r
 \r
 void GetLocalDirForWnd(void)\r
@@ -1428,7 +1443,7 @@ void GetLocalDirForWnd(void)
        if(DispDrives)\r
        {\r
                GetLogicalDriveStrings(FMAX_PATH, Scan);\r
        if(DispDrives)\r
        {\r
                GetLogicalDriveStrings(FMAX_PATH, Scan);\r
-               NoDrives = LoadHideDriveListRegistory();\r
+               NoDrives = LoadHideDriveListRegistry();\r
 \r
                Pos = Scan;\r
                while(*Pos != NUL)\r
 \r
                Pos = Scan;\r
                while(*Pos != NUL)\r
@@ -1689,8 +1704,8 @@ static void AddListView(HWND hWnd, int Pos, char *Name, int Type, LONGLONG Size,
        else\r
                LvItem.iImage = 4;\r
        // ファイルアイコン表示対応\r
        else\r
                LvItem.iImage = 4;\r
        // ファイルアイコン表示対応\r
-       if(hWnd == GetLocalHwnd() && ImageId >= 0)\r
-               LvItem.iImage = 5 + ImageId;\r
+       if(AskDispFileIcon() == YES && hWnd == GetLocalHwnd())\r
+               LvItem.iImage = ImageId + 5;\r
        LvItem.iItem = SendMessage(hWnd, LVM_INSERTITEM, 0, (LPARAM)&LvItem);\r
 \r
        /* 日付/時刻 */\r
        LvItem.iItem = SendMessage(hWnd, LVM_INSERTITEM, 0, (LPARAM)&LvItem);\r
 \r
        /* 日付/時刻 */\r
@@ -1977,7 +1992,7 @@ void FindFileInList(HWND hWnd, int Type)
        static char RegExp[FMAX_PATH+1] = { "" };\r
        char Name[FMAX_PATH+1];\r
        LV_ITEM LvItem;\r
        static char RegExp[FMAX_PATH+1] = { "" };\r
        char Name[FMAX_PATH+1];\r
        LV_ITEM LvItem;\r
-       const char *Title;\r
+       char *Title;\r
 \r
        Win = WIN_LOCAL;\r
        Title = MSGJPN050;\r
 \r
        Win = WIN_LOCAL;\r
        Title = MSGJPN050;\r
@@ -4905,6 +4920,7 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                                                        sTime.wSecond = atoi_n(Value + 12, 2);\r
                                                        sTime.wMilliseconds = 0;\r
                                                        SystemTimeToFileTime(&sTime, Time);\r
                                                        sTime.wSecond = atoi_n(Value + 12, 2);\r
                                                        sTime.wMilliseconds = 0;\r
                                                        SystemTimeToFileTime(&sTime, Time);\r
+                                                       // 時刻はGMT\r
 //                                                     SpecificLocalFileTime2FileTime(Time, AskHostTimeZone());\r
                                                        *InfoExist |= FINFO_DATE | FINFO_TIME;\r
                                                }\r
 //                                                     SpecificLocalFileTime2FileTime(Time, AskHostTimeZone());\r
                                                        *InfoExist |= FINFO_DATE | FINFO_TIME;\r
                                                }\r