1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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 );
}
|