Commit 270845d3 authored by David Hedberg's avatar David Hedberg Committed by Alexandre Julliard

shell32: Implement IExplorerBrowser::SetFolderSettings.

parent d17d78e4
......@@ -45,6 +45,7 @@ typedef struct _ExplorerBrowserImpl {
HWND hwnd_sv;
EXPLORER_BROWSER_OPTIONS eb_options;
FOLDERSETTINGS fs;
IShellView *psv;
RECT sv_rc;
......@@ -70,6 +71,24 @@ static void size_panes(ExplorerBrowserImpl *This)
TRUE);
}
static HRESULT change_viewmode(ExplorerBrowserImpl *This, UINT viewmode)
{
IFolderView *pfv;
HRESULT hr;
if(!This->psv)
return E_FAIL;
hr = IShellView_QueryInterface(This->psv, &IID_IFolderView, (void*)&pfv);
if(SUCCEEDED(hr))
{
hr = IFolderView_SetCurrentViewMode(pfv, This->fs.ViewMode);
IFolderView_Release(pfv);
}
return hr;
}
/**************************************************************************
* Main window related functions.
*/
......@@ -210,6 +229,9 @@ static HRESULT WINAPI IExplorerBrowser_fnInitialize(IExplorerBrowser *iface,
return E_FAIL;
}
This->fs.ViewMode = pfs ? pfs->ViewMode : FVM_DETAILS;
This->fs.fFlags = pfs ? (pfs->fFlags | FWF_NOCLIENTEDGE) : FWF_NOCLIENTEDGE;
return S_OK;
}
......@@ -275,9 +297,16 @@ static HRESULT WINAPI IExplorerBrowser_fnSetFolderSettings(IExplorerBrowser *ifa
const FOLDERSETTINGS *pfs)
{
ExplorerBrowserImpl *This = (ExplorerBrowserImpl*)iface;
FIXME("stub, %p (%p)\n", This, pfs);
TRACE("%p (%p)\n", This, pfs);
return E_NOTIMPL;
if(!pfs)
return E_INVALIDARG;
This->fs.ViewMode = pfs->ViewMode;
This->fs.fFlags = pfs->fFlags | FWF_NOCLIENTEDGE;
/* Change the settings of the current view, if any. */
return change_viewmode(This, This->fs.ViewMode);
}
static HRESULT WINAPI IExplorerBrowser_fnAdvise(IExplorerBrowser *iface,
......
......@@ -276,6 +276,7 @@ static void test_basics(void)
{
IExplorerBrowser *peb;
IShellBrowser *psb;
FOLDERSETTINGS fs;
ULONG lres;
DWORD flags;
HDWP hdwp;
......@@ -358,6 +359,21 @@ static void test_basics(void)
ok(hr == S_OK, "got (0x%08x)\n", hr);
IExplorerBrowser_Destroy(peb);
IExplorerBrowser_Release(peb);
ebrowser_instantiate(&peb);
ebrowser_initialize(peb);
/* SetFolderSettings */
hr = IExplorerBrowser_SetFolderSettings(peb, NULL);
ok(hr == E_INVALIDARG, "got (0x%08x)\n", hr);
fs.ViewMode = 0; fs.fFlags = 0;
hr = IExplorerBrowser_SetFolderSettings(peb, &fs);
todo_wine ok(hr == E_INVALIDARG, "got (0x%08x)\n", hr);
/* TODO: Test after browsing somewhere. */
IExplorerBrowser_Destroy(peb);
lres = IExplorerBrowser_Release(peb);
ok(lres == 0, "Got %d\n", lres);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment