-rw-r--r-- | noncore/net/opietooth/manager/bluebase.cpp | 18 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/bluebase.h | 1 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/pppdialog.h | 2 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/rfcpopup.cpp | 4 |
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 | |||
@@ -65,34 +65,35 @@ BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl ) | |||
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); |
@@ -344,62 +345,55 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin | |||
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 | */ |
385 | void BlueBase::addServicesToDevice( BTDeviceItem * item ) { | 379 | void 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 | */ |
400 | void BlueBase::addServicesToDevice( const QString& device, Services::ValueList servicesList ) { | 394 | void 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 | ||
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 | |||
@@ -57,32 +57,33 @@ namespace OpieTooth { | |||
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 | ||
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 | |||
@@ -5,33 +5,33 @@ | |||
5 | #include <qdialog.h> | 5 | #include <qdialog.h> |
6 | #include <opie/oprocess.h> | 6 | #include <opie/oprocess.h> |
7 | 7 | ||
8 | class QVBoxLayout; | 8 | class QVBoxLayout; |
9 | class QPushButton; | 9 | class QPushButton; |
10 | class QMultiLineEdit; | 10 | class QMultiLineEdit; |
11 | class QLineEdit; | 11 | class QLineEdit; |
12 | 12 | ||
13 | 13 | ||
14 | namespace OpieTooth { | 14 | namespace 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 | |||
@@ -45,33 +45,37 @@ RfcCommPopup::RfcCommPopup() | |||
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 | ||
52 | RfcCommPopup::~RfcCommPopup() { | 52 | RfcCommPopup::~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 | ||
60 | void RfcCommPopup::slotConnect() { | 60 | void 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 | ||
68 | void RfcCommPopup::slotDisconnect() { | 72 | void RfcCommPopup::slotDisconnect() { |
69 | qWarning("slot disconnected"); | 73 | qWarning("slot disconnected"); |
70 | } | 74 | } |
71 | 75 | ||
72 | 76 | ||
73 | void RfcCommPopup::slotFoo() { | 77 | void RfcCommPopup::slotFoo() { |
74 | qWarning("slotFoo"); | 78 | qWarning("slotFoo"); |
75 | } | 79 | } |
76 | 80 | ||
77 | 81 | ||