wmppp.app: Display speed in K when too high.
When the download speed is too high, wmppp can't display it because it has only 5 digit. The most significant digits are hidden ! This small patch display the speed in K when it is too high. Based on the patch by jguiton <jguiton@free.fr>. See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=328699.
This commit is contained in:
parent
e81a5eb522
commit
ae3f75c09e
|
@ -771,6 +771,11 @@ void DrawStats(int *his, int num, int size, int x_left, int y_bottom) {
|
||||||
void PrintLittle(int i, int *k) {
|
void PrintLittle(int i, int *k) {
|
||||||
|
|
||||||
switch (i) {
|
switch (i) {
|
||||||
|
case -2:
|
||||||
|
*k -= 5;
|
||||||
|
/* Print the "k" letter */
|
||||||
|
copyXPMArea(11*5-5, 86, 4, 9, *k, 48);
|
||||||
|
break;
|
||||||
case -1:
|
case -1:
|
||||||
*k -= 5;
|
*k -= 5;
|
||||||
copyXPMArea(13*5-5, 86, 4, 9, *k, 48);
|
copyXPMArea(13*5-5, 86, 4, 9, *k, 48);
|
||||||
|
@ -836,6 +841,13 @@ void DrawLoadInd(int speed) {
|
||||||
|
|
||||||
k = 30;
|
k = 30;
|
||||||
|
|
||||||
|
/* If speed is greater than 99999, display it in K */
|
||||||
|
if (speed > 99999 )
|
||||||
|
{
|
||||||
|
speed /= 1024 ;
|
||||||
|
PrintLittle(-2, &k) ;
|
||||||
|
}
|
||||||
|
|
||||||
do {
|
do {
|
||||||
PrintLittle(speed % 10, &k);
|
PrintLittle(speed % 10, &k);
|
||||||
speed /= 10;
|
speed /= 10;
|
||||||
|
|
Loading…
Reference in a new issue