summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/manager/bluebase.cpp
Unidiff
Diffstat (limited to 'noncore/net/opietooth/manager/bluebase.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/bluebase.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp
index e3b9e53..71da82e 100644
--- a/noncore/net/opietooth/manager/bluebase.cpp
+++ b/noncore/net/opietooth/manager/bluebase.cpp
@@ -20,56 +20,60 @@
20#include "scandialog.h" 20#include "scandialog.h"
21 21
22#include <qframe.h> 22#include <qframe.h>
23#include <qlabel.h> 23#include <qlabel.h>
24#include <qpushbutton.h> 24#include <qpushbutton.h>
25#include <qlayout.h> 25#include <qlayout.h>
26#include <qvariant.h> 26#include <qvariant.h>
27#include <qwhatsthis.h> 27#include <qwhatsthis.h>
28#include <qimage.h> 28#include <qimage.h>
29#include <qpixmap.h> 29#include <qpixmap.h>
30#include <qtabwidget.h> 30#include <qtabwidget.h>
31#include <qscrollview.h> 31#include <qscrollview.h>
32#include <qvbox.h> 32#include <qvbox.h>
33#include <qmessagebox.h> 33#include <qmessagebox.h>
34#include <qapplication.h> 34#include <qapplication.h>
35#include <qcheckbox.h> 35#include <qcheckbox.h>
36#include <qlineedit.h> 36#include <qlineedit.h>
37 37
38#include <qpe/resource.h> 38#include <qpe/resource.h>
39#include <qpe/config.h> 39#include <qpe/config.h>
40 40
41 41
42namespace OpieTooth { 42namespace OpieTooth {
43 43
44 class RemoteDevices;
44 45
45 BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl ) 46 BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl )
46 : BluetoothBase( parent, name, fl ) { 47 : BluetoothBase( parent, name, fl ) {
47 48
48 49
49 QObject::connect( (QObject*) PushButton2, SIGNAL( clicked() ), this, SLOT(startScan())); 50 QObject::connect( (QObject*) PushButton2, SIGNAL( clicked() ), this, SLOT(startScan()));
50 QObject::connect((QObject*)configApplyButton, SIGNAL(clicked() ), this, SLOT(applyConfigChanges())); 51 QObject::connect((QObject*)configApplyButton, SIGNAL(clicked() ), this, SLOT(applyConfigChanges()));
51 52
53
54
55
52 QPalette pal = this->palette(); 56 QPalette pal = this->palette();
53 QColor col = pal.color(QPalette::Active, QColorGroup::Background); 57 QColor col = pal.color(QPalette::Active, QColorGroup::Background);
54 pal.setColor(QPalette::Active, QColorGroup::Button, col); 58 pal.setColor(QPalette::Active, QColorGroup::Button, col);
55 pal.setColor(QPalette::Inactive, QColorGroup::Button, col); 59 pal.setColor(QPalette::Inactive, QColorGroup::Button, col);
56 pal.setColor(QPalette::Normal, QColorGroup::Button, col); 60 pal.setColor(QPalette::Normal, QColorGroup::Button, col);
57 pal.setColor(QPalette::Disabled, QColorGroup::Button, col); 61 pal.setColor(QPalette::Disabled, QColorGroup::Button, col);
58 this->setPalette(pal); 62 this->setPalette(pal);
59 63
60 setCaption( tr( "Bluetooth Manager" ) ); 64 setCaption( tr( "Bluetooth Manager" ) );
61 65
62 readConfig(); 66 readConfig();
63 initGui(); 67 initGui();
64 } 68 }
65 69
66/** 70/**
67 * Reads all options from the config file 71 * Reads all options from the config file
68 */ 72 */
69 void BlueBase::readConfig() { 73 void BlueBase::readConfig() {
70 74
71 Config cfg("bluetoothmanager"); 75 Config cfg("bluetoothmanager");
72 cfg.setGroup("bluezsettings"); 76 cfg.setGroup("bluezsettings");
73 77
74 78
75 deviceName = cfg.readEntry("name", "No name"); // name the device should identify with 79 deviceName = cfg.readEntry("name", "No name"); // name the device should identify with
@@ -128,40 +132,50 @@ namespace OpieTooth {
128 132
129 133
130/** 134/**
131 * Read the current values from the gui and invoke writeConfig() 135 * Read the current values from the gui and invoke writeConfig()
132 */ 136 */
133 void BlueBase::applyConfigChanges() { 137 void BlueBase::applyConfigChanges() {
134 138
135 deviceName = deviceNameLine->text(); 139 deviceName = deviceNameLine->text();
136 defaultPasskey = passkeyLine->text(); 140 defaultPasskey = passkeyLine->text();
137 useEncryption = cryptCheckBox->isChecked(); 141 useEncryption = cryptCheckBox->isChecked();
138 enableAuthentification = authCheckBox->isChecked(); 142 enableAuthentification = authCheckBox->isChecked();
139 enablePagescan = pagescanCheckBox->isChecked(); 143 enablePagescan = pagescanCheckBox->isChecked();
140 enableInquiryscan = inquiryscanCheckBox->isChecked(); 144 enableInquiryscan = inquiryscanCheckBox->isChecked();
141 145
142 writeConfig(); 146 writeConfig();
143 147
144 QMessageBox* box = new QMessageBox(this, "Test"); 148 QMessageBox* box = new QMessageBox(this, "Test");
145 box->setText(tr("Changes applied")); 149 box->setText(tr("Changes applied"));
146 box->show(); 150 box->show();
147 151
148 // falls nötig hcid killhupen - die funktionalität adden 152 // falls nötig hcid killhupen - die funktionalität adden
149} 153}
150 154
151 155
156 void BlueBase::addSearchedDevices( QList<RemoteDevices> &newDevices ) {
157
158
159
160 }
161
162
152/** 163/**
153 * Open the "scan for devices" dialog 164 * Open the "scan for devices" dialog
154 */ 165 */
155 void BlueBase::startScan() { 166 void BlueBase::startScan() {
156 ScanDialog *scan = new ScanDialog( this, "", true); 167 ScanDialog *scan = new ScanDialog( this, "", true);
168 QObject::connect((QObject*)scan, SIGNAL( selectedDevices(QList<RemoteDevices>&) ),
169 this, SLOT( addSearchedDevices(QList<RemoteDevices>& ) ));
170
157 scan->showMaximized(); 171 scan->showMaximized();
158 } 172 }
159 173
160/** 174/**
161 * Decontructor 175 * Decontructor
162 */ 176 */
163 BlueBase::~BlueBase(){ 177 BlueBase::~BlueBase(){
164 } 178 }
165 179
166} 180}
167 181