author | hash <hash> | 2002-08-23 18:28:03 (UTC) |
---|---|---|
committer | hash <hash> | 2002-08-23 18:28:03 (UTC) |
commit | 4e1a0d708c7ff0b7b1c3ad15bcae933b76e1ae5e (patch) (unidiff) | |
tree | 95731dcac369953c863e93ba0df3c2e90abff7d3 | |
parent | 3e37e49a35b786e5da747d4e19e898fb7135533c (diff) | |
download | opie-4e1a0d708c7ff0b7b1c3ad15bcae933b76e1ae5e.zip opie-4e1a0d708c7ff0b7b1c3ad15bcae933b76e1ae5e.tar.gz opie-4e1a0d708c7ff0b7b1c3ad15bcae933b76e1ae5e.tar.bz2 |
oops, fixed bug in color buttons
-rw-r--r-- | inputmethods/multikey/configdlg.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/inputmethods/multikey/configdlg.cpp b/inputmethods/multikey/configdlg.cpp index 9576579..10bc611 100644 --- a/inputmethods/multikey/configdlg.cpp +++ b/inputmethods/multikey/configdlg.cpp | |||
@@ -244,124 +244,124 @@ void ConfigDlg::setMap(int index) { | |||
244 | // ConfigDlg::addMap() {{{1 | 244 | // ConfigDlg::addMap() {{{1 |
245 | void ConfigDlg::addMap() { | 245 | void ConfigDlg::addMap() { |
246 | 246 | ||
247 | QString map = OFileDialog::getOpenFileName(1, QDir::home().absPath()); | 247 | QString map = OFileDialog::getOpenFileName(1, QDir::home().absPath()); |
248 | 248 | ||
249 | if (map.isNull()) return; | 249 | if (map.isNull()) return; |
250 | 250 | ||
251 | Config config ("multikey"); | 251 | Config config ("multikey"); |
252 | config.setGroup("keymaps"); | 252 | config.setGroup("keymaps"); |
253 | QStringList maps = config.readListEntry("maps", QChar('|')); | 253 | QStringList maps = config.readListEntry("maps", QChar('|')); |
254 | maps.append(map); | 254 | maps.append(map); |
255 | keymaps->insertItem(map); | 255 | keymaps->insertItem(map); |
256 | keymaps->setSelected(keymaps->count() - 1, true); | 256 | keymaps->setSelected(keymaps->count() - 1, true); |
257 | 257 | ||
258 | 258 | ||
259 | config.writeEntry("maps", maps, QChar('|')); | 259 | config.writeEntry("maps", maps, QChar('|')); |
260 | config.writeEntry("current", map); | 260 | config.writeEntry("current", map); |
261 | 261 | ||
262 | } | 262 | } |
263 | 263 | ||
264 | // ConfigDlg::removeMap() {{{1 | 264 | // ConfigDlg::removeMap() {{{1 |
265 | void ConfigDlg::removeMap() { | 265 | void ConfigDlg::removeMap() { |
266 | 266 | ||
267 | cout << "removing : " << custom_maps[keymaps->currentItem() - default_maps.count() - 1] << "\n"; | 267 | cout << "removing : " << custom_maps[keymaps->currentItem() - default_maps.count() - 1] << "\n"; |
268 | cout << "currentItem : " << keymaps->currentItem() << "\n"; | 268 | cout << "currentItem : " << keymaps->currentItem() << "\n"; |
269 | 269 | ||
270 | // move selection up one | 270 | // move selection up one |
271 | keymaps->setSelected(keymaps->currentItem() - 1, true); | 271 | keymaps->setSelected(keymaps->currentItem() - 1, true); |
272 | // delete the next selected item cus you just moved it up | 272 | // delete the next selected item cus you just moved it up |
273 | keymaps->removeItem(keymaps->currentItem() + 1); | 273 | keymaps->removeItem(keymaps->currentItem() + 1); |
274 | 274 | ||
275 | custom_maps.remove(custom_maps[keymaps->currentItem() - default_maps.count()]); | 275 | custom_maps.remove(custom_maps[keymaps->currentItem() - default_maps.count()]); |
276 | 276 | ||
277 | // write the changes | 277 | // write the changes |
278 | Config config ("multikey"); | 278 | Config config ("multikey"); |
279 | config.setGroup("keymaps"); | 279 | config.setGroup("keymaps"); |
280 | config.writeEntry("maps", custom_maps, QChar('|')); | 280 | config.writeEntry("maps", custom_maps, QChar('|')); |
281 | } | 281 | } |
282 | 282 | ||
283 | /* ConfigDlg::slots for the color buttons {{{1 | 283 | /* ConfigDlg::slots for the color buttons {{{1 |
284 | * | 284 | * |
285 | * these four slots are almost the same, except for the names. i was thinking | 285 | * these four slots are almost the same, except for the names. i was thinking |
286 | * of making a map with pointers to the buttons and names of the configEntry | 286 | * of making a map with pointers to the buttons and names of the configEntry |
287 | * so it could be one slot, but then there would be no way of telling which | 287 | * so it could be one slot, but then there would be no way of telling which |
288 | * of the buttons was clicked if they all connect to the same slot. | 288 | * of the buttons was clicked if they all connect to the same slot. |
289 | * | 289 | * |
290 | */ | 290 | */ |
291 | 291 | ||
292 | void ConfigDlg::keyColorClicked() { | 292 | void ConfigDlg::keyColorClicked() { |
293 | 293 | ||
294 | Config config ("multikey"); | 294 | Config config ("multikey"); |
295 | config.setGroup ("colors"); | 295 | config.setGroup ("colors"); |
296 | 296 | ||
297 | QStringList color = config.readListEntry("keycolor", QChar(',')); | 297 | QStringList color = config.readListEntry("keycolor", QChar(',')); |
298 | 298 | ||
299 | QColor newcolor = OColorDialog::getColor(QColor(color[0].toInt(), color[1].toInt(), color[2].toInt())); | 299 | QColor newcolor = OColorDialog::getColor(QColor(color[0].toInt(), color[1].toInt(), color[2].toInt())); |
300 | 300 | ||
301 | color[0].setNum(newcolor.red()); | 301 | color[0].setNum(newcolor.red()); |
302 | color[1].setNum(newcolor.green()); | 302 | color[1].setNum(newcolor.green()); |
303 | color[2].setNum(newcolor.blue()); | 303 | color[2].setNum(newcolor.blue()); |
304 | 304 | ||
305 | config.writeEntry("keycolor", color, QChar(',')); | 305 | config.writeEntry("keycolor", color, QChar(',')); |
306 | config.write(); | 306 | config.write(); |
307 | 307 | ||
308 | keycolor_button->setBackgroundColor(newcolor); | 308 | keycolor_button->setPalette(QPalette(newcolor)); |
309 | emit reloadKeyboard(); | 309 | emit reloadKeyboard(); |
310 | } | 310 | } |
311 | void ConfigDlg::keyColorPressedClicked() { | 311 | void ConfigDlg::keyColorPressedClicked() { |
312 | 312 | ||
313 | Config config ("multikey"); | 313 | Config config ("multikey"); |
314 | config.setGroup ("colors"); | 314 | config.setGroup ("colors"); |
315 | 315 | ||
316 | QStringList color = config.readListEntry("keycolor_pressed", QChar(',')); | 316 | QStringList color = config.readListEntry("keycolor_pressed", QChar(',')); |
317 | 317 | ||
318 | QColor newcolor = OColorDialog::getColor(QColor(color[0].toInt(), color[1].toInt(), color[2].toInt())); | 318 | QColor newcolor = OColorDialog::getColor(QColor(color[0].toInt(), color[1].toInt(), color[2].toInt())); |
319 | 319 | ||
320 | color[0].setNum(newcolor.red()); | 320 | color[0].setNum(newcolor.red()); |
321 | color[1].setNum(newcolor.green()); | 321 | color[1].setNum(newcolor.green()); |
322 | color[2].setNum(newcolor.blue()); | 322 | color[2].setNum(newcolor.blue()); |
323 | 323 | ||
324 | config.writeEntry("keycolor_pressed", color, QChar(',')); | 324 | config.writeEntry("keycolor_pressed", color, QChar(',')); |
325 | config.write(); | 325 | config.write(); |
326 | 326 | ||
327 | keycolor_pressed_button->setBackgroundColor(newcolor); | 327 | keycolor_pressed_button->setPalette(QPalette(newcolor)); |
328 | emit reloadKeyboard(); | 328 | emit reloadKeyboard(); |
329 | } | 329 | } |
330 | void ConfigDlg::keyColorLinesClicked() { | 330 | void ConfigDlg::keyColorLinesClicked() { |
331 | 331 | ||
332 | Config config ("multikey"); | 332 | Config config ("multikey"); |
333 | config.setGroup ("colors"); | 333 | config.setGroup ("colors"); |
334 | 334 | ||
335 | QStringList color = config.readListEntry("keycolor_lines", QChar(',')); | 335 | QStringList color = config.readListEntry("keycolor_lines", QChar(',')); |
336 | 336 | ||
337 | QColor newcolor = OColorDialog::getColor(QColor(color[0].toInt(), color[1].toInt(), color[2].toInt())); | 337 | QColor newcolor = OColorDialog::getColor(QColor(color[0].toInt(), color[1].toInt(), color[2].toInt())); |
338 | 338 | ||
339 | color[0].setNum(newcolor.red()); | 339 | color[0].setNum(newcolor.red()); |
340 | color[1].setNum(newcolor.green()); | 340 | color[1].setNum(newcolor.green()); |
341 | color[2].setNum(newcolor.blue()); | 341 | color[2].setNum(newcolor.blue()); |
342 | 342 | ||
343 | config.writeEntry("keycolor_lines", color, QChar(',')); | 343 | config.writeEntry("keycolor_lines", color, QChar(',')); |
344 | config.write(); | 344 | config.write(); |
345 | 345 | ||
346 | keycolor_lines_button->setBackgroundColor(newcolor); | 346 | keycolor_lines_button->setPalette(QPalette(newcolor)); |
347 | emit reloadKeyboard(); | 347 | emit reloadKeyboard(); |
348 | } | 348 | } |
349 | void ConfigDlg::textColorClicked() { | 349 | void ConfigDlg::textColorClicked() { |
350 | 350 | ||
351 | Config config ("multikey"); | 351 | Config config ("multikey"); |
352 | config.setGroup ("colors"); | 352 | config.setGroup ("colors"); |
353 | 353 | ||
354 | QStringList color = config.readListEntry("textcolor", QChar(',')); | 354 | QStringList color = config.readListEntry("textcolor", QChar(',')); |
355 | 355 | ||
356 | QColor newcolor = OColorDialog::getColor(QColor(color[0].toInt(), color[1].toInt(), color[2].toInt())); | 356 | QColor newcolor = OColorDialog::getColor(QColor(color[0].toInt(), color[1].toInt(), color[2].toInt())); |
357 | 357 | ||
358 | color[0].setNum(newcolor.red()); | 358 | color[0].setNum(newcolor.red()); |
359 | color[1].setNum(newcolor.green()); | 359 | color[1].setNum(newcolor.green()); |
360 | color[2].setNum(newcolor.blue()); | 360 | color[2].setNum(newcolor.blue()); |
361 | 361 | ||
362 | config.writeEntry("textcolor", color, QChar(',')); | 362 | config.writeEntry("textcolor", color, QChar(',')); |
363 | config.write(); | 363 | config.write(); |
364 | 364 | ||
365 | textcolor_button->setBackgroundColor(newcolor); | 365 | textcolor_button->setPalette(QPalette(newcolor)); |
366 | emit reloadKeyboard(); | 366 | emit reloadKeyboard(); |
367 | } | 367 | } |