mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-03 12:23:25 +00:00
[DEVMGR]
- Implement updating the device from the toolbar - Add a message before uninstalling a device. Dedicated to Jared Smudde. svn path=/trunk/; revision=69614
This commit is contained in:
@@ -271,7 +271,8 @@ CDeviceView::OnAction(
|
||||
|
||||
case IDC_UPDATE_DRV:
|
||||
{
|
||||
MessageBox(m_hMainWnd, L"Not yet implemented", L"Update Driver", MB_OK);
|
||||
bool NeedsReboot;
|
||||
UpdateSelectedDevice(NeedsReboot);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -740,6 +741,24 @@ CDeviceView::EnableSelectedDevice(
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
CDeviceView::UpdateSelectedDevice(
|
||||
_Out_ bool &NeedsReboot
|
||||
)
|
||||
{
|
||||
CDeviceNode *Node = dynamic_cast<CDeviceNode *>(GetSelectedNode());
|
||||
if (Node == nullptr) return false;
|
||||
|
||||
DWORD dwReboot;
|
||||
if (InstallDevInst(m_hMainWnd, Node->GetDeviceId(), TRUE, &dwReboot))
|
||||
{
|
||||
NeedsReboot = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
CDeviceView::UninstallSelectedDevice(
|
||||
)
|
||||
@@ -747,6 +766,18 @@ CDeviceView::UninstallSelectedDevice(
|
||||
CDeviceNode *Node = dynamic_cast<CDeviceNode *>(GetSelectedNode());
|
||||
if (Node == nullptr) return false;
|
||||
|
||||
CAtlStringW str;
|
||||
if (str.LoadStringW(g_hThisInstance, IDS_CONFIRM_UNINSTALL))
|
||||
{
|
||||
if (MessageBoxW(m_hMainWnd,
|
||||
str,
|
||||
Node->GetDisplayName(),
|
||||
MB_YESNO | MB_ICONWARNING | MB_DEFBUTTON2) != IDYES)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return Node->UninstallDevice();
|
||||
}
|
||||
|
||||
|
||||
@@ -115,6 +115,10 @@ private:
|
||||
_Out_ bool &NeedsReboot
|
||||
);
|
||||
|
||||
bool UpdateSelectedDevice(
|
||||
_Out_ bool &NeedsReboot
|
||||
);
|
||||
|
||||
bool UninstallSelectedDevice(
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user