Sophie

Sophie

distrib > Mageia > 3 > i586 > media > core-release-src > by-pkgid > 9df0d959fbf5dc59a5d389a4109bc8f4 > files > 3

kcm_touchpad-0.3.1-9.mga3.src.rpm

From 9ab0f0c820b35f4e79ff4165402fe046ba44aa47 Mon Sep 17 00:00:00 2001
From: Andrey Borzenkov <arvidjaar@mail.ru>
Date: Wed, 3 Feb 2010 22:26:57 +0300
Subject: [PATCH 3/5] Do not offer for configuration actions that touchpad does not support

Check for touchpad capabilities and do not enable GUI elements
for properties that touchpad does not claim to support. This avoids
unpleasant surprise when "enabled" feature does not work.
---
 kcmtouchpad.cpp |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/kcmtouchpad.cpp b/kcmtouchpad.cpp
index 096f02a..bb03321 100644
--- a/kcmtouchpad.cpp
+++ b/kcmtouchpad.cpp
@@ -153,7 +153,8 @@ void TouchpadConfig::enableProperties() {
             ui->ScrollCoastingCornerEnableCB->setEnabled(true);
         }
     }
-    if (this->propertiesList.contains(SYNAPTICS_PROP_SCROLL_TWOFINGER)) {
+    if (this->propertiesList.contains(SYNAPTICS_PROP_SCROLL_TWOFINGER) &&
+	 Touchpad::capability("_CapTwoFingers")) {
         ui->ScrollVertTFEnableCB->setEnabled(true);
         ui->ScrollHorizTFEnableCB->setEnabled(true);
     }
@@ -168,6 +169,11 @@ void TouchpadConfig::enableProperties() {
     }
     if (this->propertiesList.contains(SYNAPTICS_PROP_TAP_ACTION)) {
         ui->TappingButtonLW->setEnabled(true);
+	/* Do not offer events Touchpad does not claim to support */
+	if (!Touchpad::capability("_CapTwoFingers"))
+	    ui->TappingEventLW->item(Synaptics::TwoFingers)->setHidden(true);
+	if (!Touchpad::capability("_CapThreeFingers"))
+	    ui->TappingEventLW->item(Synaptics::ThreeFingers)->setHidden(true);
         ui->TappingEventLW->setEnabled(true);
         ui->ButtonTappingL->setEnabled(true);
         ui->ButtonMeansL->setEnabled(true);
-- 
1.6.6.2