Diffstat (limited to 'noncore/net/opietooth/manager/bluebase.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opietooth/manager/bluebase.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp index 0ea45d2..29030ab 100644 --- a/noncore/net/opietooth/manager/bluebase.cpp +++ b/noncore/net/opietooth/manager/bluebase.cpp | |||
@@ -44,62 +44,62 @@ | |||
44 | #include <qlistview.h> | 44 | #include <qlistview.h> |
45 | #include <qdir.h> | 45 | #include <qdir.h> |
46 | #include <qpopupmenu.h> | 46 | #include <qpopupmenu.h> |
47 | #include <qtimer.h> | 47 | #include <qtimer.h> |
48 | #include <qlist.h> | 48 | #include <qlist.h> |
49 | 49 | ||
50 | /* STD */ | 50 | /* STD */ |
51 | #include <remotedevice.h> | 51 | #include <remotedevice.h> |
52 | #include <services.h> | 52 | #include <services.h> |
53 | #include <stdlib.h> | 53 | #include <stdlib.h> |
54 | 54 | ||
55 | using namespace OpieTooth; | 55 | using namespace OpieTooth; |
56 | 56 | ||
57 | BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl ) | 57 | BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl ) |
58 | : BluetoothBase( parent, name, fl ) | 58 | : BluetoothBase( parent, name, fl ) |
59 | { | 59 | { |
60 | 60 | ||
61 | m_localDevice = new Manager( "hci0" ); | 61 | m_localDevice = new Manager( "hci0" ); |
62 | 62 | ||
63 | connect( PushButton2, SIGNAL( clicked() ), this, SLOT(startScan() ) ); | 63 | connect( PushButton2, SIGNAL( clicked() ), this, SLOT(startScan() ) ); |
64 | connect( configApplyButton, SIGNAL(clicked() ), this, SLOT(applyConfigChanges() ) ); | 64 | connect( configApplyButton, SIGNAL(clicked() ), this, SLOT(applyConfigChanges() ) ); |
65 | 65 | ||
66 | connect( rfcommBindButton, SIGNAL( clicked() ), this, SLOT( rfcommDialog() ) ); | 66 | connect( rfcommBindButton, SIGNAL( clicked() ), this, SLOT( rfcommDialog() ) ); |
67 | // not good since lib is async | 67 | // not good since lib is async |
68 | // connect( ListView2, SIGNAL( expanded ( QListViewItem* ) ), | 68 | // connect( ListView2, SIGNAL( expanded(QListViewItem*) ), |
69 | // this, SLOT( addServicesToDevice( QListViewItem * ) ) ); | 69 | // this, SLOT( addServicesToDevice(QListViewItem*) ) ); |
70 | connect( ListView2, SIGNAL( clicked( QListViewItem* )), | 70 | connect( ListView2, SIGNAL( clicked(QListViewItem*)), |
71 | this, SLOT( startServiceActionClicked( QListViewItem* ) ) ); | 71 | this, SLOT( startServiceActionClicked(QListViewItem*) ) ); |
72 | connect( ListView2, SIGNAL( rightButtonClicked( QListViewItem *, const QPoint &, int ) ), | 72 | connect( ListView2, SIGNAL( rightButtonClicked(QListViewItem*,const QPoint&,int) ), |
73 | this, SLOT(startServiceActionHold( QListViewItem *, const QPoint &, int) ) ); | 73 | this, SLOT(startServiceActionHold(QListViewItem*,const QPoint&,int) ) ); |
74 | connect( m_localDevice , SIGNAL( foundServices( const QString& , Services::ValueList ) ), | 74 | connect( m_localDevice , SIGNAL( foundServices(const QString&,Services::ValueList) ), |
75 | this, SLOT( addServicesToDevice( const QString& , Services::ValueList ) ) ); | 75 | this, SLOT( addServicesToDevice(const QString&,Services::ValueList) ) ); |
76 | connect( m_localDevice, SIGNAL( available( const QString&, bool ) ), | 76 | connect( m_localDevice, SIGNAL( available(const QString&,bool) ), |
77 | this, SLOT( deviceActive( const QString& , bool ) ) ); | 77 | this, SLOT( deviceActive(const QString&,bool) ) ); |
78 | connect( m_localDevice, SIGNAL( connections( ConnectionState::ValueList ) ), | 78 | connect( m_localDevice, SIGNAL( connections(ConnectionState::ValueList) ), |
79 | this, SLOT( addConnectedDevices( ConnectionState::ValueList ) ) ); | 79 | this, SLOT( addConnectedDevices(ConnectionState::ValueList) ) ); |
80 | connect( m_localDevice, SIGNAL( signalStrength( const QString&, const QString& ) ), | 80 | connect( m_localDevice, SIGNAL( signalStrength(const QString&,const QString&) ), |
81 | this, SLOT( addSignalStrength( const QString&, const QString& ) ) ); | 81 | this, SLOT( addSignalStrength(const QString&,const QString&) ) ); |
82 | 82 | ||
83 | 83 | ||
84 | // let hold be rightButtonClicked() | 84 | // let hold be rightButtonClicked() |
85 | QPEApplication::setStylusOperation( ListView2->viewport(), QPEApplication::RightOnHold); | 85 | QPEApplication::setStylusOperation( ListView2->viewport(), QPEApplication::RightOnHold); |
86 | QPEApplication::setStylusOperation( ListView4->viewport(), QPEApplication::RightOnHold); | 86 | QPEApplication::setStylusOperation( ListView4->viewport(), QPEApplication::RightOnHold); |
87 | 87 | ||
88 | //Load all icons needed | 88 | //Load all icons needed |
89 | m_offPix = Resource::loadPixmap( "opietooth/notconnected" ); | 89 | m_offPix = Resource::loadPixmap( "opietooth/notconnected" ); |
90 | m_onPix = Resource::loadPixmap( "opietooth/connected" ); | 90 | m_onPix = Resource::loadPixmap( "opietooth/connected" ); |
91 | m_findPix = Resource::loadPixmap( "opietooth/find" ); | 91 | m_findPix = Resource::loadPixmap( "opietooth/find" ); |
92 | 92 | ||
93 | QPalette pal = this->palette(); | 93 | QPalette pal = this->palette(); |
94 | QColor col = pal.color( QPalette::Active, QColorGroup::Background ); | 94 | QColor col = pal.color( QPalette::Active, QColorGroup::Background ); |
95 | pal.setColor( QPalette::Active, QColorGroup::Button, col ); | 95 | pal.setColor( QPalette::Active, QColorGroup::Button, col ); |
96 | pal.setColor( QPalette::Inactive, QColorGroup::Button, col ); | 96 | pal.setColor( QPalette::Inactive, QColorGroup::Button, col ); |
97 | pal.setColor( QPalette::Normal, QColorGroup::Button, col ); | 97 | pal.setColor( QPalette::Normal, QColorGroup::Button, col ); |
98 | pal.setColor( QPalette::Disabled, QColorGroup::Button, col ); | 98 | pal.setColor( QPalette::Disabled, QColorGroup::Button, col ); |
99 | this->setPalette( pal ); | 99 | this->setPalette( pal ); |
100 | 100 | ||
101 | setCaption( tr( "Bluetooth Manager" ) ); | 101 | setCaption( tr( "Bluetooth Manager" ) ); |
102 | 102 | ||
103 | readConfig(); | 103 | readConfig(); |
104 | initGui(); | 104 | initGui(); |
105 | 105 | ||
@@ -616,50 +616,50 @@ void BlueBase::deviceActive( const QString& device, bool connected ) | |||
616 | return; | 616 | return; |
617 | 617 | ||
618 | BTDeviceItem* deviceItem = it.data(); | 618 | BTDeviceItem* deviceItem = it.data(); |
619 | 619 | ||
620 | 620 | ||
621 | if ( connected ) | 621 | if ( connected ) |
622 | { | 622 | { |
623 | deviceItem->setPixmap( 1, m_onPix ); | 623 | deviceItem->setPixmap( 1, m_onPix ); |
624 | } | 624 | } |
625 | else | 625 | else |
626 | { | 626 | { |
627 | deviceItem->setPixmap( 1, m_offPix ); | 627 | deviceItem->setPixmap( 1, m_offPix ); |
628 | } | 628 | } |
629 | m_deviceList.remove( it ); | 629 | m_deviceList.remove( it ); |
630 | } | 630 | } |
631 | 631 | ||
632 | 632 | ||
633 | /** | 633 | /** |
634 | * Open the "scan for devices" dialog | 634 | * Open the "scan for devices" dialog |
635 | */ | 635 | */ |
636 | void BlueBase::startScan() | 636 | void BlueBase::startScan() |
637 | { | 637 | { |
638 | ScanDialog *scan = new ScanDialog( this, "ScanDialog", | 638 | ScanDialog *scan = new ScanDialog( this, "ScanDialog", |
639 | true, WDestructiveClose ); | 639 | true, WDestructiveClose ); |
640 | QObject::connect( scan, SIGNAL( selectedDevices( const QValueList<RemoteDevice>& ) ), | 640 | QObject::connect( scan, SIGNAL( selectedDevices(const QValueList<RemoteDevice>&) ), |
641 | this, SLOT( addSearchedDevices( const QValueList<RemoteDevice>& ) ) ); | 641 | this, SLOT( addSearchedDevices(const QValueList<RemoteDevice>&) ) ); |
642 | 642 | ||
643 | QPEApplication::showDialog( scan ); | 643 | QPEApplication::showDialog( scan ); |
644 | } | 644 | } |
645 | 645 | ||
646 | 646 | ||
647 | /** | 647 | /** |
648 | * Set the informations about the local device in information Tab | 648 | * Set the informations about the local device in information Tab |
649 | */ | 649 | */ |
650 | void BlueBase::setInfo() | 650 | void BlueBase::setInfo() |
651 | { | 651 | { |
652 | StatusLabel->setText( status() ); | 652 | StatusLabel->setText( status() ); |
653 | } | 653 | } |
654 | 654 | ||
655 | 655 | ||
656 | /** | 656 | /** |
657 | * Decontructor | 657 | * Decontructor |
658 | */ | 658 | */ |
659 | BlueBase::~BlueBase() | 659 | BlueBase::~BlueBase() |
660 | { | 660 | { |
661 | writeSavedDevices(); | 661 | writeSavedDevices(); |
662 | delete m_iconLoader; | 662 | delete m_iconLoader; |
663 | } | 663 | } |
664 | 664 | ||
665 | 665 | ||