summaryrefslogtreecommitdiff
path: root/noncore/net/opiestumbler/stationviewitem.cpp
authorskyhusker <skyhusker>2005-04-20 10:25:20 (UTC)
committer skyhusker <skyhusker>2005-04-20 10:25:20 (UTC)
commite439d0e6eaa6704a8b1b89ea32aa8a0520738a04 (patch) (side-by-side diff)
tree18c8b1eba5e1836f757765e4204d638500aa79f2 /noncore/net/opiestumbler/stationviewitem.cpp
parentf6b9c85c09692f298ffa5ee95e1f171a9e158502 (diff)
downloadopie-e439d0e6eaa6704a8b1b89ea32aa8a0520738a04.zip
opie-e439d0e6eaa6704a8b1b89ea32aa8a0520738a04.tar.gz
opie-e439d0e6eaa6704a8b1b89ea32aa8a0520738a04.tar.bz2
First commit of OpieStumbler, an application which performs wireless networks scanning using Wireless Extensions
Diffstat (limited to 'noncore/net/opiestumbler/stationviewitem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opiestumbler/stationviewitem.cpp52
1 files changed, 52 insertions, 0 deletions
diff --git a/noncore/net/opiestumbler/stationviewitem.cpp b/noncore/net/opiestumbler/stationviewitem.cpp
new file mode 100644
index 0000000..64223d7
--- a/dev/null
+++ b/noncore/net/opiestumbler/stationviewitem.cpp
@@ -0,0 +1,52 @@
+#include <qpalette.h>
+#include <qcolor.h>
+
+
+#include "stationviewitem.h"
+#include "opiestumbler.h"
+
+StationViewItem::StationViewItem( QListView *parent, const QString &ssid,
+ const QString &channel, const QString &level, const QString &enc,
+ const QString &mac )
+ : QListViewItem( parent, ssid, channel, level, enc, mac )
+{
+}
+
+StationViewItem::StationViewItem( QListView *parent, const QString &ssid,
+ const QString &channel, const QString &level, const QString &enc,
+ const QString &vendor, const QString &mac )
+
+: QListViewItem( parent, ssid, channel, level, enc, vendor, mac )
+{
+}
+
+void StationViewItem::paintCell( QPainter *p, const QColorGroup &cg,
+ int column, int width, int alignment )
+{
+ QColor c;
+ QColorGroup ch(cg);
+
+ if ( column == OpieStumbler::CURSIGNAL ) {
+ int value = text(column).toInt();
+ if ( value < 20 )
+ c.setRgb(255, 0, 0);
+ else if ( value < 35 )
+ c.setRgb(255, 255, 0);
+ else if ( value < 60 )
+ c.setRgb(0, 255, 0);
+ else
+ c.setRgb(0, 0, 255);
+ ch.setColor( QColorGroup::Text, c );
+ }
+
+ if ( column == OpieStumbler::CURSSID ) {
+ if ( text(OpieStumbler::CURENC) == "Y" )
+ c.setRgb(255, 0, 0);
+ else
+ c.setRgb(0, 255, 0);
+ ch.setColor( QColorGroup::Text, c );
+ }
+
+ QListViewItem::paintCell( p, ch, column, width, alignment );
+}
+