[kde-doc-english] playground/utils/synaptiks/kcmodule

Sebastian Wiesner lunaryorn at googlemail.com
Tue Sep 14 17:21:34 CEST 2010


SVN commit 1175254 by swiesner:

GUI: Show two-finger emulation support in info page

 M  +15 -0     synaptikswidgets.cpp  
 M  +74 -5     ui/touchpadinformationpage.ui  


--- trunk/playground/utils/synaptiks/kcmodule/synaptikswidgets.cpp #1175253:1175254
@@ -105,6 +105,21 @@
         } else {
             throw fingers.error();
         }
+
+        QStringList twoFingerEmulationMethods;
+        twoFingerEmulationMethods
+            << "hasPressureDetection" << "hasFingerWidthDetection"
+            << "twoFingerEmulationSupported";
+        foreach (const QString &method, twoFingerEmulationMethods) {
+            QLabel *label = this->findChild<QLabel*>(method);
+            Q_ASSERT(label);
+            QDBusReply<bool> supported = touchpad.call(method);
+            if (supported.isValid()) {
+                label->setPixmap(supported.value()? ok: notOk);
+            } else {
+                throw supported.error();
+            }
+        }
     } catch (const QDBusError &error) {
         QLabel *errorLabel = this->findChild<QLabel*>("errorLabel");
         Q_ASSERT(errorLabel);
--- trunk/playground/utils/synaptiks/kcmodule/ui/touchpadinformationpage.ui #1175253:1175254
@@ -7,8 +7,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>395</width>
-    <height>216</height>
+    <width>430</width>
+    <height>312</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -71,8 +71,8 @@
      <property name="title">
       <string comment="@title:group touchpad information mouse button support">Buttons</string>
      </property>
-     <layout class="QVBoxLayout" name="verticalLayout_2">
-      <item>
+     <layout class="QGridLayout" name="gridLayout_2">
+      <item row="0" column="0">
        <layout class="QGridLayout" name="gridLayout">
         <item row="0" column="0">
          <widget class="QLabel" name="leftLabel">
@@ -136,7 +136,76 @@
         </item>
        </layout>
       </item>
+     </layout>
+    </widget>
+   </item>
       <item>
+    <widget class="QGroupBox" name="groupBox_2">
+     <property name="title">
+      <string>Two-finger emulation</string>
+     </property>
+     <layout class="QGridLayout" name="gridLayout_3">
+      <item row="0" column="0">
+       <widget class="QLabel" name="pressureLabel">
+        <property name="text">
+         <string>Pressure detection</string>
+        </property>
+        <property name="alignment">
+         <set>Qt::AlignCenter</set>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="1">
+       <widget class="QLabel" name="widthLabel">
+        <property name="text">
+         <string>Finger width detection</string>
+        </property>
+        <property name="alignment">
+         <set>Qt::AlignCenter</set>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="2">
+       <widget class="QLabel" name="emulationLabel">
+        <property name="text">
+         <string>Two-finger emulation</string>
+        </property>
+        <property name="alignment">
+         <set>Qt::AlignCenter</set>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="0">
+       <widget class="QLabel" name="hasPressureDetection">
+        <property name="text">
+         <string/>
+        </property>
+        <property name="alignment">
+         <set>Qt::AlignCenter</set>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="1">
+       <widget class="QLabel" name="hasFingerWidthDetection">
+        <property name="text">
+         <string/>
+        </property>
+        <property name="alignment">
+         <set>Qt::AlignCenter</set>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="2">
+       <widget class="QLabel" name="twoFingerEmulationSupported">
+        <property name="text">
+         <string/>
+        </property>
+        <property name="alignment">
+         <set>Qt::AlignCenter</set>
+        </property>
+       </widget>
+      </item>
+      <item row="2" column="1">
        <spacer name="verticalSpacer">
         <property name="orientation">
          <enum>Qt::Vertical</enum>
@@ -144,7 +213,7 @@
         <property name="sizeHint" stdset="0">
          <size>
           <width>20</width>
-          <height>46</height>
+          <height>40</height>
          </size>
         </property>
        </spacer>



More information about the kde-doc-english mailing list