forked from KolibriOS/kolibrios
Apps/sysmon: Fixed #85
Small code changes to fix all issues mentioned in Issue #85: - Bumped app version and added it to header. - Changed system disk usage subscription from MB to KB in English version. - Properly aligned CPU usage percents in process list with header. - Free space on disks now rounds down, instead of rounding app. - Small formatting fixes. - Fixed wrong language set in English version of compilation script. Co-authored-by: Taldariner <71024372+Taldariner@users.noreply.github.com> Reviewed-on: KolibriOS/kolibrios#86 Reviewed-by: Max Logaev <mxlgv@noreply.localhost> Reviewed-by: Mikhail Frolov <mixa.frolov2003@gmail.com> Co-authored-by: Burer <burer@noreply.localhost> Co-committed-by: Burer <burer@noreply.localhost>
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
@del sysmon
|
@del sysmon
|
||||||
@c-- /D=LANG_RUS sysmon.c
|
@c-- /D=LANG_ENG sysmon.c
|
||||||
@rename sysmon.com sysmon
|
@rename sysmon.com sysmon
|
||||||
@del warning.txt
|
@del warning.txt
|
||||||
if not exist sysmon ( @pause )
|
if not exist sysmon ( @pause )
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* System Monitor
|
* System Monitor
|
||||||
* version 1.41
|
* version 1.42
|
||||||
* Author: Leency
|
* Author: Leency
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
#define BOTPANEL_H 36
|
#define BOTPANEL_H 36
|
||||||
|
|
||||||
#ifdef LANG_RUS
|
#ifdef LANG_RUS
|
||||||
#define T_APP_TITLE "<22><><EFBFBD>⥬<EFBFBD><E2A5AC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
#define T_APP_TITLE "<22><><EFBFBD>⥬<EFBFBD><E2A5AC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1.42"
|
||||||
#define T_SHOW_SYSTEM "<22><><EFBFBD>⥬<EFBFBD><E2A5AC><EFBFBD>"
|
#define T_SHOW_SYSTEM "<22><><EFBFBD>⥬<EFBFBD><E2A5AC><EFBFBD>"
|
||||||
#define T_DETAILS "<22><><EFBFBD><EFBFBD><E0AEA1><EFBFBD>"
|
#define T_DETAILS "<22><><EFBFBD><EFBFBD><E0AEA1><EFBFBD>"
|
||||||
#define T_PROC_KILL "<22><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
#define T_PROC_KILL "<22><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
#define T_RD_USAGE "<22><><EFBFBD>⥬<EFBFBD><E2A5AC><EFBFBD> <20><><EFBFBD><EFBFBD>: %i <20><> <><E1A2AE><EFBFBD><EFBFBD><EFBFBD> <20><> 1.4 <20><>"
|
#define T_RD_USAGE "<22><><EFBFBD>⥬<EFBFBD><E2A5AC><EFBFBD> <20><><EFBFBD><EFBFBD>: %i <20><> <><E1A2AE><EFBFBD><EFBFBD><EFBFBD> <20><> 1.4 <20><>"
|
||||||
#define T_TMP_USAGE "TMP%i <20><><EFBFBD><EFBFBD>: %i <20><> <><E1A2AE><EFBFBD><EFBFBD><EFBFBD> <20><> %i <20><>"
|
#define T_TMP_USAGE "TMP%i <20><><EFBFBD><EFBFBD>: %i <20><> <><E1A2AE><EFBFBD><EFBFBD><EFBFBD> <20><> %i <20><>"
|
||||||
#else
|
#else
|
||||||
#define T_APP_TITLE "System Monitor"
|
#define T_APP_TITLE "System Monitor 1.42"
|
||||||
#define T_SHOW_SYSTEM "System"
|
#define T_SHOW_SYSTEM "System"
|
||||||
#define T_DETAILS "Details"
|
#define T_DETAILS "Details"
|
||||||
#define T_PROC_KILL "Terminate"
|
#define T_PROC_KILL "Terminate"
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
#define T_PROC_HEADER "Process RAM KB CPU %"
|
#define T_PROC_HEADER "Process RAM KB CPU %"
|
||||||
#define T_CPU_LOAD "CPU load %i%% "
|
#define T_CPU_LOAD "CPU load %i%% "
|
||||||
#define T_RAM_USAGE "RAM usage: %i MB free of %i MB"
|
#define T_RAM_USAGE "RAM usage: %i MB free of %i MB"
|
||||||
#define T_RD_USAGE "System disk usage: %i MB free of 1.4 MB"
|
#define T_RD_USAGE "System disk usage: %i KB free of 1.4 MB"
|
||||||
#define T_TMP_USAGE "TMP%i usage: %i MB free of %i MB"
|
#define T_TMP_USAGE "TMP%i usage: %i MB free of %i MB"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -156,7 +156,7 @@ void main()
|
|||||||
break;
|
break;
|
||||||
case evReDraw:
|
case evReDraw:
|
||||||
sc.get();
|
sc.get();
|
||||||
DefineAndDrawWindow(Form.left, Form.top, Form.width, Form.height, 0x33, sc.work, T_APP_TITLE,0);
|
DefineAndDrawWindow(Form.left, Form.top, Form.width, Form.height, 0x33, sc.work, T_APP_TITLE, 0);
|
||||||
_DRAW_WINDOW:
|
_DRAW_WINDOW:
|
||||||
GetProcessInfo(#Form, SelfInfo);
|
GetProcessInfo(#Form, SelfInfo);
|
||||||
if (Form.status_window&ROLLED_UP) break;
|
if (Form.status_window&ROLLED_UP) break;
|
||||||
@@ -281,7 +281,7 @@ void SelectList_DrawLine(dword i)
|
|||||||
}
|
}
|
||||||
|
|
||||||
sprintf(#cpu_use, "%i", Process.use_cpu*100/maxcpu);
|
sprintf(#cpu_use, "%i", Process.use_cpu*100/maxcpu);
|
||||||
if (maxcpu) WriteText(GAP+203 - calc(strlen(#cpu_use)-4*8),
|
if (maxcpu) WriteText(GAP+205 - calc(strlen(#cpu_use)-4*8),
|
||||||
posy+select_list.text_y, 0x90, 0x444444, #cpu_use);
|
posy+select_list.text_y, 0x90, 0x444444, #cpu_use);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -311,6 +311,7 @@ dword GetTmpDiskFreeSpace(int _id)
|
|||||||
sprintf(#param, "/tmp%i/1", _id);
|
sprintf(#param, "/tmp%i/1", _id);
|
||||||
dir_size.get(#param);
|
dir_size.get(#param);
|
||||||
dir_size.sizelo += dir_size.files/2 + 32 * 512; //file attr size + FAT table size
|
dir_size.sizelo += dir_size.files/2 + 32 * 512; //file attr size + FAT table size
|
||||||
|
dir_size.sizelo += 1024*1024 - 1; // add this line to round up
|
||||||
dir_size.sizelo /= 1024*1024; //convert to MiB
|
dir_size.sizelo /= 1024*1024; //convert to MiB
|
||||||
return dir_size.sizelo;
|
return dir_size.sizelo;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user