author | skyhusker <skyhusker> | 2005-04-20 10:25:20 (UTC) |
---|---|---|
committer | skyhusker <skyhusker> | 2005-04-20 10:25:20 (UTC) |
commit | e439d0e6eaa6704a8b1b89ea32aa8a0520738a04 (patch) (unidiff) | |
tree | 18c8b1eba5e1836f757765e4204d638500aa79f2 /noncore/net/opiestumbler/stationviewitem.cpp | |
parent | f6b9c85c09692f298ffa5ee95e1f171a9e158502 (diff) | |
download | opie-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.cpp | 52 |
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 @@ | |||
1 | #include <qpalette.h> | ||
2 | #include <qcolor.h> | ||
3 | |||
4 | |||
5 | #include "stationviewitem.h" | ||
6 | #include "opiestumbler.h" | ||
7 | |||
8 | StationViewItem::StationViewItem( QListView *parent, const QString &ssid, | ||
9 | const QString &channel, const QString &level, const QString &enc, | ||
10 | const QString &mac ) | ||
11 | : QListViewItem( parent, ssid, channel, level, enc, mac ) | ||
12 | { | ||
13 | } | ||
14 | |||
15 | StationViewItem::StationViewItem( QListView *parent, const QString &ssid, | ||
16 | const QString &channel, const QString &level, const QString &enc, | ||
17 | const QString &vendor, const QString &mac ) | ||
18 | |||
19 | : QListViewItem( parent, ssid, channel, level, enc, vendor, mac ) | ||
20 | { | ||
21 | } | ||
22 | |||
23 | void StationViewItem::paintCell( QPainter *p, const QColorGroup &cg, | ||
24 | int column, int width, int alignment ) | ||
25 | { | ||
26 | QColor c; | ||
27 | QColorGroup ch(cg); | ||
28 | |||
29 | if ( column == OpieStumbler::CURSIGNAL ) { | ||
30 | int value = text(column).toInt(); | ||
31 | if ( value < 20 ) | ||
32 | c.setRgb(255, 0, 0); | ||
33 | else if ( value < 35 ) | ||
34 | c.setRgb(255, 255, 0); | ||
35 | else if ( value < 60 ) | ||
36 | c.setRgb(0, 255, 0); | ||
37 | else | ||
38 | c.setRgb(0, 0, 255); | ||
39 | ch.setColor( QColorGroup::Text, c ); | ||
40 | } | ||
41 | |||
42 | if ( column == OpieStumbler::CURSSID ) { | ||
43 | if ( text(OpieStumbler::CURENC) == "Y" ) | ||
44 | c.setRgb(255, 0, 0); | ||
45 | else | ||
46 | c.setRgb(0, 255, 0); | ||
47 | ch.setColor( QColorGroup::Text, c ); | ||
48 | } | ||
49 | |||
50 | QListViewItem::paintCell( p, ch, column, width, alignment ); | ||
51 | } | ||
52 | |||