Commit c4cb1b10afb18aaecfc23a46c7d6755a26e8d2b5
- Diff rendering mode:
- inline
- side by side
kcmodule/synaptikswidgets.cpp
(20 / 3)
|   | |||
| 153 | 153 | ui.setupUi(this); | |
| 154 | 154 | QDBusInterface touchpad("org.kde.synaptiks", "/Touchpad", | |
| 155 | 155 | "org.kde.Touchpad"); | |
| 156 | if (!touchpad.isValid()) { | ||
| 157 | return; | ||
| 158 | } | ||
| 159 | 156 | QDBusReply<int> fingers = touchpad.call("fingerDetection"); | |
| 160 | 157 | if (fingers.isValid()) { | |
| 161 | 158 | if (fingers.value() < 2) { | |
| … | … | ||
| 160 | 160 | ui.kcfg_VerticalTwoFingerScrolling->setEnabled(false); | |
| 161 | 161 | } | |
| 162 | 162 | } | |
| 163 | this->connect(ui.kcfg_HorizontalEdgeScrolling, SIGNAL(toggled(bool)), | ||
| 164 | SLOT(disableCoastingConfiguration())); | ||
| 165 | this->connect(ui.kcfg_VerticalEdgeScrolling, SIGNAL(toggled(bool)), | ||
| 166 | SLOT(disableCoastingConfiguration())); | ||
| 167 | } | ||
| 168 | |||
| 169 | void ScrollingPage::disableCoastingConfiguration() { | ||
| 170 | QRegExp pattern("kcfg_.+EdgeScrolling"); | ||
| 171 | QList<QCheckBox*> edgeScrollingOptions = | ||
| 172 | this->findChildren<QCheckBox*>(pattern); | ||
| 173 | Q_ASSERT(edgeScrollingOptions.size() == 2); | ||
| 174 | bool edgeScrollingEnabled = false; | ||
| 175 | foreach (const QCheckBox *option, edgeScrollingOptions) { | ||
| 176 | edgeScrollingEnabled |= option->isChecked(); | ||
| 177 | if (edgeScrollingEnabled) | ||
| 178 | break; | ||
| 179 | } | ||
| 180 | QGroupBox *kcfg_Coasting = this->findChild<QGroupBox*>("kcfg_Coasting"); | ||
| 181 | Q_ASSERT(kcfg_Coasting); | ||
| 182 | kcfg_Coasting->setEnabled(edgeScrollingEnabled); | ||
| 163 | 183 | } | |
| 164 | 184 | ||
| 165 | 185 | TappingPage::TappingPage(QWidget *parent): |
kcmodule/synaptikswidgets.h
(3 / 0)
|   | |||
| 76 | 76 | ||
| 77 | 77 | public: | |
| 78 | 78 | ScrollingPage(QWidget *parent=0); | |
| 79 | |||
| 80 | public Q_SLOTS: | ||
| 81 | void disableCoastingConfiguration(); | ||
| 79 | 82 | }; | |
| 80 | 83 | ||
| 81 | 84 | class TappingPage: public QWidget { |

