-rw-r--r-- | noncore/net/wellenreiter/gui/scanlistitem.cpp | 33 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/scanlistitem.h | 14 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 19 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.h | 4 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiterbase.ui | 12 |
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 | |||
@@ -14,4 +14,35 @@ | |||
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 | |||
21 | const int col_type = 0; | ||
22 | const int col_sig = 1; | ||
23 | const int col_essid = 2; | ||
24 | const int col_ap = 3; | ||
25 | const int col_channel = 4; | ||
26 | const int col_wep = 5; | ||
27 | |||
28 | MScanListItem::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 | |||
@@ -18,8 +18,22 @@ | |||
18 | 18 | ||
19 | #include <qlistview.h> | 19 | #include <qlistview.h> |
20 | 20 | ||
21 | class QString; | ||
22 | |||
21 | class MScanListItem: public QListViewItem | 23 | class 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 | ||
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 | |||
@@ -14,10 +14,16 @@ | |||
14 | ***********************************************************************/ | 14 | ***********************************************************************/ |
15 | 15 | ||
16 | #include "wellenreiter.h" | 16 | #include "wellenreiter.h" |
17 | #include "scanlistitem.h" | ||
18 | |||
19 | #include <qpushbutton.h> | ||
17 | 20 | ||
18 | Wellenreiter::Wellenreiter( QWidget* parent, const char* name, WFlags fl ) | 21 | Wellenreiter::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 | ||
23 | Wellenreiter::~Wellenreiter() | 29 | Wellenreiter::~Wellenreiter() |
@@ -25,7 +31,16 @@ Wellenreiter::~Wellenreiter() | |||
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 | ||
28 | void Wellenreiter::theButton() | 34 | void 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 | |||
@@ -29,8 +29,8 @@ public: | |||
29 | protected: | 29 | protected: |
30 | 30 | ||
31 | 31 | ||
32 | private slots: | 32 | public slots: |
33 | void theButton(); | 33 | void buttonClicked(); |
34 | 34 | ||
35 | private: | 35 | private: |
36 | //void readConfig(); | 36 | //void readConfig(); |
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 | |||
@@ -11,7 +11,7 @@ | |||
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> |
@@ -153,7 +153,7 @@ | |||
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> |
@@ -297,7 +297,7 @@ Karl Schoepf | Michael Lauer<p> | |||
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> |
@@ -316,12 +316,12 @@ Karl Schoepf | Michael Lauer<p> | |||
316 | <images> | 316 | <images> |
317 | <image> | 317 | <image> |
318 | <name>image0</name> | 318 | <name>image0</name> |