Diffstat (limited to 'noncore/net/opietooth/manager/bluebase.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opietooth/manager/bluebase.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp index 6328b59..7a92dc3 100644 --- a/noncore/net/opietooth/manager/bluebase.cpp +++ b/noncore/net/opietooth/manager/bluebase.cpp | |||
@@ -31,87 +31,87 @@ | |||
31 | #include <qvbox.h> | 31 | #include <qvbox.h> |
32 | #include <qmessagebox.h> | 32 | #include <qmessagebox.h> |
33 | #include <qapplication.h> | 33 | #include <qapplication.h> |
34 | #include <qcheckbox.h> | 34 | #include <qcheckbox.h> |
35 | #include <qlineedit.h> | 35 | #include <qlineedit.h> |
36 | #include <qlistview.h> | 36 | #include <qlistview.h> |
37 | #include <qdir.h> | 37 | #include <qdir.h> |
38 | 38 | ||
39 | #include <qpe/resource.h> | 39 | #include <qpe/resource.h> |
40 | #include <qpe/config.h> | 40 | #include <qpe/config.h> |
41 | 41 | ||
42 | #include <remotedevice.h> | 42 | #include <remotedevice.h> |
43 | 43 | ||
44 | 44 | ||
45 | namespace OpieTooth { | 45 | namespace OpieTooth { |
46 | 46 | ||
47 | 47 | ||
48 | BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl ) | 48 | BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl ) |
49 | : BluetoothBase( parent, name, fl ) { | 49 | : BluetoothBase( parent, name, fl ) { |
50 | 50 | ||
51 | localDevice = new Manager( "hci0" ); | 51 | localDevice = new Manager( "hci0" ); |
52 | 52 | ||
53 | connect( PushButton2, SIGNAL( clicked() ), this, SLOT(startScan() ) ); | 53 | connect( PushButton2, SIGNAL( clicked() ), this, SLOT(startScan() ) ); |
54 | connect( configApplyButton, SIGNAL(clicked() ), this, SLOT(applyConfigChanges() ) ); | 54 | connect( configApplyButton, SIGNAL(clicked() ), this, SLOT(applyConfigChanges() ) ); |
55 | connect( ListView2, SIGNAL( expanded ( QListViewItem *item ) ), | 55 | connect( ListView2, SIGNAL( expanded ( QListViewItem* ) ), |
56 | this, SLOT( addServicesToDevice( QListViewItem *item ) ) ); | 56 | this, SLOT( addServicesToDevice( QListViewItem * ) ) ); |
57 | connect( ListView2, SIGNAL( clicked( QListViewItem* )), | 57 | connect( ListView2, SIGNAL( clicked( QListViewItem* )), |
58 | this, SLOT( startServiceActionClicked( QListViewItem *item ) ) ); | 58 | this, SLOT( startServiceActionClicked( QListViewItem* ) ) ); |
59 | connect( localDevice, SIGNAL( foundServices( const QString& device, Services::ValueList ) ), | 59 | connect( localDevice , SIGNAL( foundServices( const QString& , Services::ValueList ) ), |
60 | this, SLOT( addServicesToDevice( const QString& device, Services::ValueList ) ) ); | 60 | this, SLOT( addServicesToDevice( const QString& , Services::ValueList ) ) ); |
61 | 61 | ||
62 | 62 | ||
63 | //Load all icons needed | 63 | //Load all icons needed |
64 | 64 | ||
65 | 65 | ||
66 | QPixmap offPix = Resource::loadPixmap( "editdelete" ); | 66 | offPix = Resource::loadPixmap( "editdelete" ); |
67 | QPixmap onPix = Resource::loadPixmap( "installed" ); | 67 | onPix = Resource::loadPixmap( "installed" ); |
68 | 68 | ||
69 | QPalette pal = this->palette(); | 69 | QPalette pal = this->palette(); |
70 | QColor col = pal.color(QPalette::Active, QColorGroup::Background); | 70 | QColor col = pal.color(QPalette::Active, QColorGroup::Background); |
71 | pal.setColor(QPalette::Active, QColorGroup::Button, col); | 71 | pal.setColor(QPalette::Active, QColorGroup::Button, col); |
72 | pal.setColor(QPalette::Inactive, QColorGroup::Button, col); | 72 | pal.setColor(QPalette::Inactive, QColorGroup::Button, col); |
73 | pal.setColor(QPalette::Normal, QColorGroup::Button, col); | 73 | pal.setColor(QPalette::Normal, QColorGroup::Button, col); |
74 | pal.setColor(QPalette::Disabled, QColorGroup::Button, col); | 74 | pal.setColor(QPalette::Disabled, QColorGroup::Button, col); |
75 | this->setPalette(pal); | 75 | this->setPalette(pal); |
76 | 76 | ||
77 | setCaption( tr( "Bluetooth Manager" ) ); | 77 | setCaption( tr( "Bluetooth Manager" ) ); |
78 | 78 | ||
79 | readConfig(); | 79 | readConfig(); |
80 | initGui(); | 80 | initGui(); |
81 | 81 | ||
82 | 82 | ||
83 | //TESTING | 83 | //TESTING |
84 | 84 | ||
85 | ListView2->setRootIsDecorated(true); | 85 | ListView2->setRootIsDecorated(true); |
86 | 86 | ||
87 | QListViewItem *topLV = new QListViewItem( ListView2, "Harlekins Dongle" , "yes"); | 87 | QListViewItem *topLV = new QListViewItem( ListView2, "Harlekins Dongle" , "yes"); |
88 | topLV->setPixmap( 0, offPix ); | 88 | topLV->setPixmap( 1, offPix ); |
89 | // (void) new QListViewItem( topLV, "on" ); | 89 | // (void) new QListViewItem( topLV, "on" ); |
90 | //(void) new QListViewItem( topLV, "off" ); | 90 | //(void) new QListViewItem( topLV, "off" ); |
91 | 91 | ||
92 | QListViewItem *topLV2 = new QListViewItem( ListView2, "Siemens S45" , "no" ); | 92 | QListViewItem *topLV2 = new QListViewItem( ListView2, "Siemens S45" , "no" ); |
93 | topLV2->setPixmap( 0, onPix ); | 93 | topLV2->setPixmap( 1, onPix ); |
94 | (void) new QListViewItem( topLV2, "on" ); | 94 | (void) new QListViewItem( topLV2, "on" ); |
95 | (void) new QListViewItem( topLV2, "off" ); | 95 | (void) new QListViewItem( topLV2, "off" ); |
96 | 96 | ||
97 | } | 97 | } |
98 | 98 | ||
99 | 99 | ||
100 | /** | 100 | /** |
101 | * Reads all options from the config file | 101 | * Reads all options from the config file |
102 | */ | 102 | */ |
103 | void BlueBase::readConfig() { | 103 | void BlueBase::readConfig() { |
104 | 104 | ||
105 | Config cfg( "bluetoothmanager" ); | 105 | Config cfg( "bluetoothmanager" ); |
106 | cfg.setGroup( "bluezsettings" ); | 106 | cfg.setGroup( "bluezsettings" ); |
107 | 107 | ||
108 | 108 | ||
109 | deviceName = cfg.readEntry( "name" , "No name" ); // name the device should identify with | 109 | deviceName = cfg.readEntry( "name" , "No name" ); // name the device should identify with |
110 | defaultPasskey = cfg.readEntryCrypt( "passkey" , "" ); // <- hmm, look up how good the trolls did that, maybe too weak | 110 | defaultPasskey = cfg.readEntryCrypt( "passkey" , "" ); // <- hmm, look up how good the trolls did that, maybe too weak |
111 | useEncryption = cfg.readNumEntry( "useEncryption" , 1 ); | 111 | useEncryption = cfg.readNumEntry( "useEncryption" , 1 ); |
112 | enableAuthentification = cfg.readNumEntry( "enableAuthentification" , 1 ); | 112 | enableAuthentification = cfg.readNumEntry( "enableAuthentification" , 1 ); |
113 | enablePagescan = cfg.readNumEntry( "enablePagescan" , 1 ); | 113 | enablePagescan = cfg.readNumEntry( "enablePagescan" , 1 ); |
114 | enableInquiryscan = cfg.readNumEntry( "enableInquiryscan" , 1 ); | 114 | enableInquiryscan = cfg.readNumEntry( "enableInquiryscan" , 1 ); |
115 | 115 | ||
116 | } | 116 | } |
117 | 117 | ||
@@ -236,49 +236,49 @@ namespace OpieTooth { | |||
236 | 236 | ||
237 | for( ; it.current() ; ++it ) { | 237 | for( ; it.current() ; ++it ) { |
238 | 238 | ||
239 | 239 | ||
240 | RemoteDevice *dev = it.current(); | 240 | RemoteDevice *dev = it.current(); |
241 | deviceItem = new QListViewItem( ListView2 , dev->name() ); | 241 | deviceItem = new QListViewItem( ListView2 , dev->name() ); |
242 | 242 | ||
243 | if ( deviceActive( dev ) ) { | 243 | if ( deviceActive( dev ) ) { |
244 | deviceItem->setPixmap( 1 , onPix ); | 244 | deviceItem->setPixmap( 1 , onPix ); |
245 | } else { | 245 | } else { |
246 | deviceItem->setPixmap( 1, offPix ); | 246 | deviceItem->setPixmap( 1, offPix ); |
247 | } | 247 | } |
248 | 248 | ||
249 | deviceItem->setText( 3, dev->mac() ); | 249 | deviceItem->setText( 3, dev->mac() ); |
250 | 250 | ||
251 | // ggf auch hier? | 251 | // ggf auch hier? |
252 | addServicesToDevice( deviceItem ); | 252 | addServicesToDevice( deviceItem ); |
253 | } | 253 | } |
254 | } | 254 | } |
255 | 255 | ||
256 | 256 | ||
257 | /* | 257 | /* |
258 | * Action that is toggled on entrys on click | 258 | * Action that is toggled on entrys on click |
259 | */ | 259 | */ |
260 | void BlueBase::startServiceActionClicked( QListViewItem * item ) { | 260 | void BlueBase::startServiceActionClicked( QListViewItem *item ) { |
261 | 261 | ||
262 | 262 | ||
263 | } | 263 | } |
264 | 264 | ||
265 | /* | 265 | /* |
266 | * Action that are toggled on hold (mostly QPopups i guess) | 266 | * Action that are toggled on hold (mostly QPopups i guess) |
267 | */ | 267 | */ |
268 | void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & point, int column ) { | 268 | void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & point, int column ) { |
269 | 269 | ||
270 | 270 | ||
271 | } | 271 | } |
272 | 272 | ||
273 | /* | 273 | /* |
274 | * Search and display avail. services for a device (on expand from device listing) | 274 | * Search and display avail. services for a device (on expand from device listing) |
275 | * | 275 | * |
276 | */ | 276 | */ |
277 | void BlueBase::addServicesToDevice( QListViewItem * item ) { | 277 | void BlueBase::addServicesToDevice( QListViewItem * item ) { |
278 | 278 | ||
279 | qDebug("addServicesToDevice"); | 279 | qDebug("addServicesToDevice"); |
280 | // row of mac adress | 280 | // row of mac adress |
281 | RemoteDevice *device = new RemoteDevice(item->text(3), item->text(0)); | 281 | RemoteDevice *device = new RemoteDevice(item->text(3), item->text(0)); |
282 | 282 | ||
283 | deviceList.insert( item->text(3) , item ); | 283 | deviceList.insert( item->text(3) , item ); |
284 | 284 | ||