author | wimpie <wimpie> | 2005-01-12 01:40:53 (UTC) |
---|---|---|
committer | wimpie <wimpie> | 2005-01-12 01:40:53 (UTC) |
commit | f9a83585111afa08a47176097a150d9f468bfcdf (patch) (unidiff) | |
tree | 6d5a3b5f9716f7c6ca6e7fae8b0e2bac8d6c57da /noncore/settings/networksettings2/bluetooth | |
parent | b2e60aa0222b348f34aab501feb8bc854e94413c (diff) | |
download | opie-f9a83585111afa08a47176097a150d9f468bfcdf.zip opie-f9a83585111afa08a47176097a150d9f468bfcdf.tar.gz opie-f9a83585111afa08a47176097a150d9f468bfcdf.tar.bz2 |
*** empty log message ***
Diffstat (limited to 'noncore/settings/networksettings2/bluetooth') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.cpp | 42 |
1 files changed, 35 insertions, 7 deletions
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.cpp b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.cpp index cd7bb4a..63b214e 100644 --- a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.cpp +++ b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.cpp | |||
@@ -2,4 +2,14 @@ | |||
2 | #include <resources.h> | 2 | #include <resources.h> |
3 | |||
4 | #include <OTPeer.h> | ||
3 | #include <OTDevice.h> | 5 | #include <OTDevice.h> |
4 | #include <OTGateway.h> | 6 | #include <OTGateway.h> |
7 | #include <Opietooth.h> | ||
8 | |||
9 | #include <qlistbox.h> | ||
10 | #include <qframe.h> | ||
11 | #include <qlabel.h> | ||
12 | #include <qlayout.h> | ||
13 | #include <qdialog.h> | ||
14 | |||
5 | #include "bluetoothRFCOMMrun.h" | 15 | #include "bluetoothRFCOMMrun.h" |
@@ -9,2 +19,4 @@ using Opietooth2::OTDevice; | |||
9 | using Opietooth2::OTDeviceAddress; | 19 | using Opietooth2::OTDeviceAddress; |
20 | using Opietooth2::OTScan; | ||
21 | using Opietooth2::OTPeer; | ||
10 | 22 | ||
@@ -57,2 +69,5 @@ QString BluetoothRFCOMMRun::setMyState( NetworkSetup *, | |||
57 | 69 | ||
70 | // no longer needed | ||
71 | delete Ch; | ||
72 | |||
58 | if( Sys.runAsRoot( S ) ) { | 73 | if( Sys.runAsRoot( S ) ) { |
@@ -80,8 +95,2 @@ QString BluetoothRFCOMMRun::setMyState( NetworkSetup *, | |||
80 | 95 | ||
81 | #include <qlistbox.h> | ||
82 | #include <qframe.h> | ||
83 | #include <qlabel.h> | ||
84 | #include <qlayout.h> | ||
85 | #include <qdialog.h> | ||
86 | |||
87 | RFCOMMChannel * BluetoothRFCOMMRun::getChannel( void ) { | 96 | RFCOMMChannel * BluetoothRFCOMMRun::getChannel( void ) { |
@@ -94,2 +103,18 @@ RFCOMMChannel * BluetoothRFCOMMRun::getChannel( void ) { | |||
94 | RFCOMMChannel * Ch = 0; | 103 | RFCOMMChannel * Ch = 0; |
104 | |||
105 | if( Data->Devices.count() == 0 ) { | ||
106 | OTPeer * Peer; | ||
107 | int Channel; | ||
108 | |||
109 | if( OTScan::getDevice( Peer, Channel, OT ) == QDialog::Accepted ) { | ||
110 | Ch = new RFCOMMChannel; | ||
111 | Ch->BDAddress = Peer->address().toString(); | ||
112 | Ch->Name = Peer->name(); | ||
113 | Ch->Channel = Channel; | ||
114 | return Ch; | ||
115 | } | ||
116 | |||
117 | return 0; | ||
118 | } | ||
119 | |||
95 | QDialog * Dlg = new QDialog( qApp->mainWidget(), 0, TRUE ); | 120 | QDialog * Dlg = new QDialog( qApp->mainWidget(), 0, TRUE ); |
@@ -122,3 +147,6 @@ RFCOMMChannel * BluetoothRFCOMMRun::getChannel( void ) { | |||
122 | odebug << "Selected " << Data->Devices[i]->Name << oendl; | 147 | odebug << "Selected " << Data->Devices[i]->Name << oendl; |
123 | Ch = Data->Devices[i]; | 148 | Ch = new RFCOMMChannel; |
149 | Ch->BDAddress = Data->Devices[i]->BDAddress; | ||
150 | Ch->Name = Data->Devices[i]->Name; | ||
151 | Ch->Channel = Data->Devices[i]->Channel; | ||
124 | break; | 152 | break; |