Changeset View
Changeset View
Standalone View
Standalone View
kcms/input/mouse.cpp
Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Line(s) | 84 | { | |||
---|---|---|---|---|---|
93 | 93 | | |||
94 | connect(singleClick, SIGNAL(clicked()), this, SLOT(changed())); | 94 | connect(singleClick, SIGNAL(clicked()), this, SLOT(changed())); | ||
95 | connect(cbScrollPolarity, SIGNAL(clicked()), this, SLOT(changed())); | 95 | connect(cbScrollPolarity, SIGNAL(clicked()), this, SLOT(changed())); | ||
96 | connect(cbScrollPolarity, SIGNAL(clicked()), this, SLOT(slotScrollPolarityChanged())); | 96 | connect(cbScrollPolarity, SIGNAL(clicked()), this, SLOT(slotScrollPolarityChanged())); | ||
97 | 97 | | |||
98 | connect(accel, SIGNAL(valueChanged(double)), this, SLOT(changed())); | 98 | connect(accel, SIGNAL(valueChanged(double)), this, SLOT(changed())); | ||
99 | connect(thresh, SIGNAL(valueChanged(int)), this, SLOT(changed())); | 99 | connect(thresh, SIGNAL(valueChanged(int)), this, SLOT(changed())); | ||
100 | connect(thresh, SIGNAL(valueChanged(int)), this, SLOT(slotThreshChanged(int))); | 100 | connect(thresh, SIGNAL(valueChanged(int)), this, SLOT(slotThreshChanged(int))); | ||
101 | connect(accelProfileComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(changed())); | ||||
101 | slotThreshChanged(thresh->value()); | 102 | slotThreshChanged(thresh->value()); | ||
102 | 103 | | |||
103 | // It would be nice if the user had a test field. | 104 | // It would be nice if the user had a test field. | ||
104 | // Selecting such values in milliseconds is not intuitive | 105 | // Selecting such values in milliseconds is not intuitive | ||
105 | connect(doubleClickInterval, SIGNAL(valueChanged(int)), this, SLOT(changed())); | 106 | connect(doubleClickInterval, SIGNAL(valueChanged(int)), this, SLOT(changed())); | ||
106 | 107 | | |||
107 | connect(dragStartTime, SIGNAL(valueChanged(int)), this, SLOT(changed())); | 108 | connect(dragStartTime, SIGNAL(valueChanged(int)), this, SLOT(changed())); | ||
108 | 109 | | |||
▲ Show 20 Lines • Show All 105 Lines • ▼ Show 20 Line(s) | 210 | if (backend) { | |||
214 | } | 215 | } | ||
215 | else | 216 | else | ||
216 | { | 217 | { | ||
217 | cbScrollPolarity->setEnabled(false); | 218 | cbScrollPolarity->setEnabled(false); | ||
218 | cbScrollPolarity->hide(); | 219 | cbScrollPolarity->hide(); | ||
219 | } | 220 | } | ||
220 | } | 221 | } | ||
221 | 222 | | |||
223 | auto accelerationProfiles = backend->supportedAccelerationProfiles(); | ||||
224 | accelProfileComboBox->setEnabled(!accelerationProfiles.isEmpty()); | ||||
225 | accelProfileComboBox->setVisible(!accelerationProfiles.isEmpty()); | ||||
226 | accelerationProfileLabel->setEnabled(!accelerationProfiles.isEmpty()); | ||||
227 | accelerationProfileLabel->setVisible(!accelerationProfiles.isEmpty()); | ||||
228 | accelProfileComboBox->clear(); | ||||
229 | int idx = 0; | ||||
230 | for (const auto &profile : accelerationProfiles) { | ||||
231 | accelProfileComboBox->addItem(i18n(profile.toUtf8().constData()), profile); | ||||
232 | if (profile == settings->currentAccelProfile) { | ||||
233 | accelProfileComboBox->setCurrentIndex(idx); | ||||
234 | } | ||||
235 | idx++; | ||||
236 | } | ||||
237 | | ||||
238 | | ||||
222 | rightHanded->setEnabled(settings->handedEnabled); | 239 | rightHanded->setEnabled(settings->handedEnabled); | ||
223 | leftHanded->setEnabled(settings->handedEnabled); | 240 | leftHanded->setEnabled(settings->handedEnabled); | ||
224 | if (cbScrollPolarity->isEnabled()) | 241 | if (cbScrollPolarity->isEnabled()) | ||
225 | cbScrollPolarity->setEnabled(settings->handedEnabled); | 242 | cbScrollPolarity->setEnabled(settings->handedEnabled); | ||
226 | cbScrollPolarity->setChecked(settings->reverseScrollPolarity); | 243 | cbScrollPolarity->setChecked(settings->reverseScrollPolarity); | ||
227 | 244 | | |||
228 | setAccel(settings->accelRate); | 245 | setAccel(settings->accelRate); | ||
229 | setThreshold(settings->thresholdMove); | 246 | setThreshold(settings->thresholdMove); | ||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Line(s) | 288 | { | |||
274 | settings->handed = getHandedness(); | 291 | settings->handed = getHandedness(); | ||
275 | 292 | | |||
276 | settings->doubleClickInterval = doubleClickInterval->value(); | 293 | settings->doubleClickInterval = doubleClickInterval->value(); | ||
277 | settings->dragStartTime = dragStartTime->value(); | 294 | settings->dragStartTime = dragStartTime->value(); | ||
278 | settings->dragStartDist = dragStartDist->value(); | 295 | settings->dragStartDist = dragStartDist->value(); | ||
279 | settings->wheelScrollLines = wheelScrollLines->value(); | 296 | settings->wheelScrollLines = wheelScrollLines->value(); | ||
280 | settings->singleClick = !doubleClick->isChecked(); | 297 | settings->singleClick = !doubleClick->isChecked(); | ||
281 | settings->reverseScrollPolarity = cbScrollPolarity->isChecked(); | 298 | settings->reverseScrollPolarity = cbScrollPolarity->isChecked(); | ||
299 | settings->currentAccelProfile = accelProfileComboBox->itemData(accelProfileComboBox->currentIndex()).toString(); | ||||
282 | 300 | | |||
283 | settings->apply(backend); | 301 | settings->apply(backend); | ||
284 | KConfig config("kcminputrc"); | 302 | KConfig config("kcminputrc"); | ||
285 | settings->save(&config); | 303 | settings->save(&config); | ||
286 | 304 | | |||
287 | KConfig ac("kaccessrc"); | 305 | KConfig ac("kaccessrc"); | ||
288 | 306 | | |||
289 | KConfigGroup group = ac.group("Mouse"); | 307 | KConfigGroup group = ac.group("Mouse"); | ||
▲ Show 20 Lines • Show All 73 Lines • Show Last 20 Lines |