shell32: Implement IExplorerBrowser::SetFolderSettings.

This commit is contained in:
David Hedberg 2010-08-23 12:55:19 +02:00 committed by Alexandre Julliard
parent d17d78e44b
commit 270845d3dd
2 changed files with 47 additions and 2 deletions

View File

@ -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,

View File

@ -276,6 +276,7 @@ static void test_basics(void)
{
IExplorerBrowser *peb;
IShellBrowser *psb;
FOLDERSETTINGS fs;
ULONG lres;
DWORD flags;
HDWP hdwp;
@ -357,6 +358,21 @@ static void test_basics(void)
ok(flags == 0xDEADBEEF, "got (0x%08x)\n", flags);
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);