Skip to content

Commit

Permalink
[SHELL32] Implement SSF_NOCONFIRMRECYCLE recycler setting (reactos#7434)
Browse files Browse the repository at this point in the history
CORE-12309
  • Loading branch information
whindsaks authored Oct 9, 2024
1 parent 8ff9781 commit 52265ae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions dll/win32/shell32/dialogs/recycler_prop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ RecycleBinDlg(
case WM_INITDIALOG:
page = (PROPSHEETPAGE*)lParam;
InitializeRecycleBinDlg(hwndDlg, (WCHAR)page->lParam);
SendDlgItemMessage(hwndDlg, 14004, BM_SETCHECK, !SHELL_GetSetting(SSF_NOCONFIRMRECYCLE, fNoConfirmRecycle), 0);
dwStyle = (DWORD) SendDlgItemMessage(hwndDlg, 14000, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0);
dwStyle = dwStyle | LVS_EX_FULLROWSELECT;
SendDlgItemMessage(hwndDlg, 14000, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, dwStyle);
Expand Down Expand Up @@ -324,6 +325,10 @@ RecycleBinDlg(
lppl = (LPNMLISTVIEW) lParam;
if (lppsn->hdr.code == PSN_APPLY)
{
SHELLSTATE ss;
ss.fNoConfirmRecycle = SendDlgItemMessage(hwndDlg, 14004, BM_GETCHECK, 0, 0) == BST_UNCHECKED;
SHGetSetSettings(&ss, SSF_NOCONFIRMRECYCLE, TRUE);

if (GetDefaultItem(hwndDlg, &li) > -1)
{
pItem = (PDRIVE_ITEM_CONTEXT)li.lParam;
Expand Down
5 changes: 4 additions & 1 deletion dll/win32/shell32/shlfileop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1596,7 +1596,10 @@ static HRESULT delete_files(FILE_OPERATION *op, const FILE_LIST *flFrom)
bTrash = (op->req->fFlags & FOF_ALLOWUNDO)
&& TRASH_CanTrashFile(flFrom->feFiles[0].szFullPath);

if (!(op->req->fFlags & FOF_NOCONFIRMATION) || (!bTrash && op->req->fFlags & FOF_WANTNUKEWARNING))
BOOL confirm = !(op->req->fFlags & FOF_NOCONFIRMATION);
if (bTrash && SHELL_GetSetting(SSF_NOCONFIRMRECYCLE, fNoConfirmRecycle))
confirm = FALSE;
if (confirm || (!bTrash && op->req->fFlags & FOF_WANTNUKEWARNING))
if (!confirm_delete_list(op->req->hwnd, op->req->fFlags, bTrash, flFrom))
{
op->req->fAnyOperationsAborted = TRUE;
Expand Down

0 comments on commit 52265ae

Please sign in to comment.