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 <jgui...@free.fr>.
See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=328699.
---
 wmppp.app/wmppp/wmppp.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/wmppp.app/wmppp/wmppp.c b/wmppp.app/wmppp/wmppp.c
index 93adefa..97d386f 100644
--- a/wmppp.app/wmppp/wmppp.c
+++ b/wmppp.app/wmppp/wmppp.c
@@ -771,6 +771,11 @@ void DrawStats(int *his, int num, int size, int x_left, 
int y_bottom) {
 void PrintLittle(int i, int *k) {
 
        switch (i) {
+       case -2:
+               *k -= 5;
+               /* Print the "k" letter */
+               copyXPMArea(11*5-5, 86, 4, 9, *k, 48);
+               break;
        case -1:
                *k -= 5;
                copyXPMArea(13*5-5, 86, 4, 9, *k, 48);
@@ -836,6 +841,13 @@ void DrawLoadInd(int speed) {
 
        k = 30;
 
+       /* If speed is greater than 99999, display it in K */
+       if (speed > 99999 )
+       {
+               speed /= 1024 ;
+               PrintLittle(-2, &k) ;
+       }
+
        do {
                PrintLittle(speed % 10, &k);
                speed /= 10;
-- 
1.9.1


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.

Reply via email to