summaryrefslogtreecommitdiffstats
path: root/wifi/speed.cpp
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitbcb704366cb5e333a626c18c308c7e0448a8e69f (patch)
treef0d6ab7d78ecdd9207cf46536376b44b91a1ca71 /wifi/speed.cpp
downloadtdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.tar.gz
tdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'wifi/speed.cpp')
-rw-r--r--wifi/speed.cpp64
1 files changed, 64 insertions, 0 deletions
diff --git a/wifi/speed.cpp b/wifi/speed.cpp
new file mode 100644
index 00000000..fdb7256c
--- /dev/null
+++ b/wifi/speed.cpp
@@ -0,0 +1,64 @@
+/***************************************************************************
+ speed.cpp - description
+ -------------------
+ begin : Mon Aug 19 2002
+ copyright : (C) 2002 by Stefan Winter
+ email : mail@stefan-winter.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <qpainter.h>
+#include <klocale.h>
+#include <kdebug.h>
+#include "speed.h"
+#include "interface_wireless.h"
+
+Speed::Speed (QWidget * parent, Interface_wireless * device):QWidget (parent,
+ "KWiFiManager")
+{
+ this->device = device;
+}
+
+void
+Speed::paintEvent (QPaintEvent *)
+{
+ QPainter speedpainter (this);
+ QColor farbe;
+ farbe.setRgb (0, 255, 0);
+ if (device->get_bitrate () < 6000000)
+ farbe.setRgb (0, 200, 0);
+ if (device->get_bitrate () < 2500000)
+ farbe.setRgb (255, 255, 0);
+ if (device->get_bitrate () < 1500000)
+ farbe.setRgb (255, 128, 0);
+ speedpainter.drawText (20, 20, i18n ("Connection speed [MBit/s]:"));
+ speedpainter.drawRect (19, 29, 222, 12);
+ if (device->get_bitrate () <= 11000000.)
+ {
+ speedpainter.fillRect (20, 30, (int) device->get_bitrate () / 50000,
+ 10, farbe);
+ speedpainter.drawText (16, 52, "0");
+ speedpainter.drawText (35, 52, "1");
+ speedpainter.drawText (55, 52, "2");
+ speedpainter.drawText (120, 52, "5.5");
+ speedpainter.drawText (230, 52, "11");
+ }
+ else
+ {
+ speedpainter.fillRect (20, 30, (int) device->get_bitrate () / 500000,
+ 10, farbe);
+ speedpainter.drawText (16, 52, "0");
+ speedpainter.drawText (33, 52, "11");
+ speedpainter.drawText (56, 52, "22");
+ speedpainter.drawText (120, 52, "54");
+ speedpainter.drawText (220, 52, "108");
+ };
+}