Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
e187b3ff
Commit
e187b3ff
authored
Feb 21, 2001
by
Chris Morgan
Committed by
Alexandre Julliard
Feb 21, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Confirm file deletes. Make delete confirmation messages more
consistent. Improve trace messages on delete failure.
parent
0cd448c4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
74 additions
and
16 deletions
+74
-16
shlfileop.c
dlls/shell32/shlfileop.c
+44
-8
shlfolder.c
dlls/shell32/shlfolder.c
+23
-5
shres.rc
dlls/shell32/shres.rc
+4
-2
shresdef.h
dlls/shell32/shresdef.h
+3
-1
No files found.
dlls/shell32/shlfileop.c
View file @
e187b3ff
...
...
@@ -13,16 +13,39 @@
DEFAULT_DEBUG_CHANNEL
(
shell
);
#define ASK_DELETE_FILE 1
#define ASK_DELETE_FOLDER 2
#define ASK_DELETE_MULTIPLE_FILE 3
static
BOOL
SHELL_WarnFolderDelete
(
int
nKindOfDialog
,
LPCSTR
szDir
)
BOOL
SHELL_WarnItemDelete
(
int
nKindOfDialog
,
LPCSTR
szDir
)
{
char
szCaption
[
255
],
szText
[
255
],
szBuffer
[
MAX_PATH
+
256
];
LoadStringA
(
shell32_hInstance
,
IDS_DELETEFOLDER_TEXT
,
szText
,
sizeof
(
szText
));
LoadStringA
(
shell32_hInstance
,
IDS_DELETEFOLDER_CAPTION
,
szCaption
,
sizeof
(
szCaption
));
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!"
);
LoadStringA
(
shell32_hInstance
,
IDS_DELETEITEM_TEXT
,
szText
,
sizeof
(
szText
));
LoadStringA
(
shell32_hInstance
,
IDS_DELETEITEM_CAPTION
,
szCaption
,
sizeof
(
szCaption
));
}
FormatMessageA
(
FORMAT_MESSAGE_FROM_STRING
|
FORMAT_MESSAGE_ARGUMENT_ARRAY
,
szText
,
0
,
0
,
szBuffer
,
sizeof
(
szBuffer
),
(
va_list
*
)
&
szDir
);
...
...
@@ -46,7 +69,8 @@ BOOL SHELL_DeleteDirectoryA(LPCSTR pszDir, BOOL bShowUI)
PathAddBackslashA
(
szTemp
);
strcat
(
szTemp
,
"*.*"
);
if
(
bShowUI
&&
!
SHELL_WarnFolderDelete
(
ASK_DELETE_FOLDER
,
pszDir
))
return
FALSE
;
if
(
bShowUI
&&
!
SHELL_WarnItemDelete
(
ASK_DELETE_FOLDER
,
pszDir
))
return
FALSE
;
if
(
INVALID_HANDLE_VALUE
!=
(
hFind
=
FindFirstFileA
(
szTemp
,
&
wfd
)))
{
...
...
@@ -72,6 +96,18 @@ BOOL SHELL_DeleteDirectoryA(LPCSTR pszDir, BOOL bShowUI)
return
ret
;
}
/**************************************************************************
* SHELL_DeleteFileA()
*/
BOOL
SHELL_DeleteFileA
(
LPCSTR
pszFile
,
BOOL
bShowUI
)
{
if
(
bShowUI
&&
!
SHELL_WarnItemDelete
(
ASK_DELETE_FILE
,
pszFile
))
return
FALSE
;
return
DeleteFileA
(
pszFile
);
}
/*************************************************************************
* SHCreateDirectory [SHELL32.165]
*
...
...
dlls/shell32/shlfolder.c
View file @
e187b3ff
...
...
@@ -1489,9 +1489,20 @@ static HRESULT WINAPI ISFHelper_fnDeleteItems(
_ICOM_THIS_From_ISFHelper
(
IGenericSFImpl
,
iface
)
int
i
;
char
szPath
[
MAX_PATH
];
BOOL
bConfirm
=
TRUE
;
TRACE
(
"(%p)(%u %p)
\n
"
,
This
,
cidl
,
apidl
);
/* deleting multiple items so give a slightly different warning */
if
(
cidl
!=
1
)
{
char
tmp
[
8
];
snprintf
(
tmp
,
sizeof
(
tmp
),
"%d"
,
cidl
);
if
(
!
SHELL_WarnItemDelete
(
ASK_DELETE_MULTIPLE_ITEM
,
tmp
))
return
E_FAIL
;
bConfirm
=
FALSE
;
}
for
(
i
=
0
;
i
<
cidl
;
i
++
)
{
strcpy
(
szPath
,
This
->
sMyPath
);
...
...
@@ -1501,9 +1512,12 @@ static HRESULT WINAPI ISFHelper_fnDeleteItems(
if
(
_ILIsFolder
(
apidl
[
i
]))
{
LPITEMIDLIST
pidl
;
MESSAGE
(
"delete %s
\n
"
,
szPath
);
if
(
!
SHELL_DeleteDirectoryA
(
szPath
,
TRUE
))
return
E_FAIL
;
TRACE
(
"delete %s
\n
"
,
szPath
);
if
(
!
SHELL_DeleteDirectoryA
(
szPath
,
bConfirm
))
{
TRACE
(
"delete %s failed, bConfirm=%d"
,
szPath
,
bConfirm
);
return
E_FAIL
;
}
pidl
=
ILCombine
(
This
->
absPidl
,
apidl
[
i
]);
SHChangeNotifyA
(
SHCNE_RMDIR
,
SHCNF_IDLIST
,
pidl
,
NULL
);
SHFree
(
pidl
);
...
...
@@ -1512,8 +1526,12 @@ static HRESULT WINAPI ISFHelper_fnDeleteItems(
{
LPITEMIDLIST
pidl
;
MESSAGE
(
"delete %s
\n
"
,
szPath
);
if
(
!
DeleteFileA
(
szPath
))
return
E_FAIL
;
TRACE
(
"delete %s
\n
"
,
szPath
);
if
(
!
SHELL_DeleteFileA
(
szPath
,
bConfirm
))
{
TRACE
(
"delete %s failed, bConfirm=%d"
,
szPath
,
bConfirm
);
return
E_FAIL
;
}
pidl
=
ILCombine
(
This
->
absPidl
,
apidl
[
i
]);
SHChangeNotifyA
(
SHCNE_DELETE
,
SHCNF_IDLIST
,
pidl
,
NULL
);
SHFree
(
pidl
);
...
...
dlls/shell32/shres.rc
View file @
e187b3ff
...
...
@@ -133,8 +133,10 @@ STRINGTABLE DISCARDABLE
{
IDS_CREATEFOLDER_DENIED "Can not create new Folder: Permission denied."
IDS_CREATEFOLDER_CAPTION "Error during creating a new folder"
IDS_DELETEFOLDER_TEXT "Are you sure you want to delete %1 and all it's subfolders?"
IDS_DELETEFOLDER_CAPTION "Confirm file delete"
IDS_DELETEITEM_CAPTION "Confirm file delete"
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?"
}
shv_accel ACCELERATORS
...
...
dlls/shell32/shresdef.h
View file @
e187b3ff
...
...
@@ -24,8 +24,10 @@
#define IDS_CREATEFOLDER_DENIED 30
#define IDS_CREATEFOLDER_CAPTION 31
#define IDS_DELETE
FOLDER_TEXT
32
#define IDS_DELETE
ITEM_CAPTION
32
#define IDS_DELETEFOLDER_CAPTION 33
#define IDS_DELETEITEM_TEXT 34
#define IDS_DELETEMULTIPLE_TEXT 35
/* browse for folder dialog box */
#define IDD_STATUS 97
...
...
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