summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/networksettings2/netnode.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/noncore/settings/networksettings2/networksettings2/netnode.cpp b/noncore/settings/networksettings2/networksettings2/netnode.cpp
index 4a2440a..110786a 100644
--- a/noncore/settings/networksettings2/networksettings2/netnode.cpp
+++ b/noncore/settings/networksettings2/networksettings2/netnode.cpp
@@ -1,18 +1,21 @@
1#include <time.h> 1#include <time.h>
2#include <qpe/qpeapplication.h> 2#include <qpe/qpeapplication.h>
3#include <qpe/resource.h>
4
5
3#include <qpainter.h> 6#include <qpainter.h>
4#include <qbitmap.h> 7#include <qbitmap.h>
5#include <qtextstream.h> 8#include <qtextstream.h>
6#include <qpixmap.h> 9#include <qpixmap.h>
7 10
8#include "resources.h" 11#include "resources.h"
9#include "netnode.h" 12#include "netnode.h"
10 13
11#include "asdevice.h" 14#include "asdevice.h"
12#include "asline.h" 15#include "asline.h"
13#include "asconnection.h" 16#include "asconnection.h"
14#include "asfullsetup.h" 17#include "asfullsetup.h"
15 18
16QString & deQuote( QString & X ) { 19QString & deQuote( QString & X ) {
17 if( X[0] == '"' ) { 20 if( X[0] == '"' ) {
18 // remove end and trailing "" and \x -> x 21 // remove end and trailing "" and \x -> x
@@ -240,32 +243,35 @@ int NodeCollection::compareItems( QCollection::Item I1,
240static char * State2PixmapTbl[] = { 243static char * State2PixmapTbl[] = {
241 "NULL", // Unchecked : no pixmap 244 "NULL", // Unchecked : no pixmap
242 "check", // Unknown 245 "check", // Unknown
243 "delete", // unavailable 246 "delete", // unavailable
244 "disabled", // disabled 247 "disabled", // disabled
245 "off", // off 248 "off", // off
246 "disconnected", // available 249 "disconnected", // available
247 "connected" // up 250 "connected" // up
248}; 251};
249 252
250QPixmap NodeCollection::devicePixmap( void ) { 253QPixmap NodeCollection::devicePixmap( void ) {
251 QPixmap pm = NSResources->getPixmap( 254 QPixmap pm = NSResources->getPixmap(
252 getToplevel()->nextNode()->pixmapName()+"-large"); 255 getToplevel()->nextNode()->pixmapName()+"-large");
253 256
254 QPixmap Mini = NSResources->getPixmap( device()->netNode()->pixmapName() ); 257 QPixmap Mini = NSResources->getPixmap( device()->netNode()->pixmapName() );
255 258
259 if( pm.isNull() || Mini.isNull() )
260 return Resource::loadPixmap("Unknown");
261
256 QPainter painter( &pm ); 262 QPainter painter( &pm );
257 painter.drawPixmap( pm.width()-Mini.width(), 263 painter.drawPixmap( pm.width()-Mini.width(),
258 pm.height()-Mini.height(), 264 pm.height()-Mini.height(),
259 Mini ); 265 Mini );
260 pm.setMask( pm.createHeuristicMask( TRUE ) ); 266 pm.setMask( pm.createHeuristicMask( TRUE ) );
261 return pm; 267 return pm;
262} 268}
263 269
264QPixmap NodeCollection::statePixmap( State_t S) { 270QPixmap NodeCollection::statePixmap( State_t S) {
265 return NSResources->getPixmap( State2PixmapTbl[S] ); 271 return NSResources->getPixmap( State2PixmapTbl[S] );
266} 272}
267 273
268QString NodeCollection::stateName( State_t S) { 274QString NodeCollection::stateName( State_t S) {
269 switch( S ) { 275 switch( S ) {
270 case Unknown : 276 case Unknown :
271 return qApp->translate( "networksettings2", "Unknown"); 277 return qApp->translate( "networksettings2", "Unknown");