Author: gschneider
Date: Sat Apr 3 19:23:27 2010
New Revision: 46699
URL:
http://svn.reactos.org/svn/reactos?rev=46699&view=rev
Log:
[taskmgr] Hide CPU graph options on single CPU systems
See issue #2144 for more details.
Modified:
trunk/reactos/base/applications/taskmgr/taskmgr.c
Modified: trunk/reactos/base/applications/taskmgr/taskmgr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/taskmgr/…
==============================================================================
--- trunk/reactos/base/applications/taskmgr/taskmgr.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/taskmgr/taskmgr.c [iso-8859-1] Sat Apr 3 19:23:27
2010
@@ -869,6 +869,7 @@
HMENU hViewMenu;
HMENU hSubMenu;
WCHAR szTemp[256];
+ SYSTEM_INFO sysInfo;
hMenu = GetMenu(hMainWnd);
hViewMenu = GetSubMenu(hMenu, 2);
@@ -947,16 +948,28 @@
DeleteMenu(hMenu, 3, MF_BYPOSITION);
DrawMenuBar(hMainWnd);
}
- hSubMenu = CreatePopupMenu();
-
- LoadStringW(hInst, IDS_MENU_ONEGRAPHALLCPUS, szTemp, 256);
- AppendMenuW(hSubMenu, MF_STRING, ID_VIEW_CPUHISTORY_ONEGRAPHALL, szTemp);
-
- LoadStringW(hInst, IDS_MENU_ONEGRAPHPERCPU, szTemp, 256);
- AppendMenuW(hSubMenu, MF_STRING, ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU, szTemp);
-
- LoadStringW(hInst, IDS_MENU_CPUHISTORY, szTemp, 256);
- AppendMenuW(hViewMenu, MF_STRING|MF_POPUP, (UINT_PTR) hSubMenu, szTemp);
+
+ GetSystemInfo(&sysInfo);
+
+ /* Hide CPU graph options on single CPU systems */
+ if (sysInfo.dwNumberOfProcessors > 1)
+ {
+ hSubMenu = CreatePopupMenu();
+
+ LoadStringW(hInst, IDS_MENU_ONEGRAPHALLCPUS, szTemp, 256);
+ AppendMenuW(hSubMenu, MF_STRING, ID_VIEW_CPUHISTORY_ONEGRAPHALL, szTemp);
+
+ LoadStringW(hInst, IDS_MENU_ONEGRAPHPERCPU, szTemp, 256);
+ AppendMenuW(hSubMenu, MF_STRING, ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU, szTemp);
+
+ LoadStringW(hInst, IDS_MENU_CPUHISTORY, szTemp, 256);
+ AppendMenuW(hViewMenu, MF_STRING|MF_POPUP, (UINT_PTR) hSubMenu, szTemp);
+
+ if (TaskManagerSettings.CPUHistory_OneGraphPerCPU)
+ CheckMenuRadioItem(hSubMenu, ID_VIEW_CPUHISTORY_ONEGRAPHALL,
ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU, ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU, MF_BYCOMMAND);
+ else
+ CheckMenuRadioItem(hSubMenu, ID_VIEW_CPUHISTORY_ONEGRAPHALL,
ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU, ID_VIEW_CPUHISTORY_ONEGRAPHALL, MF_BYCOMMAND);
+ }
LoadStringW(hInst, IDS_MENU_SHOWKERNELTIMES, szTemp, 256);
AppendMenuW(hViewMenu, MF_STRING, ID_VIEW_SHOWKERNELTIMES, szTemp);
@@ -965,10 +978,7 @@
CheckMenuItem(hViewMenu, ID_VIEW_SHOWKERNELTIMES, MF_BYCOMMAND|MF_CHECKED);
else
CheckMenuItem(hViewMenu, ID_VIEW_SHOWKERNELTIMES,
MF_BYCOMMAND|MF_UNCHECKED);
- if (TaskManagerSettings.CPUHistory_OneGraphPerCPU)
- CheckMenuRadioItem(hSubMenu, ID_VIEW_CPUHISTORY_ONEGRAPHALL,
ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU, ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU, MF_BYCOMMAND);
- else
- CheckMenuRadioItem(hSubMenu, ID_VIEW_CPUHISTORY_ONEGRAPHALL,
ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU, ID_VIEW_CPUHISTORY_ONEGRAPHALL, MF_BYCOMMAND);
+
/*
* Give the tab control focus
*/