From 3fa7cc252d24ea09fe8915d36409fc3ed5ad5b84 Mon Sep 17 00:00:00 2001 From: Martin Fuchs Date: Sun, 19 Feb 2006 22:20:41 +0000 Subject: [PATCH] winefile: merge changes from audited repository ------------------------------------------------------------------------ r108 | martinf | 2006-02-12 17:59:54 +0100 (So, 12 Feb 2006) | 1 line winefile: don't compile Wine specific functions ------------------------------------------------------------------------ r84 | martinf | 2006-02-04 11:04:41 +0100 (Sa, 04 Feb 2006) | 8 lines winefile-Sync to Wine: Aric Stewart winefile: Highlight the file specified on the command line instead of filtering based on it. To be integrated with explorer to allow for that functionality. Mike McCormack winefile: Move the license and warranty text into the resources. ------------------------------------------------------------------------ r82 | martinf | 2006-02-04 10:02:15 +0100 (Sa, 04 Feb 2006) | 1 line winefile: set output directory ------------------------------------------------------------------------ r72 | martinf | 2006-02-02 21:20:51 +0100 (Do, 02 Feb 2006) | 1 line convert *.rbuild files into valid XML files by inserting XML headers and a root nodes ------------------------------------------------------------------------ r59 | martinf | 2006-01-30 23:41:28 +0100 (Mo, 30 Jan 2006) | 1 line set properties and ros:history and ros:doc ------------------------------------------------------------------------ r37 | martinf | 2006-01-29 20:03:05 +0100 (So, 29 Jan 2006) | 1 line set svn:eolstyle in *.rbuild files ------------------------------------------------------------------------ r31 | martinf | 2006-01-29 16:10:34 +0100 (So, 29 Jan 2006) | 2 lines import Winefile into the new repository (now including a VC8 project file) ------------------------------------------------------------------------ svn path=/trunk/; revision=21169 --- .../{Makefile.MinGW => Makefile-MinGW} | 0 reactos/base/applications/winefile/en.rc | 24 + reactos/base/applications/winefile/license.c | 56 - .../applications/winefile/make_winefile.dsp | 8 +- .../winefile/make_winefile.vcproj | 77 ++ reactos/base/applications/winefile/resource.h | 5 + reactos/base/applications/winefile/winefile.c | 64 +- .../base/applications/winefile/winefile.dsp | 9 +- reactos/base/applications/winefile/winefile.h | 4 - .../base/applications/winefile/winefile.sln | 34 + .../applications/winefile/winefile.vcproj | 1220 +++++++++++++++++ 11 files changed, 1423 insertions(+), 78 deletions(-) rename reactos/base/applications/winefile/{Makefile.MinGW => Makefile-MinGW} (100%) delete mode 100644 reactos/base/applications/winefile/license.c create mode 100644 reactos/base/applications/winefile/make_winefile.vcproj create mode 100644 reactos/base/applications/winefile/winefile.sln create mode 100644 reactos/base/applications/winefile/winefile.vcproj diff --git a/reactos/base/applications/winefile/Makefile.MinGW b/reactos/base/applications/winefile/Makefile-MinGW similarity index 100% rename from reactos/base/applications/winefile/Makefile.MinGW rename to reactos/base/applications/winefile/Makefile-MinGW diff --git a/reactos/base/applications/winefile/en.rc b/reactos/base/applications/winefile/en.rc index 5e613c67189..cf068afccb6 100644 --- a/reactos/base/applications/winefile/en.rc +++ b/reactos/base/applications/winefile/en.rc @@ -264,3 +264,27 @@ STRINGTABLE IDS_FREE_SPACE_FMT "%s of %s free" } + +STRINGTABLE +{ +IDS_LICENSE_CAPTION, "LICENSE" +IDS_LICENSE, +"This library is free software; you can redistribute it and/or \ +modify it under the terms of the GNU Lesser General Public \ +License as published by the Free Software Foundation; either \ +version 2.1 of the License, or (at your option) any later version.\n\ +This library is distributed in the hope that it will be useful, \ +but WITHOUT ANY WARRANTY; without even the implied warranty of \ +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU \ +Lesser General Public License for more details.\n\ +You should have received a copy of the GNU Lesser General Public \ +License along with this library; if not, write to the Free Software \ +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA" + +IDS_WARRANTY_CAPTION, "NO WARRANTY" +IDS_WARRANTY, +"This library is distributed in the hope that it will be useful, \ +but WITHOUT ANY WARRANTY; without even the implied warranty of \ +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU \ +Lesser General Public License for more details." +} diff --git a/reactos/base/applications/winefile/license.c b/reactos/base/applications/winefile/license.c deleted file mode 100644 index 12193f8d2ed..00000000000 --- a/reactos/base/applications/winefile/license.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2000 Martin Fuchs - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -#include "winefile.h" - -#ifdef __WINE__ - -static const CHAR LicenseCaption[] = "LICENSE"; -static const CHAR License[] = -"This library is free software; you can redistribute it and/or " -"modify it under the terms of the GNU Lesser General Public " -"License as published by the Free Software Foundation; either " -"version 2.1 of the License, or (at your option) any later version.\n" - -"This library is distributed in the hope that it will be useful, " -"but WITHOUT ANY WARRANTY; without even the implied warranty of " -"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU " -"Lesser General Public License for more details.\n" - -"You should have received a copy of the GNU Lesser General Public " -"License along with this library; if not, write to the Free Software " -"Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA"; - -static const CHAR NoWarrantyCaption[] = "NO WARRANTY"; -static const CHAR NoWarranty[] = -"This library is distributed in the hope that it will be useful, " -"but WITHOUT ANY WARRANTY; without even the implied warranty of " -"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU " -"Lesser General Public License for more details."; - -VOID WineLicense(HWND hwnd) -{ - MessageBoxA(hwnd, License, LicenseCaption, MB_ICONINFORMATION|MB_OK); -} - -VOID WineWarranty(HWND hwnd) -{ - MessageBoxA(hwnd, NoWarranty, NoWarrantyCaption, MB_ICONEXCLAMATION|MB_OK); -} - -#endif diff --git a/reactos/base/applications/winefile/make_winefile.dsp b/reactos/base/applications/winefile/make_winefile.dsp index bf578679c90..5e02d59c966 100644 --- a/reactos/base/applications/winefile/make_winefile.dsp +++ b/reactos/base/applications/winefile/make_winefile.dsp @@ -41,7 +41,7 @@ CFG=make_winefile - Win32 Debug # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" -# PROP Cmd_Line "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Makefile.MinGW" +# PROP Cmd_Line "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Makefile-MinGW" # PROP Rebuild_Opt "clean all" # PROP Target_File "winefile.exe" # PROP Bsc_Name "" @@ -62,7 +62,7 @@ CFG=make_winefile - Win32 Debug # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" -# PROP Cmd_Line "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Makefile.MinGW DEBUG=1" +# PROP Cmd_Line "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Makefile-MinGW DEBUG=1" # PROP Rebuild_Opt "clean all" # PROP Target_File "winefile.exe" # PROP Bsc_Name "" @@ -83,11 +83,11 @@ CFG=make_winefile - Win32 Debug # Begin Source File -SOURCE=.\Makefile.MinGW +SOURCE=".\Makefile-MinGW" # End Source File # Begin Source File -SOURCE=.\winefile.xml +SOURCE=.\winefile.rbuild # End Source File # End Target # End Project diff --git a/reactos/base/applications/winefile/make_winefile.vcproj b/reactos/base/applications/winefile/make_winefile.vcproj new file mode 100644 index 00000000000..aff966965c8 --- /dev/null +++ b/reactos/base/applications/winefile/make_winefile.vcproj @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/reactos/base/applications/winefile/resource.h b/reactos/base/applications/winefile/resource.h index cce4de3d500..9b3659387ac 100644 --- a/reactos/base/applications/winefile/resource.h +++ b/reactos/base/applications/winefile/resource.h @@ -135,6 +135,11 @@ #define IDS_COL_SEC 1218 #define IDS_FREE_SPACE_FMT 1219 +#define IDS_LICENSE_CAPTION 1300 +#define IDS_LICENSE 1301 +#define IDS_WARRANTY_CAPTION 1302 +#define IDS_WARRANTY 1303 + /* range for drive bar command ids: 0x9000..0x90FF */ diff --git a/reactos/base/applications/winefile/winefile.c b/reactos/base/applications/winefile/winefile.c index 395876b89ea..31c212ef499 100644 --- a/reactos/base/applications/winefile/winefile.c +++ b/reactos/base/applications/winefile/winefile.c @@ -239,6 +239,23 @@ static void display_network_error(HWND hwnd) } +static VOID WineLicense(HWND Wnd) +{ + TCHAR cap[20], text[1024]; + LoadString(Globals.hInstance, IDS_LICENSE, text, 1024); + LoadString(Globals.hInstance, IDS_LICENSE_CAPTION, cap, 20); + MessageBox(Wnd, text, cap, MB_ICONINFORMATION | MB_OK); +} + +static VOID WineWarranty(HWND Wnd) +{ + TCHAR cap[20], text[1024]; + LoadString(Globals.hInstance, IDS_WARRANTY, text, 1024); + LoadString(Globals.hInstance, IDS_WARRANTY_CAPTION, cap, 20); + MessageBox(Wnd, text, cap, MB_ICONEXCLAMATION | MB_OK); +} + + #ifdef __WINE__ #ifdef UNICODE @@ -1125,7 +1142,7 @@ static int TypeOrderFromDirname(LPCTSTR name) } /* directories first... */ -static int __cdecl compareType(const WIN32_FIND_DATA* fd1, const WIN32_FIND_DATA* fd2) +static int compareType(const WIN32_FIND_DATA* fd1, const WIN32_FIND_DATA* fd2) { int order1 = fd1->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY? TO_DIR: TO_FILE; int order2 = fd2->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY? TO_DIR: TO_FILE; @@ -1140,7 +1157,7 @@ static int __cdecl compareType(const WIN32_FIND_DATA* fd1, const WIN32_FIND_DATA } -static int __cdecl compareName(const void* arg1, const void* arg2) +static int compareName(const void* arg1, const void* arg2) { const WIN32_FIND_DATA* fd1 = &(*(const Entry* const*)arg1)->data; const WIN32_FIND_DATA* fd2 = &(*(const Entry* const*)arg2)->data; @@ -1152,7 +1169,7 @@ static int __cdecl compareName(const void* arg1, const void* arg2) return lstrcmpi(fd1->cFileName, fd2->cFileName); } -static int __cdecl compareExt(const void* arg1, const void* arg2) +static int compareExt(const void* arg1, const void* arg2) { const WIN32_FIND_DATA* fd1 = &(*(const Entry* const*)arg1)->data; const WIN32_FIND_DATA* fd2 = &(*(const Entry* const*)arg2)->data; @@ -1185,7 +1202,7 @@ static int __cdecl compareExt(const void* arg1, const void* arg2) return lstrcmpi(name1, name2); } -static int __cdecl compareSize(const void* arg1, const void* arg2) +static int compareSize(const void* arg1, const void* arg2) { const WIN32_FIND_DATA* fd1 = &(*(const Entry* const*)arg1)->data; const WIN32_FIND_DATA* fd2 = &(*(const Entry* const*)arg2)->data; @@ -1206,7 +1223,7 @@ static int __cdecl compareSize(const void* arg1, const void* arg2) return cmp<0? -1: cmp>0? 1: 0; } -static int __cdecl compareDate(const void* arg1, const void* arg2) +static int compareDate(const void* arg1, const void* arg2) { const WIN32_FIND_DATA* fd1 = &(*(const Entry* const*)arg1)->data; const WIN32_FIND_DATA* fd2 = &(*(const Entry* const*)arg2)->data; @@ -1219,7 +1236,7 @@ static int __cdecl compareDate(const void* arg1, const void* arg2) } -static int (__cdecl *sortFunctions[])(const void* arg1, const void* arg2) = { +static int (*sortFunctions[])(const void* arg1, const void* arg2) = { compareName, /* SORT_NAME */ compareExt, /* SORT_EXT */ compareSize, /* SORT_SIZE */ @@ -1403,6 +1420,7 @@ enum TYPE_FILTER { static ChildWnd* alloc_child_window(LPCTSTR path, LPITEMIDLIST pidl, HWND hwnd) { TCHAR drv[_MAX_DRIVE+1], dir[_MAX_DIR], name[_MAX_FNAME], ext[_MAX_EXT]; + TCHAR dir_path[MAX_PATH]; TCHAR b1[BUFFER_LEN]; const static TCHAR sAsterics[] = {'*', '\0'}; @@ -1447,7 +1465,9 @@ static ChildWnd* alloc_child_window(LPCTSTR path, LPITEMIDLIST pidl, HWND hwnd) root->entry.level = 0; - entry = read_tree(root, path, pidl, drv, child->sortOrder, hwnd); + lstrcpy(dir_path, drv); + lstrcat(dir_path, dir); + entry = read_tree(root, dir_path, pidl, drv, child->sortOrder, hwnd); #ifdef _SHELL_FOLDERS if (root->entry.etype == ET_SHELL) @@ -4779,6 +4799,36 @@ static void show_frame(HWND hwndParent, int cmdshow, LPCTSTR path) Globals.prescan_node = FALSE; UpdateWindow(Globals.hMainWnd); + + if (path && path[0]) + { + int index,count; + TCHAR drv[_MAX_DRIVE+1], dir[_MAX_DIR], name[_MAX_FNAME], ext[_MAX_EXT]; + TCHAR fullname[_MAX_FNAME+_MAX_EXT+1]; + + memset(name,0,sizeof(name)); + memset(name,0,sizeof(ext)); + _tsplitpath(path, drv, dir, name, ext); + if (name[0]) + { + count = ListBox_GetCount(child->right.hwnd); + lstrcpy(fullname,name); + lstrcat(fullname,ext); + + for (index = 0; index < count; index ++) + { + Entry* entry = (Entry*) ListBox_GetItemData(child->right.hwnd, + index); + if (lstrcmp(entry->data.cFileName,fullname)==0 || + lstrcmp(entry->data.cAlternateFileName,fullname)==0) + { + ListBox_SetCurSel(child->right.hwnd, index); + SetFocus(child->right.hwnd); + break; + } + } + } + } } static void ExitInstance(void) diff --git a/reactos/base/applications/winefile/winefile.dsp b/reactos/base/applications/winefile/winefile.dsp index d595d143f53..1ed7ccd31e0 100644 --- a/reactos/base/applications/winefile/winefile.dsp +++ b/reactos/base/applications/winefile/winefile.dsp @@ -123,7 +123,7 @@ LINK32=link.exe # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 -# PROP Output_Dir "winefileRelease" +# PROP Output_Dir "." # PROP Intermediate_Dir "winefileRelease" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" @@ -139,7 +139,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 user32.lib gdi32.lib advapi32.lib comctl32.lib shell32.lib comdlg32.lib /nologo /subsystem:windows /machine:I386 -# ADD LINK32 user32.lib gdi32.lib advapi32.lib comctl32.lib shell32.lib comdlg32.lib ole32.lib version.lib mpr.lib /nologo /subsystem:windows /machine:I386 /out:"winefileRelease/winefile-ansi.exe" +# ADD LINK32 user32.lib gdi32.lib advapi32.lib comctl32.lib shell32.lib comdlg32.lib ole32.lib version.lib mpr.lib /nologo /subsystem:windows /machine:I386 /out:"winefile-ansi.exe" !ENDIF @@ -250,11 +250,6 @@ SOURCE=.\zh.rc # End Group # Begin Source File -SOURCE=.\license.c -# PROP Exclude_From_Build 1 -# End Source File -# Begin Source File - SOURCE=.\resource.h # End Source File # Begin Source File diff --git a/reactos/base/applications/winefile/winefile.h b/reactos/base/applications/winefile/winefile.h index 8c0df5b8388..4cb7e0ca738 100644 --- a/reactos/base/applications/winefile/winefile.h +++ b/reactos/base/applications/winefile/winefile.h @@ -149,10 +149,6 @@ extern WINEFILE_GLOBALS Globals; #ifdef __WINE__ -extern void WineLicense(HWND hwnd); -extern void WineWarranty(HWND hwnd); - - #ifdef UNICODE extern void _wsplitpath(const WCHAR* path, WCHAR* drv, WCHAR* dir, WCHAR* name, WCHAR* ext); #define _tsplitpath _wsplitpath diff --git a/reactos/base/applications/winefile/winefile.sln b/reactos/base/applications/winefile/winefile.sln new file mode 100644 index 00000000000..a7ead544054 --- /dev/null +++ b/reactos/base/applications/winefile/winefile.sln @@ -0,0 +1,34 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_winefile", "make_winefile.vcproj", "{D5D64C37-5820-4EE1-9982-98A2CFFAC645}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winefile", "winefile.vcproj", "{33A963F1-6C9A-4582-80E5-C6AAD0173499}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + Unicode Debug|Win32 = Unicode Debug|Win32 + UNICODE Release|Win32 = UNICODE Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D5D64C37-5820-4EE1-9982-98A2CFFAC645}.Debug|Win32.ActiveCfg = Debug|Win32 + {D5D64C37-5820-4EE1-9982-98A2CFFAC645}.Release|Win32.ActiveCfg = Release|Win32 + {D5D64C37-5820-4EE1-9982-98A2CFFAC645}.Release|Win32.Build.0 = Release|Win32 + {D5D64C37-5820-4EE1-9982-98A2CFFAC645}.Unicode Debug|Win32.ActiveCfg = Debug|Win32 + {D5D64C37-5820-4EE1-9982-98A2CFFAC645}.Unicode Debug|Win32.Build.0 = Debug|Win32 + {D5D64C37-5820-4EE1-9982-98A2CFFAC645}.UNICODE Release|Win32.ActiveCfg = Release|Win32 + {33A963F1-6C9A-4582-80E5-C6AAD0173499}.Debug|Win32.ActiveCfg = Debug|Win32 + {33A963F1-6C9A-4582-80E5-C6AAD0173499}.Debug|Win32.Build.0 = Debug|Win32 + {33A963F1-6C9A-4582-80E5-C6AAD0173499}.Release|Win32.ActiveCfg = Release|Win32 + {33A963F1-6C9A-4582-80E5-C6AAD0173499}.Release|Win32.Build.0 = Release|Win32 + {33A963F1-6C9A-4582-80E5-C6AAD0173499}.Unicode Debug|Win32.ActiveCfg = Unicode Debug|Win32 + {33A963F1-6C9A-4582-80E5-C6AAD0173499}.Unicode Debug|Win32.Build.0 = Unicode Debug|Win32 + {33A963F1-6C9A-4582-80E5-C6AAD0173499}.UNICODE Release|Win32.ActiveCfg = UNICODE Release|Win32 + {33A963F1-6C9A-4582-80E5-C6AAD0173499}.UNICODE Release|Win32.Build.0 = UNICODE Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/reactos/base/applications/winefile/winefile.vcproj b/reactos/base/applications/winefile/winefile.vcproj new file mode 100644 index 00000000000..75f24f1c39e --- /dev/null +++ b/reactos/base/applications/winefile/winefile.vcproj @@ -0,0 +1,1220 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +