Changelog * dlls/shell32/shell32_main.h * dlls/shell32/shres.rc * dlls/shell32/shresdef.h * dlls/shell32/shfldr_fs.c * dlls/shell32/shlfileop.c This introduces some declarations and resources needed for a more complete implementation of SHFileOperation. This should be in respect of functionality a no-op. Rolf Kalbermatter Index: dlls/shell32/shell32_main.h =================================================================== RCS file: /home/wine/wine/dlls/shell32/shell32_main.h,v retrieving revision 1.61 diff -u -r1.61 shell32_main.h --- dlls/shell32/shell32_main.h 15 Dec 2002 01:14:04 -0000 1.61 +++ dlls/shell32/shell32_main.h 17 Dec 2002 21:26:18 -0000 @@ -161,13 +161,15 @@ void FreeChangeNotifications(void); /* file operation */ -#define ASK_DELETE_FILE 1 -#define ASK_DELETE_FOLDER 2 -#define ASK_DELETE_MULTIPLE_ITEM 3 +#define ASK_DELETE_FILE 1 +#define ASK_DELETE_FOLDER 2 +#define ASK_DELETE_MULTIP LE_ITEM 3 +#define ASK_CREATE FOLDER 4 +#define ASK_OVERWRITE_FILE 5 BOOL SHELL_DeleteDirectoryA(LPCSTR pszDir, BOOL bShowUI); BOOL SHELL_DeleteFileA(LPCSTR pszFile, BOOL bShowUI); -BOOL SHELL_WarnItemDelete(int nKindOfDialog, LPCSTR szDir); +BOOL SHELL_ConfirmDialog(int nKindOfDialog, LPCSTR szDir); /* 16-bit functions */ void WINAPI DragAcceptFiles16(HWND16 hWnd, BOOL16 b); Index: dlls/shell32/shres.rc =================================================================== RCS file: /home/wine/wine/dlls/shell32/shres.rc,v retrieving revision 1.26 diff -u -r1.26 shres.rc --- dlls/shell32/shres.rc 20 Nov 2002 19:47:44 -0000 1.26 +++ dlls/shell32/shres.rc 17 Dec 2002 21:50:15 -0000 @@ -152,6 +152,8 @@ IDS_DELETEFOLDER_CAPTION "Confirm folder delete" IDS_DELETEITEM_TEXT "Are you sure you want to delete '%1'?" IDS_DELETEMULTIPLE_TEXT "Are you sure you want to delete these %1 items?" + IDS_OVERWRITEFILE_TEXT "OverWrite File %1?" + IDS_OVERWRITEFILE_CAPTION "Confirm File OverWrite" } shv_accel ACCELERATORS Index: dlls/shell32/shresdef.h =================================================================== RCS file: /home/wine/wine/dlls/shell32/shresdef.h,v retrieving revision 1.9 diff -u -r1.9 shresdef.h --- dlls/shell32/shresdef.h 14 Aug 2002 21:03:55 -0000 1.9 +++ dlls/shell32/shresdef.h 17 Dec 2002 21:51:14 -0000 @@ -46,6 +46,8 @@ #define IDS_DELETEFOLDER_CAPTION 33 #define IDS_DELETEITEM_TEXT 34 #define IDS_DELETEMULTIPLE_TEXT 35 +#define IDS_OVERWRITEFILE_CAPTION 36 +#define IDS_OVERWRITEFILE_TEXT 37 /* browse for folder dialog box */ #define IDD_STATUS 0x3743 Index: dlls/shell32/shfldr_fs.c =================================================================== RCS file: /home/wine/wine/dlls/shell32/shfldr_fs.c,v retrieving revision 1.5 diff -u -r1.5 shfldr_fs.c --- dlls/shell32/shfldr_fs.c 15 Dec 2002 01:14:04 -0000 1.5 +++ dlls/shell32/shfldr_fs.c 17 Dec 2002 21:49:18 -0000 @@ -978,7 +978,7 @@ char tmp[8]; snprintf (tmp, sizeof (tmp), "%d", cidl); - if (!SHELL_WarnItemDelete (ASK_DELETE_MULTIPLE_ITEM, tmp)) + if (!SHELL_ConfirmDialog(ASK_DELETE_MULTIPLE_ITEM, tmp)) return E_FAIL; bConfirm = FALSE; } Index: dlls/shell32/shlfileop.c =================================================================== RCS file: /home/wine/wine/dlls/shell32/shlfileop.c,v retrieving revision 1.21 diff -u -r1.21 shlfileop.c --- dlls/shell32/shlfileop.c 16 Dec 2002 22:40:34 -0000 1.21 +++ dlls/shell32/shlfileop.c 17 Dec 2002 21:56:56 -0000 @@ -35,41 +35,39 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); -BOOL SHELL_WarnItemDelete (int nKindOfDialog, LPCSTR szDir) +BOOL SHELL_ConfirmDialog (int nKindOfDialog, LPCSTR szDir) { char szCaption[255], szText[255], szBuffer[MAX_PATH + 256]; + UINT caption_resource_id, text_resource_id; - if(nKindOfDialog == ASK_DELETE_FILE) - { - LoadStringA(shell32_hInstance, IDS_DELETEITEM_TEXT, szText, - sizeof(szText)); - LoadStringA(shell32_hInstance, IDS_DELETEITEM_CAPTION, - szCaption, sizeof(szCaption)); - } - else if(nKindOfDialog == ASK_DELETE_FOLDER) - { - LoadStringA(shell32_hInstance, IDS_DELETEITEM_TEXT, szText, - sizeof(szText)); - LoadStringA(shell32_hInstance, IDS_DELETEFOLDER_CAPTION, - szCaption, sizeof(szCaption)); - } - else if(nKindOfDialog == ASK_DELETE_MULTIPLE_ITEM) - { - LoadStringA(shell32_hInstance, IDS_DELETEMULTIPLE_TEXT, szText, - sizeof(szText)); - LoadStringA(shell32_hInstance, IDS_DELETEITEM_CAPTION, - szCaption, sizeof(szCaption)); - } - else { - FIXME("Called without a valid nKindOfDialog specified!\n"); - LoadStringA(shell32_hInstance, IDS_DELETEITEM_TEXT, szText, - sizeof(szText)); - LoadStringA(shell32_hInstance, IDS_DELETEITEM_CAPTION, - szCaption, sizeof(szCaption)); + switch(nKindOfDialog) { + + case ASK_DELETE_FILE: + caption_resource_id = IDS_DELETEITEM_CAPTION; + text_resource_id = IDS_DELETEITEM_TEXT; + break; + case ASK_DELETE_FOLDER: + caption_resource_id = IDS_DELETEFOLDER_CAPTION; + text_resource_id = IDS_DELETEITEM_TEXT; + break; + case ASK_DELETE_MULTIPLE_ITEM: + caption_resource_id = IDS_DELETEITEM_CAPTION; + text_resource_id = IDS_DELETEMULTIPLE_TEXT; + break; + case ASK_OVERWRITE_FILE: + caption_resource_id = IDS_OVERWRITEFILE_CAPTION; + text_resource_id = IDS_OVERWRITEFILE_TEXT; + break; + default: + FIXME(" Unhandled nKindOfDialog %d stub\n", nKindOfDialog); + return FALSE; } - FormatMessageA(FORMAT_MESSAGE_FROM_STRING|FORMAT_MESSAGE_ARGUMENT_ARRAY, - szText, 0, 0, szBuffer, sizeof(szBuffer), (va_list*)&szDir); + LoadStringA(shell32_hInstance, caption_resource_id, szCaption, sizeof(szCaption)); + LoadStringA(shell32_hInstance, text_resource_id, szText, sizeof(szText)); + + FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ARGUMENT_ARRAY, + szText, 0, 0, szBuffer, sizeof(szBuffer), (va_list*)&szDir); return (IDOK == MessageBoxA(GetActiveWindow(), szBuffer, szCaption, MB_OKCANCEL | MB_ICONEXCLAMATION)); } @@ -91,7 +89,7 @@ PathAddBackslashA(szTemp); strcat(szTemp, "*.*"); - if (bShowUI && !SHELL_WarnItemDelete(ASK_DELETE_FOLDER, pszDir)) + if (bShowUI && !SHELL_ConfirmDialog(ASK_DELETE_FOLDER, pszDir)) return FALSE; if(INVALID_HANDLE_VALUE != (hFind = FindFirstFileA(szTemp, &wfd))) @@ -124,7 +122,7 @@ BOOL SHELL_DeleteFileA(LPCSTR pszFile, BOOL bShowUI) { - if (bShowUI && !SHELL_WarnItemDelete(ASK_DELETE_FILE, pszFile)) + if (bShowUI && !SHELL_ConfirmDialog(ASK_DELETE_FILE, pszFile)) return FALSE; return DeleteFileA(pszFile);