author | harlekin <harlekin> | 2002-06-05 21:51:49 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-06-05 21:51:49 (UTC) |
commit | 38946b6ef966a154d979d7dd254cf463f6dadbe5 (patch) (unidiff) | |
tree | 9c08de13d750ce32afe4661d71f6f3933a8841d8 | |
parent | d16b4fecd10dbce1bb5fc0f58e78469ba40f6ec5 (diff) | |
download | opie-38946b6ef966a154d979d7dd254cf463f6dadbe5.zip opie-38946b6ef966a154d979d7dd254cf463f6dadbe5.tar.gz opie-38946b6ef966a154d979d7dd254cf463f6dadbe5.tar.bz2 |
update
-rw-r--r-- | noncore/net/opietooth/manager/bluebase.cpp | 105 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/bluebase.h | 17 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/bluetoothbase.ui | 156 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/devicedialog.ui | 12 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/scandialog.ui | 6 |
5 files changed, 220 insertions, 76 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp index c17271f..3d446f0 100644 --- a/noncore/net/opietooth/manager/bluebase.cpp +++ b/noncore/net/opietooth/manager/bluebase.cpp | |||
@@ -32,6 +32,9 @@ | |||
32 | #include <qvbox.h> | 32 | #include <qvbox.h> |
33 | #include <qmessagebox.h> | ||
33 | #include <qapplication.h> | 34 | #include <qapplication.h> |
34 | #include <qcheckbox.h> | 35 | #include <qcheckbox.h> |
36 | #include <qlineedit.h> | ||
35 | 37 | ||
36 | #include <qpe/resource.h> | 38 | #include <qpe/resource.h> |
39 | #include <qpe/config.h> | ||
37 | 40 | ||
@@ -42,2 +45,3 @@ BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl ) | |||
42 | QObject::connect( (QObject*) PushButton2, SIGNAL( clicked() ), this, SLOT(startScan())); | 45 | QObject::connect( (QObject*) PushButton2, SIGNAL( clicked() ), this, SLOT(startScan())); |
46 | QObject::connect((QObject*)configApplyButton, SIGNAL(clicked() ), this, SLOT(applyConfigChanges())); | ||
43 | 47 | ||
@@ -50,2 +54,95 @@ BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl ) | |||
50 | this->setPalette(pal); | 54 | this->setPalette(pal); |
55 | |||
56 | readConfig(); | ||
57 | initGui(); | ||
58 | } | ||
59 | |||
60 | /** | ||
61 | * Reads all options from the config file | ||
62 | */ | ||
63 | void BlueBase::readConfig() { | ||
64 | |||
65 | Config cfg("bluetoothmanager"); | ||
66 | cfg.setGroup("bluezsettings"); | ||
67 | |||
68 | |||
69 | deviceName = cfg.readEntry("name", "No name"); // name the device should identify with | ||
70 | defaultPasskey = cfg.readEntryCrypt("passkey", ""); // <- hmm, look up how good the trolls did that, maybe too weak | ||
71 | useEncryption = cfg.readNumEntry("useEncryption", 1); | ||
72 | enableAuthentification = cfg.readNumEntry("enableAuthentification", 1); | ||
73 | enablePagescan = cfg.readNumEntry("enablePagescan",1); | ||
74 | enableInquiryscan = cfg.readNumEntry("enableInquiryscan", 1); | ||
75 | |||
76 | } | ||
77 | |||
78 | /** | ||
79 | * Writes all options to the config file | ||
80 | */ | ||
81 | void BlueBase::writeConfig() { | ||
82 | |||
83 | |||
84 | Config cfg("bluetoothmanager"); | ||
85 | cfg.setGroup("bluezsettings"); | ||
86 | |||
87 | |||
88 | cfg.writeEntry("name", deviceName); | ||
89 | cfg.writeEntryCrypt("passkey", defaultPasskey); | ||
90 | cfg.writeEntry("useEncryption", useEncryption); | ||
91 | cfg.writeEntry("enableAuthentification", enableAuthentification); | ||
92 | cfg.writeEntry("enablePagescan",enablePagescan); | ||
93 | cfg.writeEntry("enableInquiryscan", enableInquiryscan); | ||
94 | |||
95 | |||
96 | } | ||
97 | |||
98 | |||
99 | /** | ||
100 | * Set up the gui | ||
101 | */ | ||
102 | void BlueBase::initGui() { | ||
103 | |||
104 | StatusLabel->setText(getStatus()); // maybe move it to getStatus() | ||
105 | |||
106 | cryptCheckBox->setChecked(useEncryption); | ||
107 | authCheckBox->setChecked(enableAuthentification); | ||
108 | pagescanCheckBox->setChecked(enablePagescan); | ||
109 | inquiryscanCheckBox->setChecked(enableInquiryscan); | ||
110 | deviceNameLine->setText(deviceName); | ||
111 | passkeyLine->setText(defaultPasskey); | ||
112 | |||
113 | } | ||
114 | |||
115 | |||
116 | /** | ||
117 | * Get the status informations and returns it | ||
118 | * @return QString the status informations gathered | ||
119 | */ | ||
120 | QString BlueBase::getStatus(){ | ||
121 | |||
122 | return ("manger.h need also a status method"); | ||
123 | |||
124 | } | ||
125 | |||
126 | |||
127 | /** | ||
128 | * Read the current values from the gui and invoke writeConfig() | ||
129 | */ | ||
130 | void BlueBase::applyConfigChanges() { | ||
131 | |||
132 | deviceName = deviceNameLine->text(); | ||
133 | defaultPasskey = passkeyLine->text(); | ||
134 | useEncryption = cryptCheckBox->isChecked(); | ||
135 | enableAuthentification = authCheckBox->isChecked(); | ||
136 | enablePagescan = pagescanCheckBox->isChecked(); | ||
137 | enableInquiryscan = inquiryscanCheckBox->isChecked(); | ||
138 | |||
139 | writeConfig(); | ||
140 | |||
141 | QMessageBox* box = new QMessageBox(this, "Test"); | ||
142 | box->setText(tr("Changes applied")); | ||
143 | box->show(); | ||
144 | |||
145 | // falls nötig hcid killhupen - die funktionalität adden | ||
146 | |||
147 | |||
51 | } | 148 | } |
@@ -53,4 +150,7 @@ BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl ) | |||
53 | 150 | ||
151 | /** | ||
152 | * Open the "scan for devices" dialog | ||
153 | */ | ||
54 | void BlueBase::startScan() { | 154 | void BlueBase::startScan() { |
55 | Form3 *scan = new Form3( this, "", true); | 155 | ScanDialog *scan = new ScanDialog( this, "", true); |
56 | scan->exec(); | 156 | scan->exec(); |
@@ -58,2 +158,5 @@ void BlueBase::startScan() { | |||
58 | 158 | ||
159 | /** | ||
160 | * Decontructor | ||
161 | */ | ||
59 | BlueBase::~BlueBase(){ | 162 | BlueBase::~BlueBase(){ |
diff --git a/noncore/net/opietooth/manager/bluebase.h b/noncore/net/opietooth/manager/bluebase.h index 29c45be..fb1844c 100644 --- a/noncore/net/opietooth/manager/bluebase.h +++ b/noncore/net/opietooth/manager/bluebase.h | |||
@@ -33,2 +33,19 @@ protected: | |||
33 | 33 | ||
34 | private: | ||
35 | void readConfig(); | ||
36 | void writeConfig(); | ||
37 | QString getStatus(); | ||
38 | void initGui(); | ||
39 | |||
40 | |||
41 | QString deviceName; | ||
42 | QString defaultPasskey; | ||
43 | int useEncryption; | ||
44 | int enableAuthentification; | ||
45 | int enablePagescan; | ||
46 | int enableInquiryscan; | ||
47 | |||
48 | private slots: | ||
49 | |||
50 | void applyConfigChanges(); | ||
34 | 51 | ||
diff --git a/noncore/net/opietooth/manager/bluetoothbase.ui b/noncore/net/opietooth/manager/bluetoothbase.ui index 61cb95f..61e2bcf 100644 --- a/noncore/net/opietooth/manager/bluetoothbase.ui +++ b/noncore/net/opietooth/manager/bluetoothbase.ui | |||
@@ -13,4 +13,4 @@ | |||
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>596</width> | 14 | <width>228</width> |
15 | <height>480</height> | 15 | <height>320</height> |
16 | </rect> | 16 | </rect> |
@@ -46,29 +46,2 @@ | |||
46 | </attribute> | 46 | </attribute> |
47 | <widget> | ||
48 | <class>QPushButton</class> | ||
49 | <property stdset="1"> | ||
50 | <name>name</name> | ||
51 | <cstring>PushButton2</cstring> | ||
52 | </property> | ||
53 | <property stdset="1"> | ||
54 | <name>geometry</name> | ||
55 | <rect> | ||
56 | <x>50</x> | ||
57 | <y>260</y> | ||
58 | <width>154</width> | ||
59 | <height>31</height> | ||
60 | </rect> | ||
61 | </property> | ||
62 | <property stdset="1"> | ||
63 | <name>sizePolicy</name> | ||
64 | <sizepolicy> | ||
65 | <hsizetype>0</hsizetype> | ||
66 | <vsizetype>0</vsizetype> | ||
67 | </sizepolicy> | ||
68 | </property> | ||
69 | <property stdset="1"> | ||
70 | <name>text</name> | ||
71 | <string>Scan for Devices</string> | ||
72 | </property> | ||
73 | </widget> | ||
74 | <spacer> | 47 | <spacer> |
@@ -166,6 +139,6 @@ | |||
166 | <rect> | 139 | <rect> |
167 | <x>8</x> | 140 | <x>0</x> |
168 | <y>3</y> | 141 | <y>0</y> |
169 | <width>240</width> | 142 | <width>230</width> |
170 | <height>140</height> | 143 | <height>230</height> |
171 | </rect> | 144 | </rect> |
@@ -173,2 +146,29 @@ | |||
173 | </widget> | 146 | </widget> |
147 | <widget> | ||
148 | <class>QPushButton</class> | ||
149 | <property stdset="1"> | ||
150 | <name>name</name> | ||
151 | <cstring>PushButton2</cstring> | ||
152 | </property> | ||
153 | <property stdset="1"> | ||
154 | <name>geometry</name> | ||
155 | <rect> | ||
156 | <x>40</x> | ||
157 | <y>231</y> | ||
158 | <width>154</width> | ||
159 | <height>30</height> | ||
160 | </rect> | ||
161 | </property> | ||
162 | <property stdset="1"> | ||
163 | <name>sizePolicy</name> | ||
164 | <sizepolicy> | ||
165 | <hsizetype>0</hsizetype> | ||
166 | <vsizetype>0</vsizetype> | ||
167 | </sizepolicy> | ||
168 | </property> | ||
169 | <property stdset="1"> | ||
170 | <name>text</name> | ||
171 | <string>Scan for Devices</string> | ||
172 | </property> | ||
173 | </widget> | ||
174 | </widget> | 174 | </widget> |
@@ -221,6 +221,6 @@ | |||
221 | <rect> | 221 | <rect> |
222 | <x>8</x> | 222 | <x>0</x> |
223 | <y>3</y> | 223 | <y>0</y> |
224 | <width>241</width> | 224 | <width>240</width> |
225 | <height>301</height> | 225 | <height>240</height> |
226 | </rect> | 226 | </rect> |
@@ -243,3 +243,3 @@ | |||
243 | <name>name</name> | 243 | <name>name</name> |
244 | <cstring>TextLabel6</cstring> | 244 | <cstring>deviceNameLabel</cstring> |
245 | </property> | 245 | </property> |
@@ -249,4 +249,4 @@ | |||
249 | <x>10</x> | 249 | <x>10</x> |
250 | <y>20</y> | 250 | <y>10</y> |
251 | <width>121</width> | 251 | <width>70</width> |
252 | <height>20</height> | 252 | <height>20</height> |
@@ -263,3 +263,3 @@ | |||
263 | <name>name</name> | 263 | <name>name</name> |
264 | <cstring>TextLabel7</cstring> | 264 | <cstring>passkeyLabel</cstring> |
265 | </property> | 265 | </property> |
@@ -270,3 +270,3 @@ | |||
270 | <y>50</y> | 270 | <y>50</y> |
271 | <width>120</width> | 271 | <width>80</width> |
272 | <height>20</height> | 272 | <height>20</height> |
@@ -283,3 +283,3 @@ | |||
283 | <name>name</name> | 283 | <name>name</name> |
284 | <cstring>LineEdit4</cstring> | 284 | <cstring>passkeyLine</cstring> |
285 | </property> | 285 | </property> |
@@ -288,3 +288,3 @@ | |||
288 | <rect> | 288 | <rect> |
289 | <x>128</x> | 289 | <x>98</x> |
290 | <y>53</y> | 290 | <y>53</y> |
@@ -294,17 +294,5 @@ | |||
294 | </property> | 294 | </property> |
295 | </widget> | ||
296 | <widget> | ||
297 | <class>QLineEdit</class> | ||
298 | <property stdset="1"> | 295 | <property stdset="1"> |
299 | <name>name</name> | 296 | <name>echoMode</name> |
300 | <cstring>LineEdit5</cstring> | 297 | <enum>Password</enum> |
301 | </property> | ||
302 | <property stdset="1"> | ||
303 | <name>geometry</name> | ||
304 | <rect> | ||
305 | <x>128</x> | ||
306 | <y>13</y> | ||
307 | <width>120</width> | ||
308 | <height>22</height> | ||
309 | </rect> | ||
310 | </property> | 298 | </property> |
@@ -323,3 +311,3 @@ | |||
323 | <width>188</width> | 311 | <width>188</width> |
324 | <height>104</height> | 312 | <height>120</height> |
325 | </rect> | 313 | </rect> |
@@ -339,3 +327,3 @@ | |||
339 | <name>name</name> | 327 | <name>name</name> |
340 | <cstring>CheckBox1</cstring> | 328 | <cstring>authCheckBox</cstring> |
341 | </property> | 329 | </property> |
@@ -350,3 +338,3 @@ | |||
350 | <name>name</name> | 338 | <name>name</name> |
351 | <cstring>CheckBox2</cstring> | 339 | <cstring>cryptCheckBox</cstring> |
352 | </property> | 340 | </property> |
@@ -361,3 +349,3 @@ | |||
361 | <name>name</name> | 349 | <name>name</name> |
362 | <cstring>CheckBox5</cstring> | 350 | <cstring>pagescanCheckBox</cstring> |
363 | </property> | 351 | </property> |
@@ -372,3 +360,3 @@ | |||
372 | <name>name</name> | 360 | <name>name</name> |
373 | <cstring>CheckBox6</cstring> | 361 | <cstring>inquiryscanCheckBox</cstring> |
374 | </property> | 362 | </property> |
@@ -381,2 +369,38 @@ | |||
381 | </widget> | 369 | </widget> |
370 | <widget> | ||
371 | <class>QLineEdit</class> | ||
372 | <property stdset="1"> | ||
373 | <name>name</name> | ||
374 | <cstring>deviceNameLine</cstring> | ||
375 | </property> | ||
376 | <property stdset="1"> | ||
377 | <name>geometry</name> | ||
378 | <rect> | ||
379 | <x>98</x> | ||
380 | <y>13</y> | ||
381 | <width>120</width> | ||
382 | <height>22</height> | ||
383 | </rect> | ||
384 | </property> | ||
385 | </widget> | ||
386 | <widget> | ||
387 | <class>QPushButton</class> | ||
388 | <property stdset="1"> | ||
389 | <name>name</name> | ||
390 | <cstring>configApplyButton</cstring> | ||
391 | </property> | ||
392 | <property stdset="1"> | ||
393 | <name>geometry</name> | ||
394 | <rect> | ||
395 | <x>60</x> | ||
396 | <y>230</y> | ||
397 | <width>99</width> | ||
398 | <height>32</height> | ||
399 | </rect> | ||
400 | </property> | ||
401 | <property stdset="1"> | ||
402 | <name>text</name> | ||
403 | <string>Apply</string> | ||
404 | </property> | ||
405 | </widget> | ||
382 | </widget> | 406 | </widget> |
@@ -396,3 +420,3 @@ | |||
396 | <name>name</name> | 420 | <name>name</name> |
397 | <cstring>StutusLabel</cstring> | 421 | <cstring>StatusLabel</cstring> |
398 | </property> | 422 | </property> |
@@ -403,4 +427,4 @@ | |||
403 | <y>10</y> | 427 | <y>10</y> |
404 | <width>240</width> | 428 | <width>220</width> |
405 | <height>300</height> | 429 | <height>250</height> |
406 | </rect> | 430 | </rect> |
diff --git a/noncore/net/opietooth/manager/devicedialog.ui b/noncore/net/opietooth/manager/devicedialog.ui index 121fdf0..e5750ed 100644 --- a/noncore/net/opietooth/manager/devicedialog.ui +++ b/noncore/net/opietooth/manager/devicedialog.ui | |||
@@ -1,3 +1,3 @@ | |||
1 | <!DOCTYPE UI><UI> | 1 | <!DOCTYPE UI><UI> |
2 | <class>Form2</class> | 2 | <class>DeviceDialog</class> |
3 | <widget> | 3 | <widget> |
@@ -6,3 +6,3 @@ | |||
6 | <name>name</name> | 6 | <name>name</name> |
7 | <cstring>Form2</cstring> | 7 | <cstring>DeviceDialog</cstring> |
8 | </property> | 8 | </property> |
@@ -13,3 +13,3 @@ | |||
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>592</width> | 14 | <width>584</width> |
15 | <height>480</height> | 15 | <height>480</height> |
@@ -50,6 +50,6 @@ | |||
50 | <rect> | 50 | <rect> |
51 | <x>0</x> | 51 | <x>-10</x> |
52 | <y>20</y> | 52 | <y>0</y> |
53 | <width>240</width> | 53 | <width>240</width> |
54 | <height>290</height> | 54 | <height>320</height> |
55 | </rect> | 55 | </rect> |
diff --git a/noncore/net/opietooth/manager/scandialog.ui b/noncore/net/opietooth/manager/scandialog.ui index c8d018f..37847ba 100644 --- a/noncore/net/opietooth/manager/scandialog.ui +++ b/noncore/net/opietooth/manager/scandialog.ui | |||
@@ -1,3 +1,3 @@ | |||
1 | <!DOCTYPE UI><UI> | 1 | <!DOCTYPE UI><UI> |
2 | <class>Form3</class> | 2 | <class>ScanDialog</class> |
3 | <widget> | 3 | <widget> |
@@ -6,3 +6,3 @@ | |||
6 | <name>name</name> | 6 | <name>name</name> |
7 | <cstring>Form3</cstring> | 7 | <cstring>ScanDialog</cstring> |
8 | </property> | 8 | </property> |
@@ -13,3 +13,3 @@ | |||
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>368</width> | 14 | <width>360</width> |
15 | <height>392</height> | 15 | <height>392</height> |