summaryrefslogtreecommitdiff
path: root/noncore
Unidiff
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/lib/connection.cpp4
-rw-r--r--noncore/net/opietooth/lib/connection.h31
-rw-r--r--noncore/net/opietooth/lib/lib.pro4
-rw-r--r--noncore/net/opietooth/lib/startpanconnection.cpp67
-rw-r--r--noncore/net/opietooth/lib/startpanconnection.h40
-rw-r--r--noncore/net/opietooth/manager/bluebase.cpp2
-rw-r--r--noncore/net/opietooth/manager/bluetoothbase.ui665
-rw-r--r--noncore/net/opietooth/manager/panpopup.cpp46
-rw-r--r--noncore/net/opietooth/manager/panpopup.h11
9 files changed, 480 insertions, 390 deletions
diff --git a/noncore/net/opietooth/lib/connection.cpp b/noncore/net/opietooth/lib/connection.cpp
index ef7d925..5e35463 100644
--- a/noncore/net/opietooth/lib/connection.cpp
+++ b/noncore/net/opietooth/lib/connection.cpp
@@ -3,6 +3,10 @@
3 3
4using namespace OpieTooth; 4using namespace OpieTooth;
5 5
6
7
8
9
6ConnectionState::ConnectionState() { 10ConnectionState::ConnectionState() {
7 m_direction = Incoming; 11 m_direction = Incoming;
8 m_handle = -1; 12 m_handle = -1;
diff --git a/noncore/net/opietooth/lib/connection.h b/noncore/net/opietooth/lib/connection.h
index 76e5dad..a0c50f2 100644
--- a/noncore/net/opietooth/lib/connection.h
+++ b/noncore/net/opietooth/lib/connection.h
@@ -4,9 +4,40 @@
4 4
5#include <qstring.h> 5#include <qstring.h>
6#include <qvaluelist.h> 6#include <qvaluelist.h>
7#include <qobject.h>
7 8
8namespace OpieTooth { 9namespace OpieTooth {
9 10
11
12
13
14 /**
15 * Parent class for all kinds of starting connection
16 * subclasses
17 *
18 */
19 class StartConnection : public QObject {
20
21 protected:
22
23 enum ConnectionType{
24 Pan = 0,
25 Rfcomm,
26 Obex,
27 Hci
28 };
29
30 virtual ~StartConnection() {};
31
32 virtual QString name() = 0;
33 virtual void setName( QString name ) = 0;
34 virtual ConnectionType type() = 0;
35 virtual void setConnectionType() = 0;
36 virtual void start() = 0;
37 virtual void stop() = 0;
38
39 };
40
10 enum LinkDirection { Incoming= true, Outgoing = false }; 41 enum LinkDirection { Incoming= true, Outgoing = false };
11 enum LinkMode { Master =0, Client }; 42 enum LinkMode { Master =0, Client };
12 43
diff --git a/noncore/net/opietooth/lib/lib.pro b/noncore/net/opietooth/lib/lib.pro
index 88df1fb..d081b5c 100644
--- a/noncore/net/opietooth/lib/lib.pro
+++ b/noncore/net/opietooth/lib/lib.pro
@@ -1,7 +1,7 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG += qte warn_on release 2CONFIG += qte warn_on release
3 HEADERS = connection.h parser.h device.h manager.h remotedevice.h services.h 3 HEADERS = connection.h parser.h device.h manager.h remotedevice.h services.h startpanconnection.h
4 SOURCES = connection.cpp parser.cc device.cc manager.cc remotedevice.cc services.cc 4 SOURCES = connection.cpp parser.cc device.cc manager.cc remotedevice.cc services.cc startpanconnection.cpp
5 TARGET = opietooth 5 TARGET = opietooth
6INCLUDEPATH += $(OPIEDIR)/include . 6INCLUDEPATH += $(OPIEDIR)/include .
7 DESTDIR = $(OPIEDIR)/lib$(PROJMAK) 7 DESTDIR = $(OPIEDIR)/lib$(PROJMAK)
diff --git a/noncore/net/opietooth/lib/startpanconnection.cpp b/noncore/net/opietooth/lib/startpanconnection.cpp
new file mode 100644
index 0000000..b68f02d
--- a/dev/null
+++ b/noncore/net/opietooth/lib/startpanconnection.cpp
@@ -0,0 +1,67 @@
1
2#include "startpanconnection.h"
3
4using namespace OpieTooth;
5
6
7StartPanConnection::StartPanConnection() {
8 m_panConnect = 0l;
9 setConnectionType();
10}
11
12StartPanConnection::~StartPanConnection() {
13 delete m_panConnect;
14}
15
16StartPanConnection::StartPanConnection( QString mac ) {
17 m_panConnect = 0l;
18 m_mac = mac;
19 setConnectionType();
20}
21
22void StartPanConnection::setName( QString name ) {
23 m_name = name;
24}
25
26QString StartPanConnection::name() {
27 return m_name;
28}
29
30void StartPanConnection::setConnectionType() {
31 m_connectionType = Pan;
32}
33
34StartConnection::ConnectionType StartPanConnection::type() {
35 return m_connectionType;
36}
37
38void StartPanConnection::start() {
39 m_panConnect = new OProcess();
40 *m_panConnect << "pand" << "--connect" << m_mac;
41
42 connect( m_panConnect, SIGNAL( processExited( OProcess* ) ) ,
43 this, SLOT( slotExited( OProcess* ) ) );
44 connect( m_panConnect, SIGNAL( receivedStdout( OProcess*, char*, int ) ),
45 this, SLOT( slotStdOut( OProcess*, char*, int ) ) );
46 if (!m_panConnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) {
47 qWarning( "could not start" );
48 delete m_panConnect;
49 }
50}
51
52
53void StartPanConnection::slotExited( OProcess* proc ) {
54 delete m_panConnect;
55}
56
57void StartPanConnection::slotStdOut(OProcess* proc, char* chars, int len)
58{}
59
60
61void StartPanConnection::stop() {
62 if ( m_panConnect ) {
63 delete m_panConnect;
64 m_panConnect = 0l;
65 }
66}
67
diff --git a/noncore/net/opietooth/lib/startpanconnection.h b/noncore/net/opietooth/lib/startpanconnection.h
new file mode 100644
index 0000000..7e5bd95
--- a/dev/null
+++ b/noncore/net/opietooth/lib/startpanconnection.h
@@ -0,0 +1,40 @@
1#ifndef startpanconnection_h
2#define startpanconnection_h
3
4#include <qobject.h>
5#include "connection.h"
6#include <opie/oprocess.h>
7
8namespace OpieTooth {
9
10 class StartPanConnection : StartConnection {
11
12 Q_OBJECT
13
14 public:
15 StartPanConnection();
16 StartPanConnection( QString mac );
17 ~StartPanConnection();
18
19 QString name();
20 void setName( QString name );
21 StartConnection::ConnectionType type();
22 void setConnectionType( );
23 void start();
24 void stop();
25
26 private:
27 QString m_name;
28 QString m_mac;
29 ConnectionType m_connectionType;
30 OProcess* m_panConnect;
31
32 private slots:
33 void slotExited( OProcess* proc );
34 void slotStdOut( OProcess* proc, char* chars, int len );
35 };
36
37
38}
39
40#endif
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp
index b5a09e5..04fa117 100644
--- a/noncore/net/opietooth/manager/bluebase.cpp
+++ b/noncore/net/opietooth/manager/bluebase.cpp
@@ -333,7 +333,7 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin
333 QPopupMenu *popup =0l; 333 QPopupMenu *popup =0l;
334 if ( it != list.end() ) { 334 if ( it != list.end() ) {
335 qWarning("Searching id %d %s", it.key(), it.data().latin1() ); 335 qWarning("Searching id %d %s", it.key(), it.data().latin1() );
336 popup = m_popHelper.find( it.key() /*1*/, 336 popup = m_popHelper.find( 4358,
337 service->services(), 337 service->services(),
338 (BTDeviceItem*)service->parent() ); 338 (BTDeviceItem*)service->parent() );
339 }else { 339 }else {
diff --git a/noncore/net/opietooth/manager/bluetoothbase.ui b/noncore/net/opietooth/manager/bluetoothbase.ui
index b51c8c6..9ff970f 100644
--- a/noncore/net/opietooth/manager/bluetoothbase.ui
+++ b/noncore/net/opietooth/manager/bluetoothbase.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>228</width> 14 <width>224</width>
15 <height>320</height> 15 <height>320</height>
16 </rect> 16 </rect>
17 </property> 17 </property>
@@ -19,422 +19,377 @@
19 <name>caption</name> 19 <name>caption</name>
20 <string>Form1</string> 20 <string>Form1</string>
21 </property> 21 </property>
22 <widget> 22 <property>
23 <class>QTabWidget</class> 23 <name>layoutMargin</name>
24 </property>
25 <property>
26 <name>layoutSpacing</name>
27 </property>
28 <vbox>
24 <property stdset="1"> 29 <property stdset="1">
25 <name>name</name> 30 <name>margin</name>
26 <cstring>Status</cstring> 31 <number>0</number>
27 </property> 32 </property>
28 <property stdset="1"> 33 <property stdset="1">
29 <name>geometry</name> 34 <name>spacing</name>
30 <rect> 35 <number>0</number>
31 <x>0</x>
32 <y>0</y>
33 <width>260</width>
34 <height>350</height>
35 </rect>
36 </property> 36 </property>
37 <widget> 37 <widget>
38 <class>QWidget</class> 38 <class>QTabWidget</class>
39 <property stdset="1"> 39 <property stdset="1">
40 <name>name</name> 40 <name>name</name>
41 <cstring>tab</cstring> 41 <cstring>Status</cstring>
42 </property> 42 </property>
43 <attribute> 43 <property>
44 <name>title</name> 44 <name>layoutMargin</name>
45 <string>Devices</string> 45 </property>
46 </attribute> 46 <property>
47 <spacer> 47 <name>layoutSpacing</name>
48 <property> 48 </property>
49 <name>name</name> 49 <widget>
50 <cstring>Spacer3</cstring> 50 <class>QWidget</class>
51 </property>
52 <property stdset="1">
53 <name>orientation</name>
54 <enum>Vertical</enum>
55 </property>
56 <property stdset="1"> 51 <property stdset="1">
57 <name>sizeType</name>
58 <enum>Expanding</enum>
59 </property>
60 <property>
61 <name>sizeHint</name>
62 <size>
63 <width>20</width>
64 <height>20</height>
65 </size>
66 </property>
67 </spacer>
68 <spacer>
69 <property>
70 <name>name</name> 52 <name>name</name>
71 <cstring>Spacer1</cstring> 53 <cstring>tab</cstring>
72 </property> 54 </property>
73 <property stdset="1"> 55 <attribute>
74 <name>orientation</name> 56 <name>title</name>
75 <enum>Vertical</enum> 57 <string>Devices</string>
76 </property> 58 </attribute>
77 <property stdset="1"> 59 <vbox>
78 <name>sizeType</name> 60 <property stdset="1">
79 <enum>Fixed</enum> 61 <name>margin</name>
80 </property> 62 <number>2</number>
81 <property>
82 <name>sizeHint</name>
83 <size>
84 <width>20</width>
85 <height>20</height>
86 </size>
87 </property>
88 </spacer>
89 <widget>
90 <class>QListView</class>
91 <column>
92 <property>
93 <name>text</name>
94 <string>Device Name</string>
95 </property>
96 <property>
97 <name>clickable</name>
98 <bool>true</bool>
99 </property>
100 <property>
101 <name>resizeable</name>
102 <bool>true</bool>
103 </property>
104 </column>
105 <column>
106 <property>
107 <name>text</name>
108 <string>Online</string>
109 </property>
110 <property>
111 <name>clickable</name>
112 <bool>true</bool>
113 </property> 63 </property>
114 <property> 64 <property stdset="1">
115 <name>resizeable</name> 65 <name>spacing</name>
116 <bool>true</bool> 66 <number>2</number>
117 </property> 67 </property>
118 </column> 68 <widget>
119 <property stdset="1"> 69 <class>QListView</class>
120 <name>name</name> 70 <column>
121 <cstring>ListView2</cstring> 71 <property>
122 </property> 72 <name>text</name>
123 <property stdset="1"> 73 <string>Device Name</string>
124 <name>geometry</name> 74 </property>
125 <rect> 75 <property>
126 <x>0</x> 76 <name>clickable</name>
127 <y>0</y> 77 <bool>true</bool>
128 <width>230</width> 78 </property>
129 <height>230</height> 79 <property>
130 </rect> 80 <name>resizeable</name>
131 </property> 81 <bool>true</bool>
82 </property>
83 </column>
84 <column>
85 <property>
86 <name>text</name>
87 <string>Online</string>
88 </property>
89 <property>
90 <name>clickable</name>
91 <bool>true</bool>
92 </property>
93 <property>
94 <name>resizeable</name>
95 <bool>true</bool>
96 </property>
97 </column>
98 <property stdset="1">
99 <name>name</name>
100 <cstring>ListView2</cstring>
101 </property>
102 </widget>
103 <widget>
104 <class>QPushButton</class>
105 <property stdset="1">
106 <name>name</name>
107 <cstring>PushButton2</cstring>
108 </property>
109 <property stdset="1">
110 <name>sizePolicy</name>
111 <sizepolicy>
112 <hsizetype>0</hsizetype>
113 <vsizetype>0</vsizetype>
114 </sizepolicy>
115 </property>
116 <property stdset="1">
117 <name>text</name>
118 <string>Scan for Devices</string>
119 </property>
120 </widget>
121 </vbox>
132 </widget> 122 </widget>
133 <widget> 123 <widget>
134 <class>QPushButton</class> 124 <class>QWidget</class>
135 <property stdset="1"> 125 <property stdset="1">
136 <name>name</name> 126 <name>name</name>
137 <cstring>PushButton2</cstring> 127 <cstring>tab</cstring>
138 </property>
139 <property stdset="1">
140 <name>geometry</name>
141 <rect>
142 <x>40</x>
143 <y>231</y>
144 <width>154</width>
145 <height>30</height>
146 </rect>
147 </property>
148 <property stdset="1">
149 <name>sizePolicy</name>
150 <sizepolicy>
151 <hsizetype>0</hsizetype>
152 <vsizetype>0</vsizetype>
153 </sizepolicy>
154 </property>
155 <property stdset="1">
156 <name>text</name>
157 <string>Scan for Devices</string>
158 </property> 128 </property>
159 </widget> 129 <attribute>
160 </widget> 130 <name>title</name>
161 <widget> 131 <string>Connections</string>
162 <class>QWidget</class> 132 </attribute>
163 <property stdset="1"> 133 <vbox>
164 <name>name</name> 134 <property stdset="1">
165 <cstring>tab</cstring> 135 <name>margin</name>
166 </property> 136 <number>2</number>
167 <attribute>
168 <name>title</name>
169 <string>Connections</string>
170 </attribute>
171 <widget>
172 <class>QListView</class>
173 <column>
174 <property>
175 <name>text</name>
176 <string>Device Name</string>
177 </property>
178 <property>
179 <name>clickable</name>
180 <bool>true</bool>
181 </property>
182 <property>
183 <name>resizeable</name>
184 <bool>true</bool>
185 </property>
186 </column>
187 <column>
188 <property>
189 <name>text</name>
190 <string>Connection type</string>
191 </property>
192 <property>
193 <name>clickable</name>
194 <bool>true</bool>
195 </property>
196 <property>
197 <name>resizeable</name>
198 <bool>true</bool>
199 </property>
200 </column>
201 <column>
202 <property>
203 <name>text</name>
204 <string>Signal</string>
205 </property>
206 <property>
207 <name>clickable</name>
208 <bool>true</bool>
209 </property> 137 </property>
210 <property> 138 <property stdset="1">
211 <name>resizeable</name> 139 <name>spacing</name>
212 <bool>true</bool> 140 <number>2</number>
213 </property> 141 </property>
214 </column> 142 <widget>
215 <property stdset="1"> 143 <class>QListView</class>
216 <name>name</name> 144 <column>
217 <cstring>ListView4</cstring> 145 <property>
218 </property> 146 <name>text</name>
219 <property stdset="1"> 147 <string>Device Name</string>
220 <name>geometry</name> 148 </property>
221 <rect> 149 <property>
222 <x>0</x> 150 <name>clickable</name>
223 <y>0</y> 151 <bool>true</bool>
224 <width>240</width> 152 </property>
225 <height>240</height> 153 <property>
226 </rect> 154 <name>resizeable</name>
227 </property> 155 <bool>true</bool>
228 </widget> 156 </property>
229 </widget> 157 </column>
230 <widget> 158 <column>
231 <class>QWidget</class> 159 <property>
232 <property stdset="1"> 160 <name>text</name>
233 <name>name</name> 161 <string>Connection type</string>
234 <cstring>tab</cstring> 162 </property>
235 </property> 163 <property>
236 <attribute> 164 <name>clickable</name>
237 <name>title</name> 165 <bool>true</bool>
238 <string>Config</string> 166 </property>
239 </attribute> 167 <property>
240 <widget> 168 <name>resizeable</name>
241 <class>QLabel</class> 169 <bool>true</bool>
242 <property stdset="1"> 170 </property>
243 <name>name</name> 171 </column>
244 <cstring>deviceNameLabel</cstring> 172 <column>
245 </property> 173 <property>
246 <property stdset="1"> 174 <name>text</name>
247 <name>geometry</name> 175 <string>Signal</string>
248 <rect> 176 </property>
249 <x>10</x> 177 <property>
250 <y>10</y> 178 <name>clickable</name>
251 <width>70</width> 179 <bool>true</bool>
252 <height>20</height> 180 </property>
253 </rect> 181 <property>
254 </property> 182 <name>resizeable</name>
255 <property stdset="1"> 183 <bool>true</bool>
256 <name>text</name> 184 </property>
257 <string>Device Name</string> 185 </column>
258 </property> 186 <property stdset="1">
259 </widget> 187 <name>name</name>
260 <widget> 188 <cstring>ListView4</cstring>
261 <class>QLabel</class> 189 </property>
262 <property stdset="1"> 190 </widget>
263 <name>name</name> 191 </vbox>
264 <cstring>passkeyLabel</cstring>
265 </property>
266 <property stdset="1">
267 <name>geometry</name>
268 <rect>
269 <x>10</x>
270 <y>50</y>
271 <width>80</width>
272 <height>20</height>
273 </rect>
274 </property>
275 <property stdset="1">
276 <name>text</name>
277 <string>Default Passkey</string>
278 </property>
279 </widget>
280 <widget>
281 <class>QLineEdit</class>
282 <property stdset="1">
283 <name>name</name>
284 <cstring>passkeyLine</cstring>
285 </property>
286 <property stdset="1">
287 <name>geometry</name>
288 <rect>
289 <x>98</x>
290 <y>53</y>
291 <width>120</width>
292 <height>22</height>
293 </rect>
294 </property>
295 <property stdset="1">
296 <name>echoMode</name>
297 <enum>Password</enum>
298 </property>
299 </widget> 192 </widget>
300 <widget> 193 <widget>
301 <class>QLayoutWidget</class> 194 <class>QWidget</class>
302 <property stdset="1"> 195 <property stdset="1">
303 <name>name</name> 196 <name>name</name>
304 <cstring>Layout5</cstring> 197 <cstring>tab</cstring>
305 </property>
306 <property stdset="1">
307 <name>geometry</name>
308 <rect>
309 <x>10</x>
310 <y>100</y>
311 <width>188</width>
312 <height>120</height>
313 </rect>
314 </property> 198 </property>
199 <attribute>
200 <name>title</name>
201 <string>Config</string>
202 </attribute>
315 <vbox> 203 <vbox>
316 <property stdset="1"> 204 <property stdset="1">
317 <name>margin</name> 205 <name>margin</name>
318 <number>0</number> 206 <number>2</number>
319 </property> 207 </property>
320 <property stdset="1"> 208 <property stdset="1">
321 <name>spacing</name> 209 <name>spacing</name>
322 <number>6</number> 210 <number>2</number>
323 </property> 211 </property>
324 <widget> 212 <widget>
325 <class>QCheckBox</class> 213 <class>QLayoutWidget</class>
326 <property stdset="1"> 214 <property stdset="1">
327 <name>name</name> 215 <name>name</name>
328 <cstring>authCheckBox</cstring> 216 <cstring>Layout2</cstring>
329 </property>
330 <property stdset="1">
331 <name>text</name>
332 <string>enable authentification</string>
333 </property> 217 </property>
218 <hbox>
219 <property stdset="1">
220 <name>margin</name>
221 <number>0</number>
222 </property>
223 <property stdset="1">
224 <name>spacing</name>
225 <number>6</number>
226 </property>
227 <widget>
228 <class>QLabel</class>
229 <property stdset="1">
230 <name>name</name>
231 <cstring>deviceNameLabel</cstring>
232 </property>
233 <property stdset="1">
234 <name>text</name>
235 <string>Device Name</string>
236 </property>
237 </widget>
238 <widget>
239 <class>QLineEdit</class>
240 <property stdset="1">
241 <name>name</name>
242 <cstring>deviceNameLine</cstring>
243 </property>
244 </widget>
245 </hbox>
334 </widget> 246 </widget>
335 <widget> 247 <widget>
336 <class>QCheckBox</class> 248 <class>QLayoutWidget</class>
337 <property stdset="1"> 249 <property stdset="1">
338 <name>name</name> 250 <name>name</name>
339 <cstring>cryptCheckBox</cstring> 251 <cstring>Layout3</cstring>
340 </property>
341 <property stdset="1">
342 <name>text</name>
343 <string>enable encryption</string>
344 </property> 252 </property>
253 <hbox>
254 <property stdset="1">
255 <name>margin</name>
256 <number>0</number>
257 </property>
258 <property stdset="1">
259 <name>spacing</name>
260 <number>6</number>
261 </property>
262 <widget>
263 <class>QLabel</class>
264 <property stdset="1">
265 <name>name</name>
266 <cstring>passkeyLabel</cstring>
267 </property>
268 <property stdset="1">
269 <name>text</name>
270 <string>Default Passkey</string>
271 </property>
272 </widget>
273 <widget>
274 <class>QLineEdit</class>
275 <property stdset="1">
276 <name>name</name>
277 <cstring>passkeyLine</cstring>
278 </property>
279 <property stdset="1">
280 <name>echoMode</name>
281 <enum>Password</enum>
282 </property>
283 </widget>
284 </hbox>
345 </widget> 285 </widget>
346 <widget> 286 <widget>
347 <class>QCheckBox</class> 287 <class>QLayoutWidget</class>
348 <property stdset="1"> 288 <property stdset="1">
349 <name>name</name> 289 <name>name</name>
350 <cstring>pagescanCheckBox</cstring> 290 <cstring>Layout5</cstring>
351 </property>
352 <property stdset="1">
353 <name>text</name>
354 <string>Enable Page scan</string>
355 </property> 291 </property>
292 <vbox>
293 <property stdset="1">
294 <name>margin</name>
295 <number>0</number>
296 </property>
297 <property stdset="1">
298 <name>spacing</name>
299 <number>6</number>
300 </property>
301 <widget>
302 <class>QCheckBox</class>
303 <property stdset="1">
304 <name>name</name>
305 <cstring>authCheckBox</cstring>
306 </property>
307 <property stdset="1">
308 <name>text</name>
309 <string>enable authentification</string>
310 </property>
311 </widget>
312 <widget>
313 <class>QCheckBox</class>
314 <property stdset="1">
315 <name>name</name>
316 <cstring>cryptCheckBox</cstring>
317 </property>
318 <property stdset="1">
319 <name>text</name>
320 <string>enable encryption</string>
321 </property>
322 </widget>
323 <widget>
324 <class>QCheckBox</class>
325 <property stdset="1">
326 <name>name</name>
327 <cstring>pagescanCheckBox</cstring>
328 </property>
329 <property stdset="1">
330 <name>text</name>
331 <string>Enable Page scan</string>
332 </property>
333 </widget>
334 <widget>
335 <class>QCheckBox</class>
336 <property stdset="1">
337 <name>name</name>
338 <cstring>inquiryscanCheckBox</cstring>
339 </property>
340 <property stdset="1">
341 <name>text</name>
342 <string>Enable Inquiry scan</string>
343 </property>
344 </widget>
345 </vbox>
356 </widget> 346 </widget>
357 <widget> 347 <widget>
358 <class>QCheckBox</class> 348 <class>QPushButton</class>
359 <property stdset="1"> 349 <property stdset="1">
360 <name>name</name> 350 <name>name</name>
361 <cstring>inquiryscanCheckBox</cstring> 351 <cstring>configApplyButton</cstring>
362 </property> 352 </property>
363 <property stdset="1"> 353 <property stdset="1">
364 <name>text</name> 354 <name>text</name>
365 <string>Enable Inquiry scan</string> 355 <string>Apply</string>
366 </property> 356 </property>
367 </widget> 357 </widget>
368 </vbox> 358 </vbox>
369 </widget> 359 </widget>
370 <widget> 360 <widget>
371 <class>QLineEdit</class> 361 <class>QWidget</class>
372 <property stdset="1"> 362 <property stdset="1">
373 <name>name</name> 363 <name>name</name>
374 <cstring>deviceNameLine</cstring> 364 <cstring>tab</cstring>
375 </property>
376 <property stdset="1">
377 <name>geometry</name>
378 <rect>
379 <x>98</x>
380 <y>13</y>
381 <width>120</width>
382 <height>22</height>
383 </rect>
384 </property>
385 </widget>
386 <widget>
387 <class>QPushButton</class>
388 <property stdset="1">
389 <name>name</name>
390 <cstring>configApplyButton</cstring>
391 </property>
392 <property stdset="1">
393 <name>geometry</name>
394 <rect>
395 <x>60</x>
396 <y>230</y>
397 <width>99</width>
398 <height>32</height>
399 </rect>
400 </property>
401 <property stdset="1">
402 <name>text</name>
403 <string>Apply</string>
404 </property>
405 </widget>
406 </widget>
407 <widget>
408 <class>QWidget</class>
409 <property stdset="1">
410 <name>name</name>
411 <cstring>tab</cstring>
412 </property>
413 <attribute>
414 <name>title</name>
415 <string>Status</string>
416 </attribute>
417 <widget>
418 <class>QLabel</class>
419 <property stdset="1">
420 <name>name</name>
421 <cstring>StatusLabel</cstring>
422 </property>
423 <property stdset="1">
424 <name>geometry</name>
425 <rect>
426 <x>10</x>
427 <y>10</y>
428 <width>220</width>
429 <height>250</height>
430 </rect>
431 </property>
432 <property stdset="1">
433 <name>text</name>
434 <string>Status Label</string>
435 </property> 365 </property>
366 <attribute>
367 <name>title</name>
368 <string>Status</string>
369 </attribute>
370 <vbox>
371 <property stdset="1">
372 <name>margin</name>
373 <number>2</number>
374 </property>
375 <property stdset="1">
376 <name>spacing</name>
377 <number>2</number>
378 </property>
379 <widget>
380 <class>QLabel</class>
381 <property stdset="1">
382 <name>name</name>
383 <cstring>StatusLabel</cstring>
384 </property>
385 <property stdset="1">
386 <name>text</name>
387 <string>Status Label</string>
388 </property>
389 </widget>
390 </vbox>
436 </widget> 391 </widget>
437 </widget> 392 </widget>
438 </widget> 393 </vbox>
439</widget> 394</widget>
440</UI> 395</UI>
diff --git a/noncore/net/opietooth/manager/panpopup.cpp b/noncore/net/opietooth/manager/panpopup.cpp
index d3d1347..61e632b 100644
--- a/noncore/net/opietooth/manager/panpopup.cpp
+++ b/noncore/net/opietooth/manager/panpopup.cpp
@@ -14,51 +14,43 @@ PanPopup::PanPopup( OpieTooth::BTDeviceItem* item ) : QPopupMenu() {
14 qWarning("PanPopup c'tor"); 14 qWarning("PanPopup c'tor");
15 15
16 m_item = item; 16 m_item = item;
17 m_panconnect = 0l; 17 QAction *a, *b, *c;
18 QAction *a, *b;
19 18
19 m_panconnection = 0l;
20 /* connect action */ 20 /* connect action */
21 a = new QAction( ); // so it's get deleted 21
22 a->setText( "connect" ); 22
23 a = new QAction(); // so it's get deleted
24 a->setText( tr("connect") );
23 a->addTo( this ); 25 a->addTo( this );
24 connect( a, SIGNAL( activated() ), this, SLOT( slotConnect() ) ); 26 connect( a, SIGNAL( activated() ), this, SLOT( slotConnect() ) );
25 27
28
26 b = new QAction(); 29 b = new QAction();
27 b->setText( "connect+conf" ); 30 b->setText( tr( "connect+conf" ) );
28 b->addTo( this ); 31 b->addTo( this );
29 connect( b, SIGNAL( activated() ), this, SLOT( slotConnectAndConfig() ) ); 32 connect( b, SIGNAL( activated() ), this, SLOT( slotConnectAndConfig() ) );
33
34 c = new QAction();
35 c->setText( tr( "disconnect" ) );
36 c->addTo( this );
37 connect( c, SIGNAL( activated() ), this, SLOT( slotDisconnect() ) );
38
30}; 39};
31 40
32PanPopup::~PanPopup() { 41PanPopup::~PanPopup() {
33 delete m_panconnect; 42
34} 43}
35 44
36void PanPopup::slotConnect() { 45void PanPopup::slotConnect() {
37 46 m_panconnection = new StartPanConnection( m_item->mac() );
38 47 m_panconnection->start();
39 // SHOULD move to lib
40 // before pand must be in "pand --listen --role panu" mode ( client )
41
42 m_panconnect = new OProcess();
43 *m_panconnect << "pand" << "--connect" << m_item->mac();
44
45 connect( m_panconnect, SIGNAL( processExited( OProcess* ) ) ,
46 this, SLOT( slotConnectExited( OProcess* ) ) );
47 connect( m_panconnect, SIGNAL( receivedStdout( OProcess*, char*, int ) ),
48 this, SLOT( slotConnectOut( OProcess*, char*, int ) ) );
49 if (!m_panconnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) {
50 qWarning( "could not start" );
51 delete m_panconnect;
52 }
53} 48}
54 49
55void PanPopup::slotExited( OProcess* proc ) { 50void PanPopup::slotDisconnect() {
56 delete m_panconnect; 51 m_panconnection->stop();
57} 52}
58 53
59void PanPopup::slotStdOut(OProcess* proc, char* chars, int len)
60{}
61
62 54
63void PanPopup::slotConnectAndConfig() { 55void PanPopup::slotConnectAndConfig() {
64 slotConnect(); 56 slotConnect();
diff --git a/noncore/net/opietooth/manager/panpopup.h b/noncore/net/opietooth/manager/panpopup.h
index 9d99f5e..1496f3a 100644
--- a/noncore/net/opietooth/manager/panpopup.h
+++ b/noncore/net/opietooth/manager/panpopup.h
@@ -3,10 +3,12 @@
3 3
4#include <qpopupmenu.h> 4#include <qpopupmenu.h>
5#include <qaction.h> 5#include <qaction.h>
6#include <opie/oprocess.h> 6
7#include <startpanconnection.h>
7 8
8#include "btdeviceitem.h" 9#include "btdeviceitem.h"
9 10
11
10namespace OpieTooth { 12namespace OpieTooth {
11 13
12 class PanPopup : public QPopupMenu { 14 class PanPopup : public QPopupMenu {
@@ -19,14 +21,13 @@ namespace OpieTooth {
19 21
20 private: 22 private:
21 QAction* m_push; 23 QAction* m_push;
22 OProcess* m_panconnect; 24 OpieTooth::StartPanConnection* m_panconnection;
23 OpieTooth::BTDeviceItem *m_item; 25 OpieTooth::BTDeviceItem *m_item;
24 private slots: 26 private slots:
25 void slotConnect(); 27 void slotConnect();
28 void slotDisconnect();
26 void slotConnectAndConfig(); 29 void slotConnectAndConfig();
27 void slotExited( OProcess* proc ); 30 };
28 void slotStdOut( OProcess* proc, char* chars, int len );
29 };
30}; 31};
31 32
32#endif 33#endif