summaryrefslogtreecommitdiff
path: root/inputmethods/multikey/configdlg.cpp
Side-by-side diff
Diffstat (limited to 'inputmethods/multikey/configdlg.cpp') (more/less context) (show whitespace changes)
-rw-r--r--inputmethods/multikey/configdlg.cpp54
1 files changed, 46 insertions, 8 deletions
diff --git a/inputmethods/multikey/configdlg.cpp b/inputmethods/multikey/configdlg.cpp
index ac132d3..1e104a6 100644
--- a/inputmethods/multikey/configdlg.cpp
+++ b/inputmethods/multikey/configdlg.cpp
@@ -3,2 +3,3 @@
* make a font selection thing (size too)
+ * make a cursor thing
*
@@ -26,2 +27,3 @@
#include <opie/ofiledialog.h>
+#include <opie/colordialog.h>
#include <qdir.h>
@@ -31,2 +33,3 @@
+// ConfigDlg::ConfigDlg() {{{1
ConfigDlg::ConfigDlg () : QTabWidget ()
@@ -106,2 +109,4 @@ ConfigDlg::ConfigDlg () : QTabWidget ()
remove_button->setFlat((bool)1);
+ if ((int)map_dir.count() >= keymaps->currentItem())
+ remove_button->setDisabled(true);
connect(remove_button, SIGNAL(clicked()), SLOT(removeMap()));
@@ -131,8 +136,21 @@ ConfigDlg::ConfigDlg () : QTabWidget ()
QLabel *label;
+ QStringList color;
label = new QLabel(tr("Key Color"), color_box);
- QPushButton *button = new QPushButton(color_box);
- button->setFlat((bool)1);
+ key_color_button = new QPushButton(color_box);
+ connect(key_color_button, SIGNAL(clicked()), SLOT(keyColorButtonClicked()));
+ key_color_button->setFlat((bool)1);
+
+ config.setGroup("colors");
+ color = config.readListEntry("keycolor", QChar(','));
+ if (color.isEmpty()) {
+ color = QStringList::split(",", "240,240,240");
+ config.writeEntry("keycolor", color.join(","));
+
+ }
+ key_color_button->setBackgroundColor(QColor(color[0].toInt(), color[1].toInt(), color[2].toInt()));
+
+
label = new QLabel(tr("Key Pressed Color"), color_box);
- button = new QPushButton(color_box);
+ QPushButton *button = new QPushButton(color_box);
button->setFlat((bool)1);
@@ -166,2 +184,3 @@ void ConfigDlg::pickTog() {
+// ConfigDlg::setMap {{{1
void ConfigDlg::setMap(int index) {
@@ -171,3 +190,2 @@ void ConfigDlg::setMap(int index) {
remove_button->setDisabled(true);
-
emit setMapToDefault();
@@ -177,3 +195,2 @@ void ConfigDlg::setMap(int index) {
remove_button->setDisabled(true);
-
emit setMapToFile(keymaps->text(index));
@@ -183,3 +200,2 @@ void ConfigDlg::setMap(int index) {
remove_button->setEnabled(true);
-
emit setMapToFile(keymaps->text(index));
@@ -188,2 +204,3 @@ void ConfigDlg::setMap(int index) {
+// ConfigDlg::addMap() {{{1
void ConfigDlg::addMap() {
@@ -199,3 +216,3 @@ void ConfigDlg::addMap() {
- config.writeEntry("maps", maps.join("|"));
+ config.writeEntry("maps", maps, QChar('|'));
config.writeEntry("current", map);
@@ -204,2 +221,3 @@ void ConfigDlg::addMap() {
+// ConfigDlg::removeMap() {{{1
void ConfigDlg::removeMap() {
@@ -219,3 +237,23 @@ void ConfigDlg::removeMap() {
config.setGroup("keymaps");
- config.writeEntry("maps", custom_maps.join("|"));
+ 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(','));
+
+ key_color_button->setBackgroundColor(newcolor);
+ emit reloadKeyboard();
}