Diffstat (limited to 'noncore/net/wellenreiter/gui/scanlist.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/scanlist.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp index 587faad..a61e808 100644 --- a/noncore/net/wellenreiter/gui/scanlist.cpp +++ b/noncore/net/wellenreiter/gui/scanlist.cpp | |||
@@ -1,48 +1,48 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002-2004 Michael 'Mickey' Lauer. All rights reserved. | 2 | ** Copyright (C) 2002-2004 Michael 'Mickey' Lauer. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Wellenreiter II. | 4 | ** This file is part of Wellenreiter II. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | **********************************************************************/ | 14 | **********************************************************************/ |
15 | 15 | ||
16 | #include "scanlist.h" | 16 | #include "scanlist.h" |
17 | #include "configwindow.h" | 17 | #include "configwindow.h" |
18 | #include "logwindow.h" | 18 | #include "logwindow.h" |
19 | 19 | ||
20 | /* OPIE */ | 20 | /* OPIE */ |
21 | #ifdef QWS | 21 | #ifdef QWS |
22 | #include <opie2/odebug.h> | 22 | #include <opie2/odebug.h> |
23 | #include <opie2/oresource.h> | ||
23 | #include <qpe/qpeapplication.h> | 24 | #include <qpe/qpeapplication.h> |
24 | #include <qpe/resource.h> | ||
25 | #else | 25 | #else |
26 | #include "resource.h" | 26 | #include "resource.h" |
27 | #endif | 27 | #endif |
28 | 28 | ||
29 | 29 | ||
30 | /* QT */ | 30 | /* QT */ |
31 | #include <qcursor.h> | 31 | #include <qcursor.h> |
32 | #include <qdatetime.h> | 32 | #include <qdatetime.h> |
33 | #include <qpopupmenu.h> | 33 | #include <qpopupmenu.h> |
34 | #include <qcheckbox.h> | 34 | #include <qcheckbox.h> |
35 | 35 | ||
36 | /* STD */ | 36 | /* STD */ |
37 | #include <assert.h> | 37 | #include <assert.h> |
38 | 38 | ||
39 | using namespace Opie::Core; | 39 | using namespace Opie::Core; |
40 | using namespace Opie::Ui; | 40 | using namespace Opie::Ui; |
41 | using namespace Opie::Net; | 41 | using namespace Opie::Net; |
42 | 42 | ||
43 | const int col_type = 0; | 43 | const int col_type = 0; |
44 | const int col_essid = 0; | 44 | const int col_essid = 0; |
45 | const int col_sig = 1; | 45 | const int col_sig = 1; |
46 | const int col_ap = 2; | 46 | const int col_ap = 2; |
47 | const int col_channel = 3; | 47 | const int col_channel = 3; |
48 | const int col_wep = 4; | 48 | const int col_wep = 4; |
@@ -456,76 +456,76 @@ OListViewItem* MScanListItem::childFactory() | |||
456 | void MScanListItem::serializeTo( QDataStream& s ) const | 456 | void MScanListItem::serializeTo( QDataStream& s ) const |
457 | { | 457 | { |
458 | #ifdef DEBUG | 458 | #ifdef DEBUG |
459 | odebug << "serializing MScanListItem" << oendl; | 459 | odebug << "serializing MScanListItem" << oendl; |
460 | #endif | 460 | #endif |
461 | OListViewItem::serializeTo( s ); | 461 | OListViewItem::serializeTo( s ); |
462 | 462 | ||
463 | s << _type; | 463 | s << _type; |
464 | s << (Q_UINT8) ( _wep ? 'y' : 'n' ); | 464 | s << (Q_UINT8) ( _wep ? 'y' : 'n' ); |
465 | } | 465 | } |
466 | 466 | ||
467 | void MScanListItem::serializeFrom( QDataStream& s ) | 467 | void MScanListItem::serializeFrom( QDataStream& s ) |
468 | { | 468 | { |
469 | #ifdef DEBUG | 469 | #ifdef DEBUG |
470 | odebug << "serializing MScanListItem" << oendl; | 470 | odebug << "serializing MScanListItem" << oendl; |
471 | #endif | 471 | #endif |
472 | OListViewItem::serializeFrom( s ); | 472 | OListViewItem::serializeFrom( s ); |
473 | 473 | ||
474 | Q_UINT8 wep; | 474 | Q_UINT8 wep; |
475 | s >> _type; | 475 | s >> _type; |
476 | s >> wep; | 476 | s >> wep; |
477 | _wep = (wep == 'y'); | 477 | _wep = (wep == 'y'); |
478 | 478 | ||
479 | QString name = QString( "wellenreiter/"+ _type ); | 479 | QString name = QString( "wellenreiter/"+ _type ); |
480 | setPixmap( col_type, Resource::loadPixmap( name ) ); | 480 | setPixmap( col_type, Opie::Core::OResource::loadPixmap( name, Opie::Core::OResource::SmallIcon ) ); |
481 | if ( _wep ) | 481 | if ( _wep ) |
482 | setPixmap( col_wep, Resource::loadPixmap( "wellenreiter/cracked" ) ); //FIXME: rename the pixmap! | 482 | setPixmap( col_wep, Opie::Core::OResource::loadPixmap( "wellenreiter/cracked", Opie::Core::OResource::SmallIcon ) ); //FIXME: rename the pixmap! |
483 | listView()->triggerUpdate(); | 483 | listView()->triggerUpdate(); |
484 | } | 484 | } |
485 | 485 | ||
486 | void MScanListItem::decorateItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal, bool probed ) | 486 | void MScanListItem::decorateItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal, bool probed ) |
487 | { | 487 | { |
488 | #ifdef DEBUG | 488 | #ifdef DEBUG |
489 | odebug << "decorating scanlist item " << type << " / " | 489 | odebug << "decorating scanlist item " << type << " / " |
490 | << essid << " / " << macaddr | 490 | << essid << " / " << macaddr |
491 | << "[" << channel << "]" << oendl; | 491 | << "[" << channel << "]" << oendl; |
492 | #endif | 492 | #endif |
493 | 493 | ||
494 | // set icon for managed or adhoc mode | 494 | // set icon for managed or adhoc mode |
495 | QString name; | 495 | QString name; |
496 | name.sprintf( "wellenreiter/"+ type ); | 496 | name.sprintf( "wellenreiter/"+ type ); |
497 | setPixmap( col_type, Resource::loadPixmap( name ) ); | 497 | setPixmap( col_type, Opie::Core::OResource::loadPixmap( name, Opie::Core::OResource::SmallIcon ) ); |
498 | 498 | ||
499 | // special case for probed networks FIXME: This is ugly at present | 499 | // special case for probed networks FIXME: This is ugly at present |
500 | if ( type == "network" && probed ) | 500 | if ( type == "network" && probed ) |
501 | { | 501 | { |
502 | setPixmap( col_type, Resource::loadPixmap( "wellenreiter/network-probed.png" ) ); | 502 | setPixmap( col_type, Opie::Core::OResource::loadPixmap( "wellenreiter/network-probed", Opie::Core::OResource::SmallIcon ) ); |
503 | } | 503 | } |
504 | 504 | ||
505 | // set icon for wep (wireless encryption protocol) | 505 | // set icon for wep (wireless encryption protocol) |
506 | if ( wep ) | 506 | if ( wep ) |
507 | setPixmap( col_wep, Resource::loadPixmap( "wellenreiter/cracked" ) ); //FIXME: rename the pixmap! | 507 | setPixmap( col_wep, Opie::Core::OResource::loadPixmap( "wellenreiter/cracked", Opie::Core::OResource::SmallIcon ) ); //FIXME: rename the pixmap! |
508 | 508 | ||
509 | // set channel and signal text | 509 | // set channel and signal text |
510 | 510 | ||
511 | if ( signal != -1 ) | 511 | if ( signal != -1 ) |
512 | setText( col_sig, QString::number( signal ) ); | 512 | setText( col_sig, QString::number( signal ) ); |
513 | if ( channel != -1 ) | 513 | if ( channel != -1 ) |
514 | setText( col_channel, QString::number( channel ) ); | 514 | setText( col_channel, QString::number( channel ) ); |
515 | 515 | ||
516 | setText( col_firstseen, QTime::currentTime().toString() ); | 516 | setText( col_firstseen, QTime::currentTime().toString() ); |
517 | //setText( col_lastseen, QTime::currentTime().toString() ); | 517 | //setText( col_lastseen, QTime::currentTime().toString() ); |
518 | 518 | ||
519 | listView()->triggerUpdate(); | 519 | listView()->triggerUpdate(); |
520 | 520 | ||
521 | this->type = type; | 521 | this->type = type; |
522 | _type = type; | 522 | _type = type; |
523 | _essid = essid; | 523 | _essid = essid; |
524 | _macaddr = macaddr; | 524 | _macaddr = macaddr; |
525 | _channel = channel; | 525 | _channel = channel; |
526 | _beacons = 1; | 526 | _beacons = 1; |
527 | _signal = 0; | 527 | _signal = 0; |
528 | 528 | ||
529 | if ( WellenreiterConfigWindow::instance()->openTree->isChecked() ) | 529 | if ( WellenreiterConfigWindow::instance()->openTree->isChecked() ) |
530 | { | 530 | { |
531 | listView()->ensureItemVisible( this ); | 531 | listView()->ensureItemVisible( this ); |