summaryrefslogtreecommitdiff
path: root/noncore/net
Unidiff
Diffstat (limited to 'noncore/net') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/bluebase.cpp18
-rw-r--r--noncore/net/opietooth/manager/bluebase.h1
-rw-r--r--noncore/net/opietooth/manager/pppdialog.h2
-rw-r--r--noncore/net/opietooth/manager/rfcpopup.cpp4
4 files changed, 12 insertions, 13 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp
index ec05a95..f400ce6 100644
--- a/noncore/net/opietooth/manager/bluebase.cpp
+++ b/noncore/net/opietooth/manager/bluebase.cpp
@@ -57,50 +57,51 @@ BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl )
57 m_localDevice = new Manager( "hci0" ); 57 m_localDevice = new Manager( "hci0" );
58 58
59 connect( PushButton2, SIGNAL( clicked() ), this, SLOT(startScan() ) ); 59 connect( PushButton2, SIGNAL( clicked() ), this, SLOT(startScan() ) );
60 connect( configApplyButton, SIGNAL(clicked() ), this, SLOT(applyConfigChanges() ) ); 60 connect( configApplyButton, SIGNAL(clicked() ), this, SLOT(applyConfigChanges() ) );
61 // not good since lib is async 61 // not good since lib is async
62 // connect( ListView2, SIGNAL( expanded ( QListViewItem* ) ), 62 // connect( ListView2, SIGNAL( expanded ( QListViewItem* ) ),
63 // this, SLOT( addServicesToDevice( QListViewItem * ) ) ); 63 // this, SLOT( addServicesToDevice( QListViewItem * ) ) );
64 connect( ListView2, SIGNAL( clicked( QListViewItem* )), 64 connect( ListView2, SIGNAL( clicked( QListViewItem* )),
65 this, SLOT( startServiceActionClicked( QListViewItem* ) ) ); 65 this, SLOT( startServiceActionClicked( QListViewItem* ) ) );
66 connect( ListView2, SIGNAL( rightButtonClicked( QListViewItem *, const QPoint &, int ) ), 66 connect( ListView2, SIGNAL( rightButtonClicked( QListViewItem *, const QPoint &, int ) ),
67 this, SLOT(startServiceActionHold( QListViewItem *, const QPoint &, int) ) ); 67 this, SLOT(startServiceActionHold( QListViewItem *, const QPoint &, int) ) );
68 connect( m_localDevice , SIGNAL( foundServices( const QString& , Services::ValueList ) ), 68 connect( m_localDevice , SIGNAL( foundServices( const QString& , Services::ValueList ) ),
69 this, SLOT( addServicesToDevice( const QString& , Services::ValueList ) ) ); 69 this, SLOT( addServicesToDevice( const QString& , Services::ValueList ) ) );
70 connect( m_localDevice, SIGNAL( available( const QString&, bool ) ), 70 connect( m_localDevice, SIGNAL( available( const QString&, bool ) ),
71 this, SLOT( deviceActive( const QString& , bool ) ) ); 71 this, SLOT( deviceActive( const QString& , bool ) ) );
72 connect( m_localDevice, SIGNAL( connections( ConnectionState::ValueList ) ), 72 connect( m_localDevice, SIGNAL( connections( ConnectionState::ValueList ) ),
73 this, SLOT( addConnectedDevices( ConnectionState::ValueList ) ) ); 73 this, SLOT( addConnectedDevices( ConnectionState::ValueList ) ) );
74 74
75 75
76 // let hold be rightButtonClicked() 76 // let hold be rightButtonClicked()
77 QPEApplication::setStylusOperation( ListView2->viewport(), QPEApplication::RightOnHold); 77 QPEApplication::setStylusOperation( ListView2->viewport(), QPEApplication::RightOnHold);
78 QPEApplication::setStylusOperation( ListView4->viewport(), QPEApplication::RightOnHold); 78 QPEApplication::setStylusOperation( ListView4->viewport(), QPEApplication::RightOnHold);
79 79
80 //Load all icons needed 80 //Load all icons needed
81 m_offPix = Resource::loadPixmap( "editdelete" ); 81 m_offPix = Resource::loadPixmap( "opietooth/notconnected" );
82 m_onPix = Resource::loadPixmap( "installed" ); 82 m_onPix = Resource::loadPixmap( "opietooth/connected" );
83 m_findPix = Resource::loadPixmap( "opietooth/find" );
83 84
84 QPalette pal = this->palette(); 85 QPalette pal = this->palette();
85 QColor col = pal.color( QPalette::Active, QColorGroup::Background ); 86 QColor col = pal.color( QPalette::Active, QColorGroup::Background );
86 pal.setColor( QPalette::Active, QColorGroup::Button, col ); 87 pal.setColor( QPalette::Active, QColorGroup::Button, col );
87 pal.setColor( QPalette::Inactive, QColorGroup::Button, col ); 88 pal.setColor( QPalette::Inactive, QColorGroup::Button, col );
88 pal.setColor( QPalette::Normal, QColorGroup::Button, col ); 89 pal.setColor( QPalette::Normal, QColorGroup::Button, col );
89 pal.setColor( QPalette::Disabled, QColorGroup::Button, col ); 90 pal.setColor( QPalette::Disabled, QColorGroup::Button, col );
90 this->setPalette( pal ); 91 this->setPalette( pal );
91 92
92 setCaption( tr( "Bluetooth Manager" ) ); 93 setCaption( tr( "Bluetooth Manager" ) );
93 94
94 readConfig(); 95 readConfig();
95 initGui(); 96 initGui();
96 97
97 //TESTING 98 //TESTING
98 ListView2->setRootIsDecorated(true); 99 ListView2->setRootIsDecorated(true);
99 100
100 BTDeviceItem *topLV2 = new BTDeviceItem( ListView2, RemoteDevice("xx:", "Siemens S45" ) ); 101 BTDeviceItem *topLV2 = new BTDeviceItem( ListView2, RemoteDevice("xx:", "Siemens S45" ) );
101 topLV2->setPixmap( 1, m_onPix ); 102 topLV2->setPixmap( 1, m_onPix );
102 Services s1; 103 Services s1;
103 s1.setServiceName( "Serial" ); 104 s1.setServiceName( "Serial" );
104 s1.insertClassId(1, "BlueNic"); 105 s1.insertClassId(1, "BlueNic");
105 (void) new BTServiceItem( topLV2, s1 ); 106 (void) new BTServiceItem( topLV2, s1 );
106 s1.setServiceName( "BlueNic" ); 107 s1.setServiceName( "BlueNic" );
@@ -336,78 +337,71 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin
336 * delete the PopupMenu otherwise it's the responsibility of 337 * delete the PopupMenu otherwise it's the responsibility of
337 * the PopupMenu to delete itself 338 * the PopupMenu to delete itself
338 * 339 *
339 */ 340 */
340 else if ( ((BTListItem*)item)->type() == "service") { 341 else if ( ((BTListItem*)item)->type() == "service") {
341 BTServiceItem* service = (BTServiceItem*)item; 342 BTServiceItem* service = (BTServiceItem*)item;
342 QMap<int, QString> list = service->services().classIdList(); 343 QMap<int, QString> list = service->services().classIdList();
343 QMap<int, QString>::Iterator it = list.begin(); 344 QMap<int, QString>::Iterator it = list.begin();
344 QPopupMenu *popup =0l; 345 QPopupMenu *popup =0l;
345 if ( it != list.end() ) { 346 if ( it != list.end() ) {
346 qWarning("Searching id %d %s", it.key(), it.data().latin1() ); 347 qWarning("Searching id %d %s", it.key(), it.data().latin1() );
347 popup = m_popHelper.find( it.key() /*1*/, 348 popup = m_popHelper.find( it.key() /*1*/,
348 service->services(), 349 service->services(),
349 (BTDeviceItem*)service->parent() ); 350 (BTDeviceItem*)service->parent() );
350 }else { 351 }else {
351 qWarning("Empty"); 352 qWarning("Empty");
352 } 353 }
353 354
354 if ( popup == 0l ) { 355 if ( popup == 0l ) {
355 qWarning("factory returned 0l"); 356 qWarning("factory returned 0l");
356 popup = new QPopupMenu(); 357 popup = new QPopupMenu();
357 } 358 }
358 359
359 int test1 = popup->insertItem( tr("Test1:"), 0); 360 int test1 = popup->insertItem( tr("Test1:"), 0);
360 int con = popup->insertItem( tr("connect"), 1);
361 int del = popup->insertItem( tr("delete"), 2);
362 361
363 ret = popup->exec( point ); 362 ret = popup->exec( point );
364 qWarning("returned from exec() "); 363 qWarning("returned from exec() ");
365 if ( ret == -1 ) 364 if ( ret == -1 ) {
366 ; 365 ;
367 else if ( ret == test1 ) 366 } else if ( ret == test1 ) {
368 ; 367 ;
369 else if ( ret == con )
370 ;
371 else if ( ret == del ) {
372 // take item first? -zecke
373 delete item;
374 } 368 }
375 delete popup; 369 delete popup;
376 } 370 }
377 delete menu; 371 delete menu;
378} 372}
379 373
380 374
381/** 375/**
382 * Search and display avail. services for a device (on expand from device listing) 376 * Search and display avail. services for a device (on expand from device listing)
383 * @param item the service item returned 377 * @param item the service item returned
384 */ 378 */
385void BlueBase::addServicesToDevice( BTDeviceItem * item ) { 379void BlueBase::addServicesToDevice( BTDeviceItem * item ) {
386 qDebug("addServicesToDevice"); 380 qDebug("addServicesToDevice");
387 // row of mac adress text(3) 381 // row of mac adress text(3)
388 RemoteDevice device = item->remoteDevice(); 382 RemoteDevice device = item->remoteDevice();
389 m_deviceList.insert( item->mac() , item ); 383 m_deviceList.insert( item->mac() , item );
390 // and some time later I get a signal foundServices( const QString& device, Services::ValueList ); back 384 // and some time later I get a signal foundServices( const QString& device, Services::ValueList ); back
391 m_localDevice->searchServices( device ); 385 m_localDevice->searchServices( device );
392} 386}
393 387
394 388
395/** 389/**
396 * Overloaded. This one it the one that is connected to the foundServices signal 390 * Overloaded. This one it the one that is connected to the foundServices signal
397 * @param device the mac address of the remote device 391 * @param device the mac address of the remote device
398 * @param servicesList the list with the service the device has. 392 * @param servicesList the list with the service the device has.
399 */ 393 */
400void BlueBase::addServicesToDevice( const QString& device, Services::ValueList servicesList ) { 394void BlueBase::addServicesToDevice( const QString& device, Services::ValueList servicesList ) {
401 qDebug("fill services list"); 395 qDebug("fill services list");
402 396
403 QMap<QString,BTDeviceItem*>::Iterator it; 397 QMap<QString,BTDeviceItem*>::Iterator it;
404 BTDeviceItem* deviceItem = 0; 398 BTDeviceItem* deviceItem = 0;
405 399
406 // get the right devices which requested the search 400 // get the right devices which requested the search
407 it = m_deviceList.find( device ); 401 it = m_deviceList.find( device );
408 if( it == m_deviceList.end() ) 402 if( it == m_deviceList.end() )
409 return; 403 return;
410 deviceItem = it.data(); 404 deviceItem = it.data();
411 405
412 QValueList<OpieTooth::Services>::Iterator it2; 406 QValueList<OpieTooth::Services>::Iterator it2;
413 BTServiceItem * serviceItem; 407 BTServiceItem * serviceItem;
diff --git a/noncore/net/opietooth/manager/bluebase.h b/noncore/net/opietooth/manager/bluebase.h
index a68a04b..0326daf 100644
--- a/noncore/net/opietooth/manager/bluebase.h
+++ b/noncore/net/opietooth/manager/bluebase.h
@@ -49,43 +49,44 @@ namespace OpieTooth {
49 bool find( const RemoteDevice& device ); 49 bool find( const RemoteDevice& device );
50 void readConfig(); 50 void readConfig();
51 void writeConfig(); 51 void writeConfig();
52 void readSavedDevices(); 52 void readSavedDevices();
53 void writeSavedDevices(); 53 void writeSavedDevices();
54 void writeToHciConfig(); 54 void writeToHciConfig();
55 QString status()const; 55 QString status()const;
56 void initGui(); 56 void initGui();
57 void setInfo(); 57 void setInfo();
58 PopupHelper m_popHelper; 58 PopupHelper m_popHelper;
59 Manager *m_localDevice; 59 Manager *m_localDevice;
60 QMap<QString,BTDeviceItem*> m_deviceList; 60 QMap<QString,BTDeviceItem*> m_deviceList;
61 61
62 void deviceActive( const RemoteDevice &device ); 62 void deviceActive( const RemoteDevice &device );
63 63
64 QString m_deviceName; 64 QString m_deviceName;
65 QString m_defaultPasskey; 65 QString m_defaultPasskey;
66 bool m_useEncryption; 66 bool m_useEncryption;
67 bool m_enableAuthentification; 67 bool m_enableAuthentification;
68 bool m_enablePagescan; 68 bool m_enablePagescan;
69 bool m_enableInquiryscan; 69 bool m_enableInquiryscan;
70 70
71 QPixmap m_offPix; 71 QPixmap m_offPix;
72 QPixmap m_onPix; 72 QPixmap m_onPix;
73 QPixmap m_findPix;
73 74
74 BTIconLoader *m_iconLoader; 75 BTIconLoader *m_iconLoader;
75 76
76 private slots: 77 private slots:
77 void addSearchedDevices( const QValueList<RemoteDevice> &newDevices ); 78 void addSearchedDevices( const QValueList<RemoteDevice> &newDevices );
78 void addServicesToDevice( BTDeviceItem *item ); 79 void addServicesToDevice( BTDeviceItem *item );
79 void addServicesToDevice( const QString& device, Services::ValueList ); 80 void addServicesToDevice( const QString& device, Services::ValueList );
80 void addConnectedDevices(); 81 void addConnectedDevices();
81 void addConnectedDevices( ConnectionState::ValueList ); 82 void addConnectedDevices( ConnectionState::ValueList );
82 void startServiceActionClicked( QListViewItem *item ); 83 void startServiceActionClicked( QListViewItem *item );
83 void startServiceActionHold( QListViewItem *, const QPoint &, int ); 84 void startServiceActionHold( QListViewItem *, const QPoint &, int );
84 void deviceActive( const QString& mac, bool connected ); 85 void deviceActive( const QString& mac, bool connected );
85 void applyConfigChanges(); 86 void applyConfigChanges();
86 87
87 }; 88 };
88 89
89} 90}
90 91
91#endif 92#endif
diff --git a/noncore/net/opietooth/manager/pppdialog.h b/noncore/net/opietooth/manager/pppdialog.h
index 6fdc90a..bb8b734 100644
--- a/noncore/net/opietooth/manager/pppdialog.h
+++ b/noncore/net/opietooth/manager/pppdialog.h
@@ -1,37 +1,37 @@
1#ifndef PPPDIALOG_H 1#ifndef PPPDIALOG_H
2#define PPPDIALOG_H 2#define PPPDIALOG_H
3 3
4 4
5#include <qdialog.h> 5#include <qdialog.h>
6#include <opie/oprocess.h> 6#include <opie/oprocess.h>
7 7
8class QVBoxLayout; 8class QVBoxLayout;
9class QPushButton; 9class QPushButton;
10class QMultiLineEdit; 10class QMultiLineEdit;
11class QLineEdit; 11class QLineEdit;
12 12
13 13
14namespace OpieTooth { 14namespace OpieTooth {
15 15
16 class PPPDialog : public QDialog { 16 class PPPDialog : public QDialog {
17 17
18 Q_OBJECT 18 Q_OBJECT
19 19
20 public: 20 public:
21 PPPDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0, const QString& device = 0); 21 PPPDialog( QWidget* parent = 0, const char* name = 0, bool modal = TRUE, WFlags fl = 0, const QString& device = 0);
22 ~PPPDialog(); 22 ~PPPDialog();
23 23
24 private slots: 24 private slots:
25 void connectToDevice(); 25 void connectToDevice();
26 void fillOutPut( OProcess* pppDial, char* cha, int len ); 26 void fillOutPut( OProcess* pppDial, char* cha, int len );
27 protected: 27 protected:
28 QVBoxLayout* layout; 28 QVBoxLayout* layout;
29 QLineEdit* cmdLine; 29 QLineEdit* cmdLine;
30 QPushButton* connectButton; 30 QPushButton* connectButton;
31 QMultiLineEdit* outPut; 31 QMultiLineEdit* outPut;
32 32
33 private: 33 private:
34 QString m_device; 34 QString m_device;
35 }; 35 };
36} 36}
37#endif 37#endif
diff --git a/noncore/net/opietooth/manager/rfcpopup.cpp b/noncore/net/opietooth/manager/rfcpopup.cpp
index 1b53f4b..cc87b6c 100644
--- a/noncore/net/opietooth/manager/rfcpopup.cpp
+++ b/noncore/net/opietooth/manager/rfcpopup.cpp
@@ -37,45 +37,49 @@ RfcCommPopup::RfcCommPopup()
37 a->addTo( this ); 37 a->addTo( this );
38 connect( a, SIGNAL( activated() ), 38 connect( a, SIGNAL( activated() ),
39 this, SLOT( slotFoo() ) ); 39 this, SLOT( slotFoo() ) );
40 40
41 41
42 /* bar action */ 42 /* bar action */
43 a = new QAction( ); 43 a = new QAction( );
44 a->setText( "Bar" ); 44 a->setText( "Bar" );
45 a->addTo( this ); 45 a->addTo( this );
46 connect( a, SIGNAL( activated() ), 46 connect( a, SIGNAL( activated() ),
47 this, SLOT( slotBar() ) ); 47 this, SLOT( slotBar() ) );
48 48
49}; 49};
50 50
51 51
52RfcCommPopup::~RfcCommPopup() { 52RfcCommPopup::~RfcCommPopup() {
53/* delete m_con; 53/* delete m_con;
54 delete m_dis; 54 delete m_dis;
55 delete m_foo; 55 delete m_foo;
56 delete m_bar; */ 56 delete m_bar; */
57} 57}
58 58
59 59
60void RfcCommPopup::slotConnect() { 60void RfcCommPopup::slotConnect() {
61
61 qWarning("connect"); 62 qWarning("connect");
63
64
65
62 PPPDialog pppDialog; 66 PPPDialog pppDialog;
63 pppDialog.showMaximized(); 67 pppDialog.showMaximized();
64 pppDialog.exec(); 68 pppDialog.exec();
65} 69}
66 70
67 71
68void RfcCommPopup::slotDisconnect() { 72void RfcCommPopup::slotDisconnect() {
69 qWarning("slot disconnected"); 73 qWarning("slot disconnected");
70} 74}
71 75
72 76
73void RfcCommPopup::slotFoo() { 77void RfcCommPopup::slotFoo() {
74 qWarning("slotFoo"); 78 qWarning("slotFoo");
75} 79}
76 80
77 81
78void RfcCommPopup::slotBar() { 82void RfcCommPopup::slotBar() {
79 qWarning("slotBar"); 83 qWarning("slotBar");
80}; 84};
81 85