|
|
166263 |
diff -Nur kcm-touchpad-0.3.1.orig/kcmtouchpad.cpp kcm-touchpad-0.3.1/kcmtouchpad.cpp
|
|
|
166263 |
--- kcm-touchpad-0.3.1.orig/kcmtouchpad.cpp 2010-04-24 00:21:40.000000000 +0200
|
|
|
166263 |
+++ kcm-touchpad-0.3.1/kcmtouchpad.cpp 2010-04-24 00:49:46.345242942 +0200
|
|
|
166263 |
@@ -176,6 +176,17 @@
|
|
|
166263 |
}
|
|
|
166263 |
}
|
|
|
166263 |
|
|
|
166263 |
+const void* TouchpadConfig::get_parameter(const char* name)
|
|
|
166263 |
+{
|
|
|
166263 |
+ const void* result = Touchpad::get_parameter(name);
|
|
|
166263 |
+ if (!result) {
|
|
|
166263 |
+ setup_failed = true;
|
|
|
166263 |
+ setEnabled(false);
|
|
|
166263 |
+ }
|
|
|
166263 |
+
|
|
|
166263 |
+ return result;
|
|
|
166263 |
+}
|
|
|
166263 |
+
|
|
|
166263 |
/*
|
|
|
166263 |
* This function is called when loading module.
|
|
|
166263 |
* It loads configuration from file "kcmtouchpadrc".
|
|
|
166263 |
@@ -190,64 +201,134 @@
|
|
|
166263 |
// loads every entry of configuration and sets corresponding widget
|
|
|
166263 |
// when configuration doesn't exist collect actual value from driver
|
|
|
166263 |
|
|
|
166263 |
+ const void* value;
|
|
|
166263 |
+
|
|
|
166263 |
if (this->propertiesList.contains(SYNAPTICS_PROP_OFF)) {
|
|
|
166263 |
- ui->TouchpadOnRB->setChecked(!config.readEntry("TouchpadOff", !(int)*(char*)Touchpad::get_parameter("TouchpadOff")));
|
|
|
166263 |
- ui->TouchpadOffWOMoveCB->setCheckState(config.readEntry("TouchpadOff", (int)*(char*)Touchpad::get_parameter("TouchpadOff")) == 2 ? Qt::Checked : Qt::Unchecked);
|
|
|
166263 |
+ value = get_parameter("TouchpadOff");
|
|
|
166263 |
+ if (!value) return;
|
|
|
166263 |
+ ui->TouchpadOnRB->setChecked(!config.readEntry("TouchpadOff", !(int)*(char*)value));
|
|
|
166263 |
+
|
|
|
166263 |
+ value = get_parameter("TouchpadOff");
|
|
|
166263 |
+ if (!value) return;
|
|
|
166263 |
+ ui->TouchpadOffWOMoveCB->setCheckState(config.readEntry("TouchpadOff", (int)*(char*)value) == 2 ? Qt::Checked : Qt::Unchecked);
|
|
|
166263 |
}
|
|
|
166263 |
|
|
|
166263 |
//ui->SmartModeEnableCB->setCheckState(config.readEntry("SmartModeEnabled", false) ? Qt::Checked : Qt::Unchecked);
|
|
|
166263 |
//ui->SmartModeDelayS->setValue(config.readEntry("SmartModeDelay", 1000));
|
|
|
166263 |
|
|
|
166263 |
if (this->propertiesList.contains(SYNAPTICS_PROP_FINGER)) {
|
|
|
166263 |
- ui->SensitivityValueS->setValue(config.readEntry("FingerLow", *(int*)Touchpad::get_parameter("FingerLow") / 10));
|
|
|
166263 |
+ value = get_parameter("FingerLow");
|
|
|
166263 |
+ if (!value) return;
|
|
|
166263 |
+ ui->SensitivityValueS->setValue(config.readEntry("FingerLow", *(int*)value / 10));
|
|
|
166263 |
}
|
|
|
166263 |
if (this->propertiesList.contains(SYNAPTICS_PROP_SCROLL_EDGE)) {
|
|
|
166263 |
- ui->ScrollVertEnableCB->setCheckState(config.readEntry("VertEdgeScroll", (int)*(char*)Touchpad::get_parameter("VertEdgeScroll")) ? Qt::Checked : Qt::Unchecked);
|
|
|
166263 |
- ui->ScrollHorizEnableCB->setCheckState(config.readEntry("HorizEdgeScroll", (int)*(char*)Touchpad::get_parameter("HorizEdgeScroll")) ? Qt::Checked : Qt::Unchecked);
|
|
|
166263 |
+ value = get_parameter("VertEdgeScroll");
|
|
|
166263 |
+ if (!value) return;
|
|
|
166263 |
+ ui->ScrollVertEnableCB->setCheckState(config.readEntry("VertEdgeScroll", (int)*(char*)value) ? Qt::Checked : Qt::Unchecked);
|
|
|
166263 |
+
|
|
|
166263 |
+ value = get_parameter("HorizEdgeScroll");
|
|
|
166263 |
+ if (!value) return;
|
|
|
166263 |
+ ui->ScrollHorizEnableCB->setCheckState(config.readEntry("HorizEdgeScroll", (int)*(char*)value) ? Qt::Checked : Qt::Unchecked);
|
|
|
166263 |
+
|
|
|
166263 |
if (this->propertiesList.contains(SYNAPTICS_PROP_COASTING_SPEED)) {
|
|
|
166263 |
- ui->ScrollCoastingCornerEnableCB->setCheckState(config.readEntry("CornerCoasting", (int)*(char*)Touchpad::get_parameter("CornerCoasting")) ? Qt::Checked : Qt::Unchecked);
|
|
|
166263 |
+ value = get_parameter("CornerCoasting");
|
|
|
166263 |
+ if (!value) return;
|
|
|
166263 |
+ ui->ScrollCoastingCornerEnableCB->setCheckState(config.readEntry("CornerCoasting", (int)*(char*)value) ? Qt::Checked : Qt::Unchecked);
|
|
|
166263 |
}
|
|
|
166263 |
}
|
|
|
166263 |
if (this->propertiesList.contains(SYNAPTICS_PROP_SCROLL_DISTANCE)) {
|
|
|
166263 |
- ui->ScrollVertSpeedS->setValue(config.readEntry("VertScrollDelta", *(int*)Touchpad::get_parameter("VertScrollDelta")));
|
|
|
166263 |
- ui->ScrollHorizSpeedS->setValue(config.readEntry("HorizScrollDelta", *(int*)Touchpad::get_parameter("HorizScrollDelta")));
|
|
|
166263 |
+ value = get_parameter("VertScrollDelta");
|
|
|
166263 |
+ if (!value) return;
|
|
|
166263 |
+ ui->ScrollVertSpeedS->setValue(config.readEntry("VertScrollDelta", *(int*)value));
|
|
|
166263 |
+
|
|
|
166263 |
+ value = get_parameter("HorizScrollDelta");
|
|
|
166263 |
+ if (!value) return;
|
|
|
166263 |
+ ui->ScrollHorizSpeedS->setValue(config.readEntry("HorizScrollDelta", *(int*)value));
|
|
|
166263 |
}
|
|
|
166263 |
if (this->propertiesList.contains(SYNAPTICS_PROP_SCROLL_TWOFINGER)) {
|
|
|
166263 |
- ui->ScrollVertTFEnableCB->setCheckState(config.readEntry("VertTwoFingerScroll", (int)*(char*)Touchpad::get_parameter("VertTwoFingerScroll")) ? Qt::Checked : Qt::Unchecked);
|
|
|
166263 |
- ui->ScrollHorizTFEnableCB->setCheckState(config.readEntry("HorizTwoFingerScroll", (int)*(char*)Touchpad::get_parameter("HorizTwoFingerScroll")) ? Qt::Checked : Qt::Unchecked);
|
|
|
166263 |
+ value = get_parameter("VertTwoFingerScroll");
|
|
|
166263 |
+ if (!value) return;
|
|
|
166263 |
+ ui->ScrollVertTFEnableCB->setCheckState(config.readEntry("VertTwoFingerScroll", (int)*(char*)value) ? Qt::Checked : Qt::Unchecked);
|
|
|
166263 |
+
|
|
|
166263 |
+ value = get_parameter("HorizTwoFingerScroll");
|
|
|
166263 |
+ if (!value) return;
|
|
|
166263 |
+ ui->ScrollHorizTFEnableCB->setCheckState(config.readEntry("HorizTwoFingerScroll", (int)*(char*)value) ? Qt::Checked : Qt::Unchecked);
|
|
|
166263 |
}
|
|
|
166263 |
if (this->propertiesList.contains(SYNAPTICS_PROP_COASTING_SPEED)) {
|
|
|
166263 |
- ui->ScrollCoastingEnableCB->setCheckState(config.readEntry("CoastingSpeed", *(double*)Touchpad::get_parameter("CoastingSpeed")) ? Qt::Checked : Qt::Unchecked);
|
|
|
166263 |
- ui->ScrollCoastingSpeedS->setValue(config.readEntry("CoastingSpeed", *(double*)Touchpad::get_parameter("CoastingSpeed")) * 100.0f);
|
|
|
166263 |
+ value = get_parameter("CoastingSpeed");
|
|
|
166263 |
+ if (!value) return;
|
|
|
166263 |
+ ui->ScrollCoastingEnableCB->setCheckState(config.readEntry("CoastingSpeed", *(double*)value) ? Qt::Checked : Qt::Unchecked);
|
|
|
166263 |
+
|
|
|
166263 |
+ value = get_parameter("CoastingSpeed");
|
|
|
166263 |
+ if (!value) return;
|
|
|
166263 |
+ ui->ScrollCoastingSpeedS->setValue(config.readEntry("CoastingSpeed", *(double*)value) * 100.0f);
|
|
|
166263 |
}
|
|
|
166263 |
if (this->propertiesList.contains(SYNAPTICS_PROP_CIRCULAR_SCROLLING)) {
|
|
|
166263 |
- ui->ScrollCircularEnableCB->setCheckState(config.readEntry("CircularScrolling", (int)*(char*)Touchpad::get_parameter("CircularScrolling")) ? Qt::Checked : Qt::Unchecked);
|
|
|
166263 |
+ value = get_parameter("CircularScrolling");
|
|
|
166263 |
+ if (!value) return;
|
|
|
166263 |
+ ui->ScrollCircularEnableCB->setCheckState(config.readEntry("CircularScrolling", (int)*(char*)value) ? Qt::Checked : Qt::Unchecked);
|
|
|
166263 |
}
|
|
|
166263 |
if (this->propertiesList.contains(SYNAPTICS_PROP_CIRCULAR_SCROLLING_DIST)) {
|
|
|
166263 |
- ui->ScrollCircularSpeedS->setValue(config.readEntry("CircScrollDelta", *(double*)Touchpad::get_parameter("CircScrollDelta")));
|
|
|
166263 |
+ value = get_parameter("CircScrollDelta");
|
|
|
166263 |
+ if (!value) return;
|
|
|
166263 |
+ ui->ScrollCircularSpeedS->setValue(config.readEntry("CircScrollDelta", *(double*)value));
|
|
|
166263 |
}
|
|
|
166263 |
if (this->propertiesList.contains(SYNAPTICS_PROP_CIRCULAR_SCROLLING_TRIGGER)) {
|
|
|
166263 |
- ui->ScrollCircularCornersCBB->setCurrentIndex(config.readEntry("CircScrollTrigger", (int)*(char*)Touchpad::get_parameter("CircScrollTrigger")));
|
|
|
166263 |
+ value = get_parameter("CircScrollTrigger");
|
|
|
166263 |
+ if (!value) return;
|
|
|
166263 |
+ ui->ScrollCircularCornersCBB->setCurrentIndex(config.readEntry("CircScrollTrigger", (int)*(char*)value));
|
|
|
166263 |
}
|
|
|
166263 |
if (this->propertiesList.contains(SYNAPTICS_PROP_TAP_TIME)) {
|
|
|
166263 |
- ui->TappingEnableCB->setCheckState(config.readEntry("MaxTapTime", *(int*)Touchpad::get_parameter("MaxTapTime")) ? Qt::Checked : Qt::Unchecked);
|
|
|
166263 |
+ value = get_parameter("MaxTapTime");
|
|
|
166263 |
+ if (!value) return;
|
|
|
166263 |
+ ui->TappingEnableCB->setCheckState(config.readEntry("MaxTapTime", *(int*)value) ? Qt::Checked : Qt::Unchecked);
|
|
|
166263 |
}
|
|
|
166263 |
if (this->propertiesList.contains(SYNAPTICS_PROP_TAP_MOVE)) {
|
|
|
166263 |
- ui->TappingMaxMoveValueS->setValue(config.readEntry("MaxTapMove", *(int*)Touchpad::get_parameter("MaxTapMove")));
|
|
|
166263 |
+ value = get_parameter("MaxTapMove");
|
|
|
166263 |
+ if (!value) return;
|
|
|
166263 |
+ ui->TappingMaxMoveValueS->setValue(config.readEntry("MaxTapMove", *(int*)value));
|
|
|
166263 |
}
|
|
|
166263 |
if (this->propertiesList.contains(SYNAPTICS_PROP_TAP_DURATIONS)) {
|
|
|
166263 |
- ui->TappingTimeoutValueS->setValue(config.readEntry("SingleTapTimeout", *(int*)Touchpad::get_parameter("SingleTapTimeout")));
|
|
|
166263 |
- ui->TappingDoubleTimeValueS->setValue(config.readEntry("MaxDoubleTapTime", *(int*)Touchpad::get_parameter("MaxDoubleTapTime")));
|
|
|
166263 |
- ui->TappingClickTimeValueS->setValue(config.readEntry("ClickTime", *(int*)Touchpad::get_parameter("ClickTime")));
|
|
|
166263 |
+ value = get_parameter("SingleTapTimeout");
|
|
|
166263 |
+ if (!value) return;
|
|
|
166263 |
+ ui->TappingTimeoutValueS->setValue(config.readEntry("SingleTapTimeout", *(int*)value));
|
|
|
166263 |
+
|
|
|
166263 |
+ value = get_parameter("MaxDoubleTapTime");
|
|
|
166263 |
+ if (!value) return;
|
|
|
166263 |
+ ui->TappingDoubleTimeValueS->setValue(config.readEntry("MaxDoubleTapTime", *(int*)value));
|
|
|
166263 |
+
|
|
|
166263 |
+ value = get_parameter("ClickTime");
|
|
|
166263 |
+ if (!value) return;
|
|
|
166263 |
+ ui->TappingClickTimeValueS->setValue(config.readEntry("ClickTime", *(int*)value));
|
|
|
166263 |
}
|
|
|
166263 |
if (this->propertiesList.contains(SYNAPTICS_PROP_TAP_ACTION)) {
|
|
|
166263 |
- tappingButtonsMap[Synaptics::OneFinger] = config.readEntry("TapButton1", (int)*(char*)Touchpad::get_parameter("TapButton1"));
|
|
|
166263 |
- tappingButtonsMap[Synaptics::TwoFingers] = config.readEntry("TapButton2", (int)*(char*)Touchpad::get_parameter("TapButton2"));
|
|
|
166263 |
- tappingButtonsMap[Synaptics::ThreeFingers] = config.readEntry("TapButton3", (int)*(char*)Touchpad::get_parameter("TapButton3"));
|
|
|
166263 |
- tappingButtonsMap[Synaptics::RightTop] = config.readEntry("RTCornerButton", (int)*(char*)Touchpad::get_parameter("RTCornerButton"));
|
|
|
166263 |
- tappingButtonsMap[Synaptics::RightBottom] = config.readEntry("RBCornerButton", (int)*(char*)Touchpad::get_parameter("RBCornerButton"));
|
|
|
166263 |
- tappingButtonsMap[Synaptics::LeftTop] = config.readEntry("LTCornerButton", (int)*(char*)Touchpad::get_parameter("LTCornerButton"));
|
|
|
166263 |
- tappingButtonsMap[Synaptics::LeftBottom] = config.readEntry("LBCornerButton", (int)*(char*)Touchpad::get_parameter("LBCornerButton"));
|
|
|
166263 |
+ value = get_parameter("TapButton1");
|
|
|
166263 |
+ if (!value) return;
|
|
|
166263 |
+ tappingButtonsMap[Synaptics::OneFinger] = config.readEntry("TapButton1", (int)*(char*)value);
|
|
|
166263 |
+
|
|
|
166263 |
+ value = get_parameter("TapButton2");
|
|
|
166263 |
+ if (!value) return;
|
|
|
166263 |
+ tappingButtonsMap[Synaptics::TwoFingers] = config.readEntry("TapButton2", (int)*(char*)value);
|
|
|
166263 |
+
|
|
|
166263 |
+ value = get_parameter("TapButton3");
|
|
|
166263 |
+ if (!value) return;
|
|
|
166263 |
+ tappingButtonsMap[Synaptics::ThreeFingers] = config.readEntry("TapButton3", (int)*(char*)value);
|
|
|
166263 |
+
|
|
|
166263 |
+ value = get_parameter("RTCornerButton");
|
|
|
166263 |
+ if (!value) return;
|
|
|
166263 |
+ tappingButtonsMap[Synaptics::RightTop] = config.readEntry("RTCornerButton", (int)*(char*)value);
|
|
|
166263 |
+
|
|
|
166263 |
+ value = get_parameter("RBCornerButton");
|
|
|
166263 |
+ if (!value) return;
|
|
|
166263 |
+ tappingButtonsMap[Synaptics::RightBottom] = config.readEntry("RBCornerButton", (int)*(char*)value);
|
|
|
166263 |
+
|
|
|
166263 |
+ value = get_parameter("LTCornerButton");
|
|
|
166263 |
+ if (!value) return;
|
|
|
166263 |
+ tappingButtonsMap[Synaptics::LeftTop] = config.readEntry("LTCornerButton", (int)*(char*)value);
|
|
|
166263 |
+
|
|
|
166263 |
+ value = get_parameter("LBCornerButton");
|
|
|
166263 |
+ if (!value) return;
|
|
|
166263 |
+ tappingButtonsMap[Synaptics::LeftBottom] = config.readEntry("LBCornerButton", (int)*(char*)value);
|
|
|
166263 |
}
|
|
|
166263 |
}
|
|
|
166263 |
|
|
|
166263 |
diff -Nur kcm-touchpad-0.3.1.orig/kcmtouchpad.h kcm-touchpad-0.3.1/kcmtouchpad.h
|
|
|
166263 |
--- kcm-touchpad-0.3.1.orig/kcmtouchpad.h 2010-01-12 14:02:07.000000000 +0100
|
|
|
166263 |
+++ kcm-touchpad-0.3.1/kcmtouchpad.h 2010-04-24 00:57:57.305243725 +0200
|
|
|
166263 |
@@ -56,6 +56,7 @@
|
|
|
166263 |
bool apply();
|
|
|
166263 |
static void applySensitivity(int val);
|
|
|
166263 |
void enableProperties();
|
|
|
166263 |
+ const void* get_parameter(const char* name);
|
|
|
166263 |
|
|
|
166263 |
Ui_TouchpadConfigWidget* ui;
|
|
|
166263 |
|