summaryrefslogtreecommitdiff
path: root/inputmethods/multikey/configdlg.cpp
Unidiff
Diffstat (limited to 'inputmethods/multikey/configdlg.cpp') (more/less context) (show whitespace changes)
-rw-r--r--inputmethods/multikey/configdlg.cpp31
1 files changed, 26 insertions, 5 deletions
diff --git a/inputmethods/multikey/configdlg.cpp b/inputmethods/multikey/configdlg.cpp
index 59a290b..566b2b9 100644
--- a/inputmethods/multikey/configdlg.cpp
+++ b/inputmethods/multikey/configdlg.cpp
@@ -102,36 +102,48 @@ ConfigDlg::ConfigDlg () : QTabWidget ()
102 add_remove_grid->setSpacing(3); 102 add_remove_grid->setSpacing(3);
103 103
104 add_button = new QPushButton(tr("Add"), add_remove_grid); 104 add_button = new QPushButton(tr("Add"), add_remove_grid);
105 add_button->setFlat((bool)1); 105 add_button->setFlat((bool)1);
106 connect(add_button, SIGNAL(clicked()), SLOT(addMap())); 106 connect(add_button, SIGNAL(clicked()), SLOT(addMap()));
107 107
108 remove_button = new QPushButton(tr("Remove"), add_remove_grid); 108 remove_button = new QPushButton(tr("Remove"), add_remove_grid);
109 remove_button->setFlat((bool)1); 109 remove_button->setFlat((bool)1);
110 if ((int)map_dir.count() >= keymaps->currentItem()) 110 if ((int)map_dir.count() >= keymaps->currentItem())
111 remove_button->setDisabled(true); 111 remove_button->setDisabled(true);
112 connect(remove_button, SIGNAL(clicked()), SLOT(removeMap())); 112 connect(remove_button, SIGNAL(clicked()), SLOT(removeMap()));
113 113
114 pick_button = new QCheckBox(tr("Pickboard"), gen_box); 114 // make a box that will contain the buttons on the bottom
115 QGrid *other_grid = new QGrid(2, gen_box);
116 pick_button = new QCheckBox(tr("Pickboard"), other_grid);
115 117
116 config.setGroup ("pickboard"); 118 config.setGroup ("general");
117 bool pick_open = config.readBoolEntry ("open", "0"); // default closed 119 bool pick_open = config.readBoolEntry ("usePickboard", (bool)0); // default closed
118 if (pick_open) { 120 if (pick_open) {
119 121
120 pick_button->setChecked(true); 122 pick_button->setChecked(true);
121 } 123 }
122 124
123 // by connecting it after checking it, the signal isn't emmited 125 // by connecting it after checking it, the signal isn't emmited
124 connect (pick_button, SIGNAL(clicked()), this, SLOT(pickTog())); 126 connect (pick_button, SIGNAL(clicked()), this, SLOT(pickTog()));
125 127
128 repeat_button = new QCheckBox(tr("Key Repeat"), other_grid);
129 bool repeat_on = config.readBoolEntry ("useRepeat", (bool)1);
130
131 if (repeat_on) {
132
133 repeat_button->setChecked(true);
134 }
135 connect (repeat_button, SIGNAL(clicked()), this, SLOT(repeatTog()));
136
137
126 /* 138 /*
127 * 'color' tab 139 * 'color' tab
128 */ 140 */
129 141
130 QGrid *color_box = new QGrid(2, this); 142 QGrid *color_box = new QGrid(2, this);
131 color_box->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); 143 color_box->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
132 color_box->setMargin(3); 144 color_box->setMargin(3);
133 color_box->setSpacing(3); 145 color_box->setSpacing(3);
134 addTab(color_box, tr("Colors")); 146 addTab(color_box, tr("Colors"));
135 147
136 QLabel *label; 148 QLabel *label;
137 QStringList color; 149 QStringList color;
@@ -160,30 +172,39 @@ ConfigDlg::ConfigDlg () : QTabWidget ()
160 label = new QLabel(tr("Text Color"), color_box); 172 label = new QLabel(tr("Text Color"), color_box);
161 button = new QPushButton(color_box); 173 button = new QPushButton(color_box);
162 button->setFlat((bool)1); 174 button->setFlat((bool)1);
163 175
164 label = new QLabel("", color_box); // a spacer so the above buttons dont expand 176 label = new QLabel("", color_box); // a spacer so the above buttons dont expand
165 label->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); 177 label->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
166 178
167} 179}
168 180
169void ConfigDlg::pickTog() { 181void ConfigDlg::pickTog() {
170 182
171 Config config ("multikey"); 183 Config config ("multikey");
172 config.setGroup ("pickboard"); 184 config.setGroup ("general");
173 config.writeEntry ("open", pick_button->isChecked()); // default closed 185 config.writeEntry ("usePickboard", pick_button->isChecked()); // default closed
174 186
175 emit pickboardToggled(pick_button->isChecked()); 187 emit pickboardToggled(pick_button->isChecked());
176} 188}
177 189
190void ConfigDlg::repeatTog() {
191
192 Config config ("multikey");
193 config.setGroup ("general");
194 config.writeEntry ("useRepeat", repeat_button->isChecked()); // default closed
195
196 emit repeatToggled(repeat_button->isChecked());
197}
198
178/* 199/*
179 * the index is kinda screwy, because in the config file, index 0 is just the 200 * the index is kinda screwy, because in the config file, index 0 is just the
180 * first element in the QStringList, but here it's the "Current Language" 201 * first element in the QStringList, but here it's the "Current Language"
181 * listItem. therefor you have to minus one to the index before you access it. 202 * listItem. therefor you have to minus one to the index before you access it.
182 * 203 *
183 */ 204 */
184 205
185// ConfigDlg::setMap {{{1 206// ConfigDlg::setMap {{{1
186void ConfigDlg::setMap(int index) { 207void ConfigDlg::setMap(int index) {
187 208
188 if (index == 0) { 209 if (index == 0) {
189 210