Author: gedmurphy
Date: Thu Jun 25 20:34:57 2015
New Revision: 68267
URL:
http://svn.reactos.org/svn/reactos?rev=68267&view=rev
Log:
[DEVMGR]
- When disabling a device, show the user a message box to confirm before disabling
- Some code cleanup
Modified:
trunk/reactos/dll/win32/devmgr/devmgmt/DeviceNode.cpp
trunk/reactos/dll/win32/devmgr/devmgmt/DeviceView.cpp
trunk/reactos/dll/win32/devmgr/devmgmt/MainWindow.cpp
trunk/reactos/dll/win32/devmgr/devmgmt/Resource.h
trunk/reactos/dll/win32/devmgr/devmgmt/lang/en-US.rc
Modified: trunk/reactos/dll/win32/devmgr/devmgmt/DeviceNode.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr/devmgmt/D…
==============================================================================
--- trunk/reactos/dll/win32/devmgr/devmgmt/DeviceNode.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/devmgr/devmgmt/DeviceNode.cpp [iso-8859-1] Thu Jun 25 20:34:57
2015
@@ -340,6 +340,8 @@
if (Enable)
{
+ // config specific enablling first, then global enabling.
+ // The global appears to be the one that starts the device
pcp.Scope = DICS_FLAG_GLOBAL;
if (SetupDiSetClassInstallParamsW(m_hDevInfo,
&m_DevinfoData,
Modified: trunk/reactos/dll/win32/devmgr/devmgmt/DeviceView.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr/devmgmt/D…
==============================================================================
--- trunk/reactos/dll/win32/devmgr/devmgmt/DeviceView.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/devmgr/devmgmt/DeviceView.cpp [iso-8859-1] Thu Jun 25 20:34:57
2015
@@ -311,6 +311,21 @@
CDeviceNode *Node = dynamic_cast<CDeviceNode *>(GetSelectedNode());
if (Node)
{
+ if (Enable == false)
+ {
+ CAtlStringW str;
+ if (str.LoadStringW(g_hInstance, IDS_CONFIRM_DISABLE))
+ {
+ if (MessageBoxW(m_hMainWnd,
+ str,
+ Node->GetDisplayName(),
+ MB_YESNO | MB_ICONWARNING | MB_DEFBUTTON2) != IDYES)
+ {
+ return false;
+ }
+ }
+ }
+
if (Node->EnableDevice(Enable, NeedsReboot))
{
Refresh(m_ViewType, true, true);
Modified: trunk/reactos/dll/win32/devmgr/devmgmt/MainWindow.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr/devmgmt/M…
==============================================================================
--- trunk/reactos/dll/win32/devmgr/devmgmt/MainWindow.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/devmgr/devmgmt/MainWindow.cpp [iso-8859-1] Thu Jun 25 20:34:57
2015
@@ -49,19 +49,6 @@
};
-
-
-
-#define IDS_HINT_BLANK 20000
-#define IDS_HINT_PROPERTIES 20001
-#define IDS_HINT_SCAN 20002
-#define IDS_HINT_ENABLE 20003
-#define IDS_HINT_DISABLE 20004
-#define IDS_HINT_UPDATE 20005
-#define IDS_HINT_UNINSTALL 20006
-#define IDS_HINT_ADD 20007
-#define IDS_HINT_ABOUT 20008
-#define IDS_HINT_EXIT 20009
// system menu hints
static const MENU_HINT SystemMenuHintTable[] =
Modified: trunk/reactos/dll/win32/devmgr/devmgmt/Resource.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr/devmgmt/R…
==============================================================================
--- trunk/reactos/dll/win32/devmgr/devmgmt/Resource.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/devmgr/devmgmt/Resource.h [iso-8859-1] Thu Jun 25 20:34:57
2015
@@ -1,4 +1,6 @@
#define IDC_STATIC -1
+
+#define IDS_APPNAME 10
#define IDI_MAIN_ICON 20
#define IDB_ROOT_IMAGE 21
@@ -29,31 +31,27 @@
#define IDC_RESBYCONN 203
#define IDC_SHOWHIDDEN 204
-/* about box info */
-#define IDD_ABOUTBOX 300
-#define IDC_LICENSE_EDIT 301
-#define IDS_APPNAME 302
-#define IDS_LICENSE 303
/* tooltips */
-#define IDS_TOOLTIP_PROPERTIES 6000
-#define IDS_TOOLTIP_SCAN 6001
-#define IDS_TOOLTIP_ENABLE 6002
-#define IDS_TOOLTIP_DIABLE 6003
-#define IDS_TOOLTIP_UPDATE 6004
-#define IDS_TOOLTIP_UNINSTALL 6005
+#define IDS_TOOLTIP_PROPERTIES 300
+#define IDS_TOOLTIP_SCAN 301
+#define IDS_TOOLTIP_ENABLE 302
+#define IDS_TOOLTIP_DIABLE 303
+#define IDS_TOOLTIP_UPDATE 304
+#define IDS_TOOLTIP_UNINSTALL 305
-
+/* General strings */
+#define IDS_CONFIRM_DISABLE 400
/* menu hints */
-#define IDS_HINT_BLANK 20000
-#define IDS_HINT_PROPERTIES 20001
-#define IDS_HINT_SCAN 20002
-#define IDS_HINT_ENABLE 20003
-#define IDS_HINT_DISABLE 20004
-#define IDS_HINT_UPDATE 20005
-#define IDS_HINT_UNINSTALL 20006
-#define IDS_HINT_ADD 20007
+#define IDS_HINT_BLANK 1000
+#define IDS_HINT_PROPERTIES 1001
+#define IDS_HINT_SCAN 1002
+#define IDS_HINT_ENABLE 1003
+#define IDS_HINT_DISABLE 1004
+#define IDS_HINT_UPDATE 1005
+#define IDS_HINT_UNINSTALL 1006
+#define IDS_HINT_ADD 1007
#define IDS_HINT_ABOUT 20008
#define IDS_HINT_EXIT 20009
Modified: trunk/reactos/dll/win32/devmgr/devmgmt/lang/en-US.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr/devmgmt/l…
==============================================================================
--- trunk/reactos/dll/win32/devmgr/devmgmt/lang/en-US.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/devmgr/devmgmt/lang/en-US.rc [iso-8859-1] Thu Jun 25 20:34:57
2015
@@ -49,12 +49,12 @@
END
END
-#define IDS_HINT_PROPERTIES 20001
-#define IDS_HINT_SCAN 20002
-#define IDS_HINT_ENABLE 20003
-#define IDS_HINT_DISABLE 20004
-#define IDS_HINT_UPDATE 20005
-#define IDS_HINT_UNINSTALL 20006
+
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_CONFIRM_DISABLE "Disabling this device will cause it to stop
functioning.\r\nDo you really want to disable it?"
+END
STRINGTABLE DISCARDABLE
BEGIN