summaryrefslogtreecommitdiff
authorhash <hash>2002-08-19 18:03:39 (UTC)
committer hash <hash>2002-08-19 18:03:39 (UTC)
commit719dda9280813d323eebe3d2323271f953ed1144 (patch) (side-by-side diff)
treea36871f188640304551c5b70f09ad1755e5e0a7b
parentd68e038d1ba78a816e60990d5a36d6c52d8e11d3 (diff)
downloadopie-719dda9280813d323eebe3d2323271f953ed1144.zip
opie-719dda9280813d323eebe3d2323271f953ed1144.tar.gz
opie-719dda9280813d323eebe3d2323271f953ed1144.tar.bz2
added sample key color changing
Diffstat (more/less context) (show 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() {
custom_maps.remove(custom_maps[keymaps->currentItem() - default_maps.count()]);
// write the changes
Config config ("multikey");
config.setGroup("keymaps");
config.writeEntry("maps", custom_maps, QChar('|'));
}
// ConfigDlg::color {{{1
void ConfigDlg::keyColorButtonClicked() {
Config config ("multikey");
config.setGroup ("colors");
QStringList color = config.readListEntry("keycolor", QChar(','));
QColor newcolor = OColorDialog::getColor(QColor(color[0].toInt(), color[1].toInt(), color[2].toInt()));
color[0].setNum(newcolor.red());
color[1].setNum(newcolor.green());
color[2].setNum(newcolor.blue());
config.writeEntry("keycolor", color, QChar(','));
+ config.write();
key_color_button->setBackgroundColor(newcolor);
emit reloadKeyboard();
}
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() {
// have to repaint the keyboard
repaint(FALSE);
}
void Keyboard::setMapToFile(QString map) {
/* save change to multikey config file */
Config *config = new Config("multikey");
config->setGroup ("keymaps");
config->writeEntry ("current", map); // default closed
delete config;
delete keys;
if (QFile(map).exists())
keys = new Keys(map);
else
keys = new Keys();
repaint(FALSE);
}
-/* Keybaord::setColor {{{1 */
+/* Keybaord::reloadKeyboard {{{1 */
void Keyboard::reloadKeyboard() {
// reload colors and redraw
loadKeyboardColors();
repaint();
}
void Keyboard::loadKeyboardColors() {
Config config ("multikey");
config.setGroup("colors");
QStringList color;
color = config.readListEntry("keycolor", QChar(','));
if (color.isEmpty()) {
color = QStringList::split(",", "240,240,240");
config.writeEntry("keycolor", color.join(","));
}
keycolor = QColor(color[0].toInt(), color[1].toInt(), color[2].toInt());
color = config.readListEntry("keycolor_pressed", QChar(','));
if (color.isEmpty()) {