Author: gedmurphy
Date: Sat Jul 4 13:40:17 2015
New Revision: 68338
URL:
http://svn.reactos.org/svn/reactos?rev=68338&view=rev
Log:
[DEVMGR]
Replace hard coded strings with resources
Modified:
trunk/reactos/dll/win32/devmgr/devmgmt/DeviceView.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/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] Sat Jul 4 13:40:17
2015
@@ -811,6 +811,7 @@
MenuItemInfo.fMask = MIIM_ID | MIIM_STRING | MIIM_DATA | MIIM_SUBMENU;
MenuItemInfo.fType = MFT_STRING;
+ CAtlStringW String;
int i = 0;
// Device nodes have extra data
@@ -820,32 +821,36 @@
if (DeviceNode->CanUpdate())
{
+ String.LoadStringW(g_hInstance, IDS_MENU_UPDATE);
MenuItemInfo.wID = IDC_UPDATE_DRV;
- MenuItemInfo.dwTypeData = L"Update driver software...";
+ MenuItemInfo.dwTypeData = String.GetBuffer();
InsertMenuItemW(hContextMenu, i, TRUE, &MenuItemInfo);
i++;
}
if (DeviceNode->IsDisabled())
{
+ String.LoadStringW(g_hInstance, IDS_MENU_ENABLE);
MenuItemInfo.wID = IDC_ENABLE_DRV;
- MenuItemInfo.dwTypeData = L"Enable";
+ MenuItemInfo.dwTypeData = String.GetBuffer();
InsertMenuItemW(hContextMenu, i, TRUE, &MenuItemInfo);
i++;
}
if (DeviceNode->CanDisable() && !DeviceNode->IsDisabled())
{
+ String.LoadStringW(g_hInstance, IDS_MENU_DISABLE);
MenuItemInfo.wID = IDC_DISABLE_DRV;
- MenuItemInfo.dwTypeData = L"Disable";
+ MenuItemInfo.dwTypeData = String.GetBuffer();
InsertMenuItemW(hContextMenu, i, TRUE, &MenuItemInfo);
i++;
}
if (DeviceNode->CanUninstall())
{
+ String.LoadStringW(g_hInstance, IDS_MENU_UNINSTALL);
MenuItemInfo.wID = IDC_UNINSTALL_DRV;
- MenuItemInfo.dwTypeData = L"Uninstall";
+ MenuItemInfo.dwTypeData = String.GetBuffer();
InsertMenuItemW(hContextMenu, i, TRUE, &MenuItemInfo);
i++;
}
@@ -855,8 +860,9 @@
}
// All nodes have the scan option
+ String.LoadStringW(g_hInstance, IDS_MENU_SCAN);
MenuItemInfo.wID = IDC_SCAN_HARDWARE;
- MenuItemInfo.dwTypeData = L"Scan for hardware changes";
+ MenuItemInfo.dwTypeData = String.GetBuffer();
InsertMenuItemW(hContextMenu, i, TRUE, &MenuItemInfo);
i++;
@@ -865,8 +871,9 @@
InsertMenuItemW(hContextMenu, i, TRUE, &MenuSeperator);
i++;
+ String.LoadStringW(g_hInstance, IDS_MENU_PROPERTIES);
MenuItemInfo.wID = IDC_PROPERTIES;
- MenuItemInfo.dwTypeData = L"Properties";
+ MenuItemInfo.dwTypeData = String.GetBuffer();
InsertMenuItemW(hContextMenu, i, TRUE, &MenuItemInfo);
i++;
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] Sat Jul 4 13:40:17
2015
@@ -43,6 +43,16 @@
/* General strings */
#define IDS_CONFIRM_DISABLE 400
+/* Menu strings */
+#define IDS_MENU_UPDATE 500
+#define IDS_MENU_ENABLE 501
+#define IDS_MENU_DISABLE 502
+#define IDS_MENU_UNINSTALL 503
+#define IDS_MENU_SCAN 504
+#define IDS_MENU_ADD 505
+#define IDS_MENU_PROPERTIES 506
+
+
/* menu hints */
#define IDS_HINT_BLANK 1000
#define IDS_HINT_PROPERTIES 1001
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] Sat Jul 4 13:40:17
2015
@@ -33,27 +33,20 @@
END
END
-IDR_POPUP MENU
-BEGIN
- POPUP "popup"
- BEGIN
- MENUITEM "Update driver software..." IDC_UPDATE_DRV
- MENUITEM "Enable" IDC_ENABLE_DRV
- MENUITEM "Disable" IDC_DISABLE_DRV
- MENUITEM "Uninstall" IDC_UNINSTALL_DRV
- MENUITEM SEPARATOR
- MENUITEM "Scan for hardware changes" IDC_SCAN_HARDWARE
- MENUITEM "Add hardware" IDC_ADD_HARDWARE, GRAYED
- MENUITEM SEPARATOR
- MENUITEM "Properties", IDC_PROPERTIES
- END
-END
-
-
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
+ IDS_MENU_UPDATE "Update driver software..."
+ IDS_MENU_ENABLE "Enable"
+ IDS_MENU_DISABLE "Disable"
+ IDS_MENU_UNINSTALL "Uninstall"
+ IDS_MENU_SCAN "Scan for hardware changes"
+ IDS_MENU_ADD "Add hardware"
+ IDS_MENU_PROPERTIES "Properties"
END
STRINGTABLE DISCARDABLE