[DEVMGR]
authorGed Murphy <gedmurphy@reactos.org>
Fri, 23 Oct 2015 13:16:25 +0000 (13:16 +0000)
committerGed Murphy <gedmurphy@reactos.org>
Fri, 23 Oct 2015 13:16:25 +0000 (13:16 +0000)
- 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

reactos/dll/win32/devmgr/devmgmt/DeviceView.cpp
reactos/dll/win32/devmgr/devmgmt/DeviceView.h
reactos/dll/win32/devmgr/devmgmt/MainWindow.cpp
reactos/dll/win32/devmgr/devmgmt/MainWindow.h

index 13b14d4..eedd896 100644 (file)
@@ -188,8 +188,7 @@ void
 CDeviceView::Refresh(
     _In_ ViewType Type,
     _In_ bool ScanForChanges,
 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
     )
 {
     // Enum devices on a seperate thread to keep the gui responsive
@@ -230,8 +229,7 @@ CDeviceView::OnAction(
         {
             Refresh(GetCurrentView(),
                     true,
         {
             Refresh(GetCurrentView(),
                     true,
-                    true,
-                    NULL);
+                    true);
             break;
         }
 
             break;
         }
 
index eb0383e..04a69da 100644 (file)
@@ -60,8 +60,7 @@ public:
     VOID Refresh(
         _In_ ViewType Type,
         _In_ bool ScanForChanges,
     VOID Refresh(
         _In_ ViewType Type,
         _In_ bool ScanForChanges,
-        _In_ bool UpdateView,
-        _In_opt_ LPWSTR DeviceId
+        _In_ bool UpdateView
         );
 
     VOID DisplayPropertySheet();
         );
 
     VOID DisplayPropertySheet();
index 173ee60..07a1f93 100644 (file)
@@ -245,12 +245,13 @@ CDeviceManager::UpdateStatusBar(_In_ bool InMenuLoop)
 }
 
 bool
 }
 
 bool
-CDeviceManager::RefreshView(_In_ ViewType Type)
+CDeviceManager::RefreshView(_In_ ViewType Type,
+                            _In_ bool ScanForChanges)
 {
     UINT CheckId = 0;
 
     // Refreshed the cached view
 {
     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)
 
     // Get the menu item id
     switch (Type)
@@ -437,10 +438,7 @@ CDeviceManager::OnCreate(_In_ HWND hwnd)
         if (m_DeviceView->Initialize())
         {
             // Do the initial scan
         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);
 
             // Display the window according to the user request
             ShowWindow(hwnd, m_CmdShow);
@@ -608,13 +606,13 @@ CDeviceManager::OnCommand(_In_ WPARAM wParam,
 
         case IDC_DEVBYTYPE:
         {
 
         case IDC_DEVBYTYPE:
         {
-            RefreshView(DevicesByType);
+            RefreshView(DevicesByType, false);
             break;
         }
 
         case IDC_DEVBYCONN:
         {
             break;
         }
 
         case IDC_DEVBYCONN:
         {
-            RefreshView(DevicesByConnection);
+            RefreshView(DevicesByConnection, false);
             break;
         }
 
             break;
         }
 
@@ -633,10 +631,7 @@ CDeviceManager::OnCommand(_In_ WPARAM wParam,
                 CheckMenuItem(m_hMenu, IDC_SHOWHIDDEN, MF_BYCOMMAND | MF_CHECKED);
             }
             // Refresh the device view
                 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;
         }
 
             break;
         }
 
@@ -798,10 +793,7 @@ CDeviceManager::MainWndProc(_In_ HWND hwnd,
             if (wParam == REFRESH_TIMER)
             {
                 // Schedule a refresh (this just creates a thread and returns)
             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);
 
                 // Cleanup the timer
                 KillTimer(hwnd, REFRESH_TIMER);
index 218fdd2..3b2e5bc 100644 (file)
@@ -90,7 +90,8 @@ private:
         );
 
     bool RefreshView(
         );
 
     bool RefreshView(
-        _In_ ViewType Type
+        _In_ ViewType Type,
+        _In_ bool ScanForChanges
         );
 };
 
         );
 };