From db0a8fd47dc15549d22810e1073f08ed051d22fb Mon Sep 17 00:00:00 2001 From: Ged Murphy Date: Fri, 23 Oct 2015 13:16:25 +0000 Subject: [PATCH] [DEVMGR] - Force all refreshes to go through the CDeviceManager method instead of calling CDeviceView directly. - Fixes missing checked radio item in the view menu on startup svn path=/trunk/; revision=69659 --- .../dll/win32/devmgr/devmgmt/DeviceView.cpp | 6 ++--- reactos/dll/win32/devmgr/devmgmt/DeviceView.h | 3 +-- .../dll/win32/devmgr/devmgmt/MainWindow.cpp | 24 +++++++------------ reactos/dll/win32/devmgr/devmgmt/MainWindow.h | 3 ++- 4 files changed, 13 insertions(+), 23 deletions(-) diff --git a/reactos/dll/win32/devmgr/devmgmt/DeviceView.cpp b/reactos/dll/win32/devmgr/devmgmt/DeviceView.cpp index 13b14d4a286..eedd8969831 100644 --- a/reactos/dll/win32/devmgr/devmgmt/DeviceView.cpp +++ b/reactos/dll/win32/devmgr/devmgmt/DeviceView.cpp @@ -188,8 +188,7 @@ void CDeviceView::Refresh( _In_ ViewType Type, _In_ bool ScanForChanges, - _In_ bool UpdateView, - _In_opt_ LPWSTR DeviceId + _In_ bool UpdateView ) { // Enum devices on a seperate thread to keep the gui responsive @@ -230,8 +229,7 @@ CDeviceView::OnAction( { Refresh(GetCurrentView(), true, - true, - NULL); + true); break; } diff --git a/reactos/dll/win32/devmgr/devmgmt/DeviceView.h b/reactos/dll/win32/devmgr/devmgmt/DeviceView.h index eb0383e90fb..04a69da10a0 100644 --- a/reactos/dll/win32/devmgr/devmgmt/DeviceView.h +++ b/reactos/dll/win32/devmgr/devmgmt/DeviceView.h @@ -60,8 +60,7 @@ public: VOID Refresh( _In_ ViewType Type, _In_ bool ScanForChanges, - _In_ bool UpdateView, - _In_opt_ LPWSTR DeviceId + _In_ bool UpdateView ); VOID DisplayPropertySheet(); diff --git a/reactos/dll/win32/devmgr/devmgmt/MainWindow.cpp b/reactos/dll/win32/devmgr/devmgmt/MainWindow.cpp index 173ee6021ac..07a1f93ef9c 100644 --- a/reactos/dll/win32/devmgr/devmgmt/MainWindow.cpp +++ b/reactos/dll/win32/devmgr/devmgmt/MainWindow.cpp @@ -245,12 +245,13 @@ CDeviceManager::UpdateStatusBar(_In_ bool InMenuLoop) } bool -CDeviceManager::RefreshView(_In_ ViewType Type) +CDeviceManager::RefreshView(_In_ ViewType Type, + _In_ bool ScanForChanges) { UINT CheckId = 0; // Refreshed the cached view - m_DeviceView->Refresh(Type, FALSE, TRUE, NULL); + m_DeviceView->Refresh(Type, ScanForChanges, true); // Get the menu item id switch (Type) @@ -437,10 +438,7 @@ CDeviceManager::OnCreate(_In_ HWND hwnd) if (m_DeviceView->Initialize()) { // Do the initial scan - m_DeviceView->Refresh(m_DeviceView->GetCurrentView(), - true, - true, - NULL); + RefreshView(m_DeviceView->GetCurrentView(), true); // Display the window according to the user request ShowWindow(hwnd, m_CmdShow); @@ -608,13 +606,13 @@ CDeviceManager::OnCommand(_In_ WPARAM wParam, case IDC_DEVBYTYPE: { - RefreshView(DevicesByType); + RefreshView(DevicesByType, false); break; } case IDC_DEVBYCONN: { - RefreshView(DevicesByConnection); + RefreshView(DevicesByConnection, false); break; } @@ -633,10 +631,7 @@ CDeviceManager::OnCommand(_In_ WPARAM wParam, CheckMenuItem(m_hMenu, IDC_SHOWHIDDEN, MF_BYCOMMAND | MF_CHECKED); } // Refresh the device view - m_DeviceView->Refresh(m_DeviceView->GetCurrentView(), - false, - true, - NULL); + RefreshView(m_DeviceView->GetCurrentView(), false); break; } @@ -798,10 +793,7 @@ CDeviceManager::MainWndProc(_In_ HWND hwnd, if (wParam == REFRESH_TIMER) { // Schedule a refresh (this just creates a thread and returns) - This->m_DeviceView->Refresh(This->m_DeviceView->GetCurrentView(), - true, - true, - NULL); + This->RefreshView(This->m_DeviceView->GetCurrentView(), true); // Cleanup the timer KillTimer(hwnd, REFRESH_TIMER); diff --git a/reactos/dll/win32/devmgr/devmgmt/MainWindow.h b/reactos/dll/win32/devmgr/devmgmt/MainWindow.h index 218fdd27f23..3b2e5bc3ff8 100644 --- a/reactos/dll/win32/devmgr/devmgmt/MainWindow.h +++ b/reactos/dll/win32/devmgr/devmgmt/MainWindow.h @@ -90,7 +90,8 @@ private: ); bool RefreshView( - _In_ ViewType Type + _In_ ViewType Type, + _In_ bool ScanForChanges ); }; -- 2.17.1