Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
034c1c4f
Commit
034c1c4f
authored
Jul 19, 2006
by
Mikołaj Zalewski
Committed by
Alexandre Julliard
Jul 31, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Call the trashing code from SHFileOperationW.
parent
f2686c7c
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
43 additions
and
5 deletions
+43
-5
shell32_En.rc
dlls/shell32/shell32_En.rc
+1
-0
shell32_main.h
dlls/shell32/shell32_main.h
+1
-0
shfldr_fs.c
dlls/shell32/shfldr_fs.c
+1
-1
shfldr_unixfs.c
dlls/shell32/shfldr_unixfs.c
+1
-0
shlfileop.c
dlls/shell32/shlfileop.c
+38
-4
shresdef.h
dlls/shell32/shresdef.h
+1
-0
No files found.
dlls/shell32/shell32_En.rc
View file @
034c1c4f
...
...
@@ -168,6 +168,7 @@ STRINGTABLE DISCARDABLE
IDS_TRASHITEM_TEXT "Are you sure that you want to send '%1' to the Trash?"
IDS_TRASHFOLDER_TEXT "Are you sure that you want to send '%1' and all it's content to the Trash?"
IDS_TRASHMULTIPLE_TEXT "Are you sure that you want to send these %1 items to the Trash?"
IDS_CANTTRASH_TEXT "The item '%1' can't be sent to Trash. Do you want to delete it instead?"
IDS_OVERWRITEFILE_TEXT "OverWrite File %1?"
IDS_OVERWRITEFILE_CAPTION "Confirm File OverWrite"
...
...
dlls/shell32/shell32_main.h
View file @
034c1c4f
...
...
@@ -151,6 +151,7 @@ void FreeChangeNotifications(void);
#define ASK_TRASH_FILE 7
#define ASK_TRASH_FOLDER 8
#define ASK_TRASH_MULTIPLE_ITEM 9
#define ASK_CANT_TRASH_ITEM 10
BOOL
SHELL_DeleteDirectoryW
(
HWND
hwnd
,
LPCWSTR
pwszDir
,
BOOL
bShowUI
);
BOOL
SHELL_ConfirmDialogW
(
HWND
hWnd
,
int
nKindOfDialog
,
LPCWSTR
szDir
);
...
...
dlls/shell32/shfldr_fs.c
View file @
034c1c4f
...
...
@@ -1214,7 +1214,7 @@ ISFHelper_fnDeleteItems (ISFHelper * iface, UINT cidl, LPCITEMIDLIST * apidl)
op
.
hwnd
=
GetActiveWindow
();
op
.
wFunc
=
FO_DELETE
;
op
.
pFrom
=
wszPathsList
;
op
.
fFlags
=
0
;
op
.
fFlags
=
FOF_ALLOWUNDO
;
if
(
SHFileOperationW
(
&
op
))
{
WARN
(
"SHFileOperation failed
\n
"
);
...
...
dlls/shell32/shfldr_unixfs.c
View file @
034c1c4f
...
...
@@ -1810,6 +1810,7 @@ static HRESULT UNIXFS_delete_with_shfileop(UnixFolder *This, UINT cidl, LPCITEMI
op
.
hwnd
=
GetActiveWindow
();
op
.
wFunc
=
FO_DELETE
;
op
.
pFrom
=
wszPathsList
;
op
.
fFlags
=
FOF_ALLOWUNDO
;
if
(
!
SHFileOperationW
(
&
op
))
{
WARN
(
"SHFileOperationW failed
\n
"
);
...
...
dlls/shell32/shlfileop.c
View file @
034c1c4f
...
...
@@ -42,6 +42,7 @@
#include "undocshell.h"
#include "wine/unicode.h"
#include "wine/debug.h"
#include "xdg.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
shell
);
...
...
@@ -106,6 +107,11 @@ static BOOL SHELL_ConfirmIDs(int nKindOfDialog, SHELL_ConfirmIDstruc *ids)
ids
->
caption_resource_id
=
IDS_DELETEITEM_CAPTION
;
ids
->
text_resource_id
=
IDS_TRASHMULTIPLE_TEXT
;
return
TRUE
;
case
ASK_CANT_TRASH_ITEM
:
ids
->
icon_resource_id
=
IDI_SHELL_CONFIRM_DELETE
;
ids
->
caption_resource_id
=
IDS_DELETEITEM_CAPTION
;
ids
->
text_resource_id
=
IDS_CANTTRASH_TEXT
;
return
TRUE
;
case
ASK_DELETE_SELECTED
:
ids
->
icon_resource_id
=
IDI_SHELL_CONFIRM_DELETE
;
ids
->
caption_resource_id
=
IDS_DELETEITEM_CAPTION
;
...
...
@@ -1104,12 +1110,17 @@ static HRESULT delete_files(LPSHFILEOPSTRUCTW lpFileOp, FILE_LIST *flFrom)
FILE_ENTRY
*
fileEntry
;
DWORD
i
;
BOOL
bPathExists
;
BOOL
bTrash
;
if
(
!
flFrom
->
dwNumFiles
)
return
ERROR_SUCCESS
;
if
(
!
(
lpFileOp
->
fFlags
&
FOF_NOCONFIRMATION
)
||
(
lpFileOp
->
fFlags
&
FOF_WANTNUKEWARNING
))
if
(
!
confirm_delete_list
(
lpFileOp
->
hwnd
,
lpFileOp
->
fFlags
,
FALSE
,
flFrom
))
/* Windows also checks only the first item */
bTrash
=
(
lpFileOp
->
fFlags
&
FOF_ALLOWUNDO
)
&&
TRASH_CanTrashFile
(
flFrom
->
feFiles
[
0
].
szFullPath
);
if
(
!
(
lpFileOp
->
fFlags
&
FOF_NOCONFIRMATION
)
||
(
!
bTrash
&&
lpFileOp
->
fFlags
&
FOF_WANTNUKEWARNING
))
if
(
!
confirm_delete_list
(
lpFileOp
->
hwnd
,
lpFileOp
->
fFlags
,
bTrash
,
flFrom
))
{
lpFileOp
->
fAnyOperationsAborted
=
TRUE
;
return
0
;
...
...
@@ -1120,10 +1131,33 @@ static HRESULT delete_files(LPSHFILEOPSTRUCTW lpFileOp, FILE_LIST *flFrom)
bPathExists
=
TRUE
;
fileEntry
=
&
flFrom
->
feFiles
[
i
];
if
(
!
IsAttribFile
(
fileEntry
->
attributes
)
&&
(
lpFileOp
->
fFlags
&
FOF_FILESONLY
&&
fileEntry
->
bFromWildcard
))
continue
;
if
(
bTrash
)
{
BOOL
bDelete
;
if
(
TRASH_TrashFile
(
fileEntry
->
szFullPath
))
continue
;
/* Note: Windows silently deletes the file in such a situation, we show a dialog */
if
(
!
(
lpFileOp
->
fFlags
&
FOF_NOCONFIRMATION
)
||
(
lpFileOp
->
fFlags
&
FOF_WANTNUKEWARNING
))
bDelete
=
SHELL_ConfirmDialogW
(
lpFileOp
->
hwnd
,
ASK_CANT_TRASH_ITEM
,
fileEntry
->
szFullPath
);
else
bDelete
=
TRUE
;
if
(
!
bDelete
)
{
lpFileOp
->
fAnyOperationsAborted
=
TRUE
;
break
;
}
}
/* delete the file or directory */
if
(
IsAttribFile
(
fileEntry
->
attributes
))
bPathExists
=
DeleteFileW
(
fileEntry
->
szFullPath
);
else
if
(
!
(
lpFileOp
->
fFlags
&
FOF_FILESONLY
&&
fileEntry
->
bFromWildcard
))
else
bPathExists
=
SHELL_DeleteDirectoryW
(
lpFileOp
->
hwnd
,
fileEntry
->
szFullPath
,
FALSE
);
if
(
!
bPathExists
)
...
...
@@ -1252,7 +1286,7 @@ static HRESULT rename_files(LPSHFILEOPSTRUCTW lpFileOp, FILE_LIST *flFrom, FILE_
/* alert the user if an unsupported flag is used */
static
void
check_flags
(
FILEOP_FLAGS
fFlags
)
{
WORD
wUnsupportedFlags
=
FOF_
ALLOWUNDO
|
FOF_
NO_CONNECTED_ELEMENTS
|
WORD
wUnsupportedFlags
=
FOF_NO_CONNECTED_ELEMENTS
|
FOF_NOCOPYSECURITYATTRIBS
|
FOF_NORECURSEREPARSE
|
FOF_RENAMEONCOLLISION
|
FOF_WANTMAPPINGHANDLE
;
...
...
dlls/shell32/shresdef.h
View file @
034c1c4f
...
...
@@ -89,6 +89,7 @@
#define IDS_TRASHFOLDER_TEXT 137
#define IDS_TRASHITEM_TEXT 138
#define IDS_TRASHMULTIPLE_TEXT 139
#define IDS_CANTTRASH_TEXT 140
/* browse for folder dialog box */
#define IDD_STATUS 0x3743
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment