summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--inputmethods/multikey/configdlg.cpp1
-rw-r--r--inputmethods/multikey/keyboard.cpp2
2 files changed, 2 insertions, 1 deletions
diff --git a/inputmethods/multikey/configdlg.cpp b/inputmethods/multikey/configdlg.cpp
index 1e104a6..59a290b 100644
--- a/inputmethods/multikey/configdlg.cpp
+++ b/inputmethods/multikey/configdlg.cpp
@@ -232,28 +232,29 @@ void ConfigDlg::removeMap() {
232 232
233 custom_maps.remove(custom_maps[keymaps->currentItem() - default_maps.count()]); 233 custom_maps.remove(custom_maps[keymaps->currentItem() - default_maps.count()]);
234 234
235 // write the changes 235 // write the changes
236 Config config ("multikey"); 236 Config config ("multikey");
237 config.setGroup("keymaps"); 237 config.setGroup("keymaps");
238 config.writeEntry("maps", custom_maps, QChar('|')); 238 config.writeEntry("maps", custom_maps, QChar('|'));
239} 239}
240 240
241// ConfigDlg::color {{{1 241// ConfigDlg::color {{{1
242void ConfigDlg::keyColorButtonClicked() { 242void ConfigDlg::keyColorButtonClicked() {
243 243
244 Config config ("multikey"); 244 Config config ("multikey");
245 config.setGroup ("colors"); 245 config.setGroup ("colors");
246 246
247 QStringList color = config.readListEntry("keycolor", QChar(',')); 247 QStringList color = config.readListEntry("keycolor", QChar(','));
248 248
249 QColor newcolor = OColorDialog::getColor(QColor(color[0].toInt(), color[1].toInt(), color[2].toInt())); 249 QColor newcolor = OColorDialog::getColor(QColor(color[0].toInt(), color[1].toInt(), color[2].toInt()));
250 250
251 color[0].setNum(newcolor.red()); 251 color[0].setNum(newcolor.red());
252 color[1].setNum(newcolor.green()); 252 color[1].setNum(newcolor.green());
253 color[2].setNum(newcolor.blue()); 253 color[2].setNum(newcolor.blue());
254 254
255 config.writeEntry("keycolor", color, QChar(',')); 255 config.writeEntry("keycolor", color, QChar(','));
256 config.write();
256 257
257 key_color_button->setBackgroundColor(newcolor); 258 key_color_button->setBackgroundColor(newcolor);
258 emit reloadKeyboard(); 259 emit reloadKeyboard();
259} 260}
diff --git a/inputmethods/multikey/keyboard.cpp b/inputmethods/multikey/keyboard.cpp
index 68918a6..8280297 100644
--- a/inputmethods/multikey/keyboard.cpp
+++ b/inputmethods/multikey/keyboard.cpp
@@ -527,49 +527,49 @@ void Keyboard::setMapToDefault() {
527 527
528 // have to repaint the keyboard 528 // have to repaint the keyboard
529 repaint(FALSE); 529 repaint(FALSE);
530} 530}
531 531
532void Keyboard::setMapToFile(QString map) { 532void Keyboard::setMapToFile(QString map) {
533 533
534 /* save change to multikey config file */ 534 /* save change to multikey config file */
535 Config *config = new Config("multikey"); 535 Config *config = new Config("multikey");
536 config->setGroup ("keymaps"); 536 config->setGroup ("keymaps");
537 config->writeEntry ("current", map); // default closed 537 config->writeEntry ("current", map); // default closed
538 538
539 delete config; 539 delete config;
540 540
541 delete keys; 541 delete keys;
542 if (QFile(map).exists()) 542 if (QFile(map).exists())
543 keys = new Keys(map); 543 keys = new Keys(map);
544 else 544 else
545 keys = new Keys(); 545 keys = new Keys();
546 546
547 repaint(FALSE); 547 repaint(FALSE);
548 548
549} 549}
550 550
551/* Keybaord::setColor {{{1 */ 551/* Keybaord::reloadKeyboard {{{1 */
552void Keyboard::reloadKeyboard() { 552void Keyboard::reloadKeyboard() {
553 553
554 // reload colors and redraw 554 // reload colors and redraw
555 loadKeyboardColors(); 555 loadKeyboardColors();
556 repaint(); 556 repaint();
557 557
558} 558}
559 559
560void Keyboard::loadKeyboardColors() { 560void Keyboard::loadKeyboardColors() {
561 561
562 Config config ("multikey"); 562 Config config ("multikey");
563 config.setGroup("colors"); 563 config.setGroup("colors");
564 564
565 QStringList color; 565 QStringList color;
566 color = config.readListEntry("keycolor", QChar(',')); 566 color = config.readListEntry("keycolor", QChar(','));
567 if (color.isEmpty()) { 567 if (color.isEmpty()) {
568 color = QStringList::split(",", "240,240,240"); 568 color = QStringList::split(",", "240,240,240");
569 config.writeEntry("keycolor", color.join(",")); 569 config.writeEntry("keycolor", color.join(","));
570 570
571 } 571 }
572 keycolor = QColor(color[0].toInt(), color[1].toInt(), color[2].toInt()); 572 keycolor = QColor(color[0].toInt(), color[1].toInt(), color[2].toInt());
573 573
574 color = config.readListEntry("keycolor_pressed", QChar(',')); 574 color = config.readListEntry("keycolor_pressed", QChar(','));
575 if (color.isEmpty()) { 575 if (color.isEmpty()) {