author | harlekin <harlekin> | 2003-03-21 15:56:58 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2003-03-21 15:56:58 (UTC) |
commit | d3f71dadbd2dafcf42480afeffe75e7e36ec7d9c (patch) (unidiff) | |
tree | 922b36110df58bdc00a3e2508313609c0f00c45f /noncore/net/opietooth | |
parent | 69086f42072e7fc1ea5256cb9275a27bf5b41f87 (diff) | |
download | opie-d3f71dadbd2dafcf42480afeffe75e7e36ec7d9c.zip opie-d3f71dadbd2dafcf42480afeffe75e7e36ec7d9c.tar.gz opie-d3f71dadbd2dafcf42480afeffe75e7e36ec7d9c.tar.bz2 |
move connection work to the lib
-rw-r--r-- | noncore/net/opietooth/lib/connection.cpp | 4 | ||||
-rw-r--r-- | noncore/net/opietooth/lib/connection.h | 31 | ||||
-rw-r--r-- | noncore/net/opietooth/lib/lib.pro | 4 | ||||
-rw-r--r-- | noncore/net/opietooth/lib/startpanconnection.cpp | 67 | ||||
-rw-r--r-- | noncore/net/opietooth/lib/startpanconnection.h | 40 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/bluebase.cpp | 2 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/bluetoothbase.ui | 243 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/panpopup.cpp | 44 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/panpopup.h | 9 |
9 files changed, 267 insertions, 177 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 | |||
@@ -5,2 +5,6 @@ using namespace OpieTooth; | |||
5 | 5 | ||
6 | |||
7 | |||
8 | |||
9 | |||
6 | ConnectionState::ConnectionState() { | 10 | ConnectionState::ConnectionState() { |
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 | |||
@@ -6,2 +6,3 @@ | |||
6 | #include <qvaluelist.h> | 6 | #include <qvaluelist.h> |
7 | #include <qobject.h> | ||
7 | 8 | ||
@@ -9,2 +10,32 @@ namespace 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 }; |
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 | |||
@@ -2,4 +2,4 @@ TEMPLATE = lib | |||
2 | CONFIG += qte warn_on release | 2 | CONFIG += 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 |
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 | |||
4 | using namespace OpieTooth; | ||
5 | |||
6 | |||
7 | StartPanConnection::StartPanConnection() { | ||
8 | m_panConnect = 0l; | ||
9 | setConnectionType(); | ||
10 | } | ||
11 | |||
12 | StartPanConnection::~StartPanConnection() { | ||
13 | delete m_panConnect; | ||
14 | } | ||
15 | |||
16 | StartPanConnection::StartPanConnection( QString mac ) { | ||
17 | m_panConnect = 0l; | ||
18 | m_mac = mac; | ||
19 | setConnectionType(); | ||
20 | } | ||
21 | |||
22 | void StartPanConnection::setName( QString name ) { | ||
23 | m_name = name; | ||
24 | } | ||
25 | |||
26 | QString StartPanConnection::name() { | ||
27 | return m_name; | ||
28 | } | ||
29 | |||
30 | void StartPanConnection::setConnectionType() { | ||
31 | m_connectionType = Pan; | ||
32 | } | ||
33 | |||
34 | StartConnection::ConnectionType StartPanConnection::type() { | ||
35 | return m_connectionType; | ||
36 | } | ||
37 | |||
38 | void 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 | |||
53 | void StartPanConnection::slotExited( OProcess* proc ) { | ||
54 | delete m_panConnect; | ||
55 | } | ||
56 | |||
57 | void StartPanConnection::slotStdOut(OProcess* proc, char* chars, int len) | ||
58 | {} | ||
59 | |||
60 | |||
61 | void 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 | |||
8 | namespace 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 | |||
@@ -335,3 +335,3 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin | |||
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(), |
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 | |||
@@ -13,3 +13,3 @@ | |||
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>228</width> | 14 | <width>224</width> |
15 | <height>320</height> | 15 | <height>320</height> |
@@ -21,2 +21,17 @@ | |||
21 | </property> | 21 | </property> |
22 | <property> | ||
23 | <name>layoutMargin</name> | ||
24 | </property> | ||
25 | <property> | ||
26 | <name>layoutSpacing</name> | ||
27 | </property> | ||
28 | <vbox> | ||
29 | <property stdset="1"> | ||
30 | <name>margin</name> | ||
31 | <number>0</number> | ||
32 | </property> | ||
33 | <property stdset="1"> | ||
34 | <name>spacing</name> | ||
35 | <number>0</number> | ||
36 | </property> | ||
22 | <widget> | 37 | <widget> |
@@ -27,10 +42,7 @@ | |||
27 | </property> | 42 | </property> |
28 | <property stdset="1"> | 43 | <property> |
29 | <name>geometry</name> | 44 | <name>layoutMargin</name> |
30 | <rect> | 45 | </property> |
31 | <x>0</x> | 46 | <property> |
32 | <y>0</y> | 47 | <name>layoutSpacing</name> |
33 | <width>260</width> | ||
34 | <height>350</height> | ||
35 | </rect> | ||
36 | </property> | 48 | </property> |
@@ -46,44 +58,11 @@ | |||
46 | </attribute> | 58 | </attribute> |
47 | <spacer> | 59 | <vbox> |
48 | <property> | ||
49 | <name>name</name> | ||
50 | <cstring>Spacer3</cstring> | ||
51 | </property> | ||
52 | <property stdset="1"> | ||
53 | <name>orientation</name> | ||
54 | <enum>Vertical</enum> | ||
55 | </property> | ||
56 | <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> | ||
71 | <cstring>Spacer1</cstring> | ||
72 | </property> | ||
73 | <property stdset="1"> | 60 | <property stdset="1"> |
74 | <name>orientation</name> | 61 | <name>margin</name> |
75 | <enum>Vertical</enum> | 62 | <number>2</number> |
76 | </property> | 63 | </property> |
77 | <property stdset="1"> | 64 | <property stdset="1"> |
78 | <name>sizeType</name> | 65 | <name>spacing</name> |
79 | <enum>Fixed</enum> | 66 | <number>2</number> |
80 | </property> | ||
81 | <property> | ||
82 | <name>sizeHint</name> | ||
83 | <size> | ||
84 | <width>20</width> | ||
85 | <height>20</height> | ||
86 | </size> | ||
87 | </property> | 67 | </property> |
88 | </spacer> | ||
89 | <widget> | 68 | <widget> |
@@ -122,11 +101,2 @@ | |||
122 | </property> | 101 | </property> |
123 | <property stdset="1"> | ||
124 | <name>geometry</name> | ||
125 | <rect> | ||
126 | <x>0</x> | ||
127 | <y>0</y> | ||
128 | <width>230</width> | ||
129 | <height>230</height> | ||
130 | </rect> | ||
131 | </property> | ||
132 | </widget> | 102 | </widget> |
@@ -139,11 +109,2 @@ | |||
139 | <property stdset="1"> | 109 | <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> | 110 | <name>sizePolicy</name> |
@@ -159,2 +120,3 @@ | |||
159 | </widget> | 120 | </widget> |
121 | </vbox> | ||
160 | </widget> | 122 | </widget> |
@@ -170,2 +132,11 @@ | |||
170 | </attribute> | 132 | </attribute> |
133 | <vbox> | ||
134 | <property stdset="1"> | ||
135 | <name>margin</name> | ||
136 | <number>2</number> | ||
137 | </property> | ||
138 | <property stdset="1"> | ||
139 | <name>spacing</name> | ||
140 | <number>2</number> | ||
141 | </property> | ||
171 | <widget> | 142 | <widget> |
@@ -218,12 +189,4 @@ | |||
218 | </property> | 189 | </property> |
219 | <property stdset="1"> | ||
220 | <name>geometry</name> | ||
221 | <rect> | ||
222 | <x>0</x> | ||
223 | <y>0</y> | ||
224 | <width>240</width> | ||
225 | <height>240</height> | ||
226 | </rect> | ||
227 | </property> | ||
228 | </widget> | 190 | </widget> |
191 | </vbox> | ||
229 | </widget> | 192 | </widget> |
@@ -239,16 +202,31 @@ | |||
239 | </attribute> | 202 | </attribute> |
203 | <vbox> | ||
204 | <property stdset="1"> | ||
205 | <name>margin</name> | ||
206 | <number>2</number> | ||
207 | </property> | ||
208 | <property stdset="1"> | ||
209 | <name>spacing</name> | ||
210 | <number>2</number> | ||
211 | </property> | ||
240 | <widget> | 212 | <widget> |
241 | <class>QLabel</class> | 213 | <class>QLayoutWidget</class> |
242 | <property stdset="1"> | 214 | <property stdset="1"> |
243 | <name>name</name> | 215 | <name>name</name> |
244 | <cstring>deviceNameLabel</cstring> | 216 | <cstring>Layout2</cstring> |
245 | </property> | 217 | </property> |
218 | <hbox> | ||
246 | <property stdset="1"> | 219 | <property stdset="1"> |
247 | <name>geometry</name> | 220 | <name>margin</name> |
248 | <rect> | 221 | <number>0</number> |
249 | <x>10</x> | 222 | </property> |
250 | <y>10</y> | 223 | <property stdset="1"> |
251 | <width>70</width> | 224 | <name>spacing</name> |
252 | <height>20</height> | 225 | <number>6</number> |
253 | </rect> | 226 | </property> |
227 | <widget> | ||
228 | <class>QLabel</class> | ||
229 | <property stdset="1"> | ||
230 | <name>name</name> | ||
231 | <cstring>deviceNameLabel</cstring> | ||
254 | </property> | 232 | </property> |
@@ -260,15 +238,30 @@ | |||
260 | <widget> | 238 | <widget> |
261 | <class>QLabel</class> | 239 | <class>QLineEdit</class> |
262 | <property stdset="1"> | 240 | <property stdset="1"> |
263 | <name>name</name> | 241 | <name>name</name> |
264 | <cstring>passkeyLabel</cstring> | 242 | <cstring>deviceNameLine</cstring> |
265 | </property> | 243 | </property> |
244 | </widget> | ||
245 | </hbox> | ||
246 | </widget> | ||
247 | <widget> | ||
248 | <class>QLayoutWidget</class> | ||
266 | <property stdset="1"> | 249 | <property stdset="1"> |
267 | <name>geometry</name> | 250 | <name>name</name> |
268 | <rect> | 251 | <cstring>Layout3</cstring> |
269 | <x>10</x> | 252 | </property> |
270 | <y>50</y> | 253 | <hbox> |
271 | <width>80</width> | 254 | <property stdset="1"> |
272 | <height>20</height> | 255 | <name>margin</name> |
273 | </rect> | 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> | ||
274 | </property> | 267 | </property> |
@@ -286,11 +279,2 @@ | |||
286 | <property stdset="1"> | 279 | <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> | 280 | <name>echoMode</name> |
@@ -299,2 +283,4 @@ | |||
299 | </widget> | 283 | </widget> |
284 | </hbox> | ||
285 | </widget> | ||
300 | <widget> | 286 | <widget> |
@@ -305,11 +291,2 @@ | |||
305 | </property> | 291 | </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> | ||
315 | <vbox> | 292 | <vbox> |
@@ -370,18 +347,2 @@ | |||
370 | <widget> | 347 | <widget> |
371 | <class>QLineEdit</class> | ||
372 | <property stdset="1"> | ||
373 | <name>name</name> | ||
374 | <cstring>deviceNameLine</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> | 348 | <class>QPushButton</class> |
@@ -392,11 +353,2 @@ | |||
392 | <property stdset="1"> | 353 | <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> | 354 | <name>text</name> |
@@ -405,2 +357,3 @@ | |||
405 | </widget> | 357 | </widget> |
358 | </vbox> | ||
406 | </widget> | 359 | </widget> |
@@ -416,2 +369,11 @@ | |||
416 | </attribute> | 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> | ||
417 | <widget> | 379 | <widget> |
@@ -423,11 +385,2 @@ | |||
423 | <property stdset="1"> | 385 | <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> | 386 | <name>text</name> |
@@ -436,4 +389,6 @@ | |||
436 | </widget> | 389 | </widget> |
390 | </vbox> | ||
437 | </widget> | 391 | </widget> |
438 | </widget> | 392 | </widget> |
393 | </vbox> | ||
439 | </widget> | 394 | </widget> |
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 | |||
@@ -16,8 +16,10 @@ PanPopup::PanPopup( OpieTooth::BTDeviceItem* item ) : QPopupMenu() { | |||
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 | |||
22 | |||
21 | a = new QAction( ); // so it's get deleted | 23 | a = new QAction( ); // so it's get deleted |
22 | a->setText( "connect" ); | 24 | a->setText( tr("connect") ); |
23 | a->addTo( this ); | 25 | a->addTo( this ); |
@@ -25,6 +27,13 @@ PanPopup::PanPopup( OpieTooth::BTDeviceItem* item ) : QPopupMenu() { | |||
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 | }; |
@@ -32,3 +41,3 @@ PanPopup::PanPopup( OpieTooth::BTDeviceItem* item ) : QPopupMenu() { | |||
32 | PanPopup::~PanPopup() { | 41 | PanPopup::~PanPopup() { |
33 | delete m_panconnect; | 42 | |
34 | } | 43 | } |
@@ -36,27 +45,10 @@ PanPopup::~PanPopup() { | |||
36 | void PanPopup::slotConnect() { | 45 | void 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 | ||
55 | void PanPopup::slotExited( OProcess* proc ) { | 50 | void PanPopup::slotDisconnect() { |
56 | delete m_panconnect; | 51 | m_panconnection->stop(); |
57 | } | 52 | } |
58 | 53 | ||
59 | void PanPopup::slotStdOut(OProcess* proc, char* chars, int len) | ||
60 | {} | ||
61 | |||
62 | 54 | ||
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 | |||
@@ -5,3 +5,4 @@ | |||
5 | #include <qaction.h> | 5 | #include <qaction.h> |
6 | #include <opie/oprocess.h> | 6 | |
7 | #include <startpanconnection.h> | ||
7 | 8 | ||
@@ -9,2 +10,3 @@ | |||
9 | 10 | ||
11 | |||
10 | namespace OpieTooth { | 12 | namespace OpieTooth { |
@@ -21,3 +23,3 @@ namespace OpieTooth { | |||
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; |
@@ -25,5 +27,4 @@ namespace OpieTooth { | |||
25 | void slotConnect(); | 27 | void slotConnect(); |
28 | void slotDisconnect(); | ||
26 | void slotConnectAndConfig(); | 29 | void slotConnectAndConfig(); |
27 | void slotExited( OProcess* proc ); | ||
28 | void slotStdOut( OProcess* proc, char* chars, int len ); | ||
29 | }; | 30 | }; |