summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/scanlistitem.cpp33
-rw-r--r--noncore/net/wellenreiter/gui/scanlistitem.h14
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.cpp19
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.h4
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiterbase.ui12
5 files changed, 71 insertions, 11 deletions
diff --git a/noncore/net/wellenreiter/gui/scanlistitem.cpp b/noncore/net/wellenreiter/gui/scanlistitem.cpp
index 267e543..3a5ac4e 100644
--- a/noncore/net/wellenreiter/gui/scanlistitem.cpp
+++ b/noncore/net/wellenreiter/gui/scanlistitem.cpp
@@ -13,5 +13,36 @@
13** 13**
14**********************************************************************/ 14**********************************************************************/
15 15
16#include "scanlistitem.h" 16#include "scanlistitem.h"
17#include <qlistview.h> 17#include <qpe/resource.h>
18#include <assert.h>
19#include <qpixmap.h>
20
21const int col_type = 0;
22const int col_sig = 1;
23const int col_essid = 2;
24const int col_ap = 3;
25const int col_channel = 4;
26const int col_wep = 5;
27
28MScanListItem::MScanListItem( QListView* parent, QString type, QString essid, QString ap,
29 bool wep, int channel, int signal )
30 :QListViewItem( parent, QString::null, QString::null, essid, ap,
31 QString::null, QString::null )
32{
33
34 qDebug( "creating scanlist item" );
35
36 // set icon for managed or adhoc mode
37 QString name;
38 name.sprintf( "wellenreiter/%s", (const char*) type );
39 setPixmap( col_type, Resource::loadPixmap( name ) );
40
41 // set icon for wep (wireless encryption protocol)
42 if ( wep )
43 setPixmap( col_wep, Resource::loadPixmap( "wellenreiter/cracked" ) ); // rename the pixmap!
44
45 // set channel and signal text
46 setText( col_sig, QString::number( signal ) );
47 setText( col_channel, QString::number( channel ) );
48}
diff --git a/noncore/net/wellenreiter/gui/scanlistitem.h b/noncore/net/wellenreiter/gui/scanlistitem.h
index 2bed9d0..133551a 100644
--- a/noncore/net/wellenreiter/gui/scanlistitem.h
+++ b/noncore/net/wellenreiter/gui/scanlistitem.h
@@ -17,10 +17,24 @@
17#define SCANLISTITEM_H 17#define SCANLISTITEM_H
18 18
19#include <qlistview.h> 19#include <qlistview.h>
20 20
21class QString;
22
21class MScanListItem: public QListViewItem 23class MScanListItem: public QListViewItem
22{ 24{
25 public:
26
27 MScanListItem::MScanListItem( QListView* parent,
28 QString type,
29 QString essid,
30 QString ap,
31 bool wep,
32 int channel,
33 int signal );
34
35
36
23 37
24}; 38};
25 39
26#endif 40#endif
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp
index def3131..9364a75 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.cpp
+++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp
@@ -13,19 +13,34 @@
13** 13**
14***********************************************************************/ 14***********************************************************************/
15 15
16#include "wellenreiter.h" 16#include "wellenreiter.h"
17#include "scanlistitem.h"
18
19#include <qpushbutton.h>
17 20
18Wellenreiter::Wellenreiter( QWidget* parent, const char* name, WFlags fl ) 21Wellenreiter::Wellenreiter( QWidget* parent, const char* name, WFlags fl )
19 : WellenreiterBase( parent, name, fl ) 22 : WellenreiterBase( parent, name, fl )
20{ 23{
24
25 connect( button, SIGNAL( clicked() ), this, SLOT( buttonClicked() ) );
26
21} 27}
22 28
23Wellenreiter::~Wellenreiter() 29Wellenreiter::~Wellenreiter()
24{ 30{
25 // no need to delete child widgets, Qt does it all for us 31 // no need to delete child widgets, Qt does it all for us
26} 32}
27 33
28void Wellenreiter::theButton() 34void Wellenreiter::buttonClicked()
29{ 35{
30 36
37 // FIXME: communicate with daemon and set button text according to state
38
39 button->setText( "Stop Scanning" );
40
41 // add some icons, so that we can see if this works
42
43 new MScanListItem( netview, "managed", "MyNet", "04:00:20:EF:A6:43", true, 6, 80 );
44 new MScanListItem( netview, "adhoc", "YourNet", "40:03:A3:E7:56:22", false, 11, 30 );
45
31} 46}
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.h b/noncore/net/wellenreiter/gui/wellenreiter.h
index 12ebe78..7ba8b01 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.h
+++ b/noncore/net/wellenreiter/gui/wellenreiter.h
@@ -28,10 +28,10 @@ public:
28 28
29protected: 29protected:
30 30
31 31
32private slots: 32public slots:
33 void theButton(); 33 void buttonClicked();
34 34
35private: 35private:
36 //void readConfig(); 36 //void readConfig();
37 //void writeConfig(); 37 //void writeConfig();
diff --git a/noncore/net/wellenreiter/gui/wellenreiterbase.ui b/noncore/net/wellenreiter/gui/wellenreiterbase.ui
index 9627da7..fbfe716 100644
--- a/noncore/net/wellenreiter/gui/wellenreiterbase.ui
+++ b/noncore/net/wellenreiter/gui/wellenreiterbase.ui
@@ -10,9 +10,9 @@
10 <name>geometry</name> 10 <name>geometry</name>
11 <rect> 11 <rect>
12 <x>0</x> 12 <x>0</x>
13 <y>0</y> 13 <y>0</y>
14 <width>207</width> 14 <width>203</width>
15 <height>294</height> 15 <height>294</height>
16 </rect> 16 </rect>
17 </property> 17 </property>
18 <property stdset="1"> 18 <property stdset="1">
@@ -152,9 +152,9 @@
152 </property> 152 </property>
153 </column> 153 </column>
154 <property stdset="1"> 154 <property stdset="1">
155 <name>name</name> 155 <name>name</name>
156 <cstring>ListView8</cstring> 156 <cstring>netview</cstring>
157 </property> 157 </property>
158 <property stdset="1"> 158 <property stdset="1">
159 <name>frameShape</name> 159 <name>frameShape</name>
160 <enum>StyledPanel</enum> 160 <enum>StyledPanel</enum>
@@ -296,9 +296,9 @@ Karl Schoepf | Michael Lauer&lt;p&gt;
296 <widget> 296 <widget>
297 <class>QPushButton</class> 297 <class>QPushButton</class>
298 <property stdset="1"> 298 <property stdset="1">
299 <name>name</name> 299 <name>name</name>
300 <cstring>PushButton5</cstring> 300 <cstring>button</cstring>
301 </property> 301 </property>
302 <property stdset="1"> 302 <property stdset="1">
303 <name>sizePolicy</name> 303 <name>sizePolicy</name>
304 <sizepolicy> 304 <sizepolicy>
@@ -315,13 +315,13 @@ Karl Schoepf | Michael Lauer&lt;p&gt;
315</widget> 315</widget>
316<images> 316<images>
317 <image> 317 <image>
318 <name>image0</name> 318 <name>image0</name>