winefile-Sync to Wine: Aric Stewart aric@codeweavers.com 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 mike@codeweavers.com winefile: Move the license and warranty text into the resources. Modified: trunk/reactos/base/applications/winefile/en.rc Deleted: trunk/reactos/base/applications/winefile/license.c Modified: trunk/reactos/base/applications/winefile/resource.h Modified: trunk/reactos/base/applications/winefile/winefile.c Modified: trunk/reactos/base/applications/winefile/winefile.dsp Modified: trunk/reactos/base/applications/winefile/winefile.h Modified: trunk/reactos/base/applications/winefile/winefile.sln Modified: trunk/reactos/base/applications/winefile/winefile.vcproj _____
Modified: trunk/reactos/base/applications/winefile/en.rc --- trunk/reactos/base/applications/winefile/en.rc 2006-02-04 09:02:51 UTC (rev 83) +++ trunk/reactos/base/applications/winefile/en.rc 2006-02-04 10:04:41 UTC (rev 84) @@ -264,3 +264,27 @@
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." +} _____
Deleted: trunk/reactos/base/applications/winefile/license.c --- trunk/reactos/base/applications/winefile/license.c 2006-02-04 09:02:51 UTC (rev 83) +++ trunk/reactos/base/applications/winefile/license.c 2006-02-04 10:04:41 UTC (rev 84) @@ -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 _____
Modified: trunk/reactos/base/applications/winefile/resource.h --- trunk/reactos/base/applications/winefile/resource.h 2006-02-04 09:02:51 UTC (rev 83) +++ trunk/reactos/base/applications/winefile/resource.h 2006-02-04 10:04:41 UTC (rev 84) @@ -135,7 +135,12 @@
#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 */
#ifdef __WINE__ _____
Modified: trunk/reactos/base/applications/winefile/winefile.c --- trunk/reactos/base/applications/winefile/winefile.c 2006-02-04 09:02:51 UTC (rev 83) +++ trunk/reactos/base/applications/winefile/winefile.c 2006-02-04 10:04:41 UTC (rev 84) @@ -239,6 +239,23 @@
}
+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 @@ -1403,6 +1420,7 @@ 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 @@
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 @@ 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) _____
Modified: trunk/reactos/base/applications/winefile/winefile.dsp --- trunk/reactos/base/applications/winefile/winefile.dsp 2006-02-04 09:02:51 UTC (rev 83) +++ trunk/reactos/base/applications/winefile/winefile.dsp 2006-02-04 10:04:41 UTC (rev 84) @@ -250,11 +250,6 @@
# 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 _____
Modified: trunk/reactos/base/applications/winefile/winefile.h --- trunk/reactos/base/applications/winefile/winefile.h 2006-02-04 09:02:51 UTC (rev 83) +++ trunk/reactos/base/applications/winefile/winefile.h 2006-02-04 10:04:41 UTC (rev 84) @@ -149,10 +149,6 @@
#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 _____
Modified: trunk/reactos/base/applications/winefile/winefile.sln --- trunk/reactos/base/applications/winefile/winefile.sln 2006-02-04 09:02:51 UTC (rev 83) +++ trunk/reactos/base/applications/winefile/winefile.sln 2006-02-04 10:04:41 UTC (rev 84) @@ -14,7 +14,6 @@
EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D5D64C37-5820-4EE1-9982-98A2CFFAC645}.Debug|Win32.ActiveCfg = Debug|Win32 - {D5D64C37-5820-4EE1-9982-98A2CFFAC645}.Debug|Win32.Build.0 = 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 _____
Modified: trunk/reactos/base/applications/winefile/winefile.vcproj --- trunk/reactos/base/applications/winefile/winefile.vcproj 2006-02-04 09:02:51 UTC (rev 83) +++ trunk/reactos/base/applications/winefile/winefile.vcproj 2006-02-04 10:04:41 UTC (rev 84) @@ -1119,52 +1119,6 @@
</File> </Filter> <File - RelativePath="license.c" - > - <FileConfiguration - Name="Debug|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="_DEBUG;_WIN32_WINNT=0x0501;$(NoInherit)" - UsePrecompiledHeader="0" - BrowseInformation="1" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="NDEBUG;_WIN32_WINNT=0x0501;$(NoInherit)" - UsePrecompiledHeader="0" - /> - </FileConfiguration> - <FileConfiguration - Name="UNICODE Release|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="NDEBUG;UNICODE;_WIN32_WINNT=0x0501;$(NoInherit) " - UsePrecompiledHeader="0" - /> - </FileConfiguration> - <FileConfiguration - Name="Unicode Debug|Win32" - ExcludedFromBuild="true" - > - <Tool - Name="VCCLCompilerTool" - PreprocessorDefinitions="_DEBUG;UNICODE;_WIN32_WINNT=0x0501;$(NoInherit) " - UsePrecompiledHeader="0" - BrowseInformation="1" - /> - </FileConfiguration> - </File> - <File RelativePath="resource.h" > </File>