mirror of
https://github.com/reactos/reactos.git
synced 2025-08-07 03:42:58 +00:00
[SHELL32][BROWSEUI] Implement ShellBrowser Apply/Reset default folder settings (#6912)
This commit is contained in:
parent
ad73e17418
commit
c97c1ad4c5
12 changed files with 339 additions and 38 deletions
|
@ -618,8 +618,18 @@ ViewDlg_CreateTreeImageList(VOID)
|
|||
}
|
||||
|
||||
static BOOL
|
||||
ViewDlg_OnInitDialog(HWND hwndDlg)
|
||||
ViewDlg_OnInitDialog(HWND hwndDlg, LPPROPSHEETPAGE psp)
|
||||
{
|
||||
SetWindowLongPtr(hwndDlg, GWL_USERDATA, psp->lParam);
|
||||
CFolderOptions *pFO = (CFolderOptions*)psp->lParam;
|
||||
|
||||
if (!pFO || !pFO->CanSetDefFolderSettings())
|
||||
{
|
||||
// The global options (started from rundll32 or control panel)
|
||||
// has no browser to copy the current settings from.
|
||||
EnableWindow(GetDlgItem(hwndDlg, IDC_VIEW_APPLY_TO_ALL), FALSE);
|
||||
}
|
||||
|
||||
HWND hwndTreeView = GetDlgItem(hwndDlg, IDC_VIEW_TREEVIEW);
|
||||
|
||||
s_hTreeImageList = ViewDlg_CreateTreeImageList();
|
||||
|
@ -941,7 +951,7 @@ FolderOptionsViewDlg(
|
|||
switch (uMsg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
return ViewDlg_OnInitDialog(hwndDlg);
|
||||
return ViewDlg_OnInitDialog(hwndDlg, (LPPROPSHEETPAGE)lParam);
|
||||
|
||||
case WM_COMMAND:
|
||||
switch (LOWORD(wParam))
|
||||
|
@ -949,6 +959,18 @@ FolderOptionsViewDlg(
|
|||
case IDC_VIEW_RESTORE_DEFAULTS: // Restore Defaults
|
||||
ViewDlg_RestoreDefaults(hwndDlg);
|
||||
break;
|
||||
|
||||
case IDC_VIEW_APPLY_TO_ALL:
|
||||
case IDC_VIEW_RESET_ALL:
|
||||
{
|
||||
HRESULT hr = HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED);
|
||||
CFolderOptions *pFO = (CFolderOptions*)GetWindowLongPtr(hwndDlg, GWL_USERDATA);
|
||||
if (pFO)
|
||||
hr = pFO->ApplyDefFolderSettings(LOWORD(wParam) == IDC_VIEW_RESET_ALL);
|
||||
if (FAILED(hr))
|
||||
SHELL_ErrorBox(hwndDlg, hr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue