Diffstat (limited to 'inputmethods/multikey/configdlg.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | inputmethods/multikey/configdlg.cpp | 31 |
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 | |||
@@ -108,24 +108,36 @@ ConfigDlg::ConfigDlg () : QTabWidget () | |||
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)); |
@@ -166,18 +178,27 @@ ConfigDlg::ConfigDlg () : QTabWidget () | |||
166 | 178 | ||
167 | } | 179 | } |
168 | 180 | ||
169 | void ConfigDlg::pickTog() { | 181 | void 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 | ||
190 | void 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 | */ |