Git commit c196adeddc981e49df5641b62247ef1397175608 by J?rg Ehrichs. Committed on 02/07/2014 at 17:19. Pushed by jehrichs into branch 'releng2.0'.
Supportstylus RawSample and Suppress values in the UI In order to avoid jitter effects the RawSample and Suppress values of xsetwacom driver should be changed. This patch adds these values to the styluspage. The slider changes the values for the stylus and eraser at the same time BUG: 336801 FIXED-IN: 2.0.2 GUI: Added 6 additional strings to the ui M +4 -0 src/kcmodule/profilemanagement.cpp M +17 -0 src/kcmodule/styluspagewidget.cpp M +196 -13 src/kcmodule/styluspagewidget.ui http://commits.kde.org/wacomtablet/c196adeddc981e49df5641b62247ef1397175608 diff --git a/src/kcmodule/profilemanagement.cpp b/src/kcmodule/profilemanagement.cpp index 26530d8..57e585a 100644 --- a/src/kcmodule/profilemanagement.cpp +++ b/src/kcmodule/profilemanagement.cpp @@ -101,7 +101,9 @@ void ProfileManagement::createNewProfile( const QString &profilename ) stylusDevice.setProperty(Property::Button3, QLatin1String("3")); stylusDevice.setProperty(Property::Mode, QLatin1String("absolute")); stylusDevice.setProperty(Property::PressureCurve, QLatin1String("0 0 100 100")); + stylusDevice.setProperty(Property::RawSample, QLatin1String("4")); stylusDevice.setProperty(Property::Rotate, ScreenRotation::AUTO.key()); + stylusDevice.setProperty(Property::Suppress, QLatin1String("2")); stylusDevice.setProperty(Property::Threshold, QLatin1String("27")); tabletProfile.setDevice(stylusDevice); @@ -113,8 +115,10 @@ void ProfileManagement::createNewProfile( const QString &profilename ) eraserDevice.setProperty(Property::Button3, QLatin1String("3")); eraserDevice.setProperty(Property::Mode, QLatin1String("absolute")); eraserDevice.setProperty(Property::PressureCurve, QLatin1String("0 0 100 100")); + eraserDevice.setProperty(Property::RawSample, QLatin1String("4")); eraserDevice.setProperty(Property::Rotate, ScreenRotation::AUTO.key()); eraserDevice.setProperty(Property::Threshold, QLatin1String("27")); + eraserDevice.setProperty(Property::Suppress, QLatin1String("2")); tabletProfile.setDevice(eraserDevice); diff --git a/src/kcmodule/styluspagewidget.cpp b/src/kcmodule/styluspagewidget.cpp index f0a7b43..f64f7cf 100644 --- a/src/kcmodule/styluspagewidget.cpp +++ b/src/kcmodule/styluspagewidget.cpp @@ -70,6 +70,7 @@ StylusPageWidget::~StylusPageWidget() void StylusPageWidget::loadFromProfile() { + Q_D( const StylusPageWidget ); ProfileManagement* profileManagement = &ProfileManagement::instance(); DeviceProfile stylusProfile = profileManagement->loadDeviceProfile( DeviceType::Stylus ); @@ -87,6 +88,13 @@ void StylusPageWidget::loadFromProfile() // Tap to Click setTabletPcButton ( stylusProfile.getProperty( Property::TabletPcButton ) ); + + + //Raw Sample Rate + d->ui->horizontalSliderRawSample->setValue( stylusProfile.getProperty( Property::RawSample ).toInt() ); + + //Suppress Rate + d->ui->horizontalSliderSuppress->setValue( stylusProfile.getProperty( Property::Suppress ).toInt() ); } @@ -98,6 +106,7 @@ void StylusPageWidget::reloadWidget() void StylusPageWidget::saveToProfile() { + Q_D( const StylusPageWidget ); ProfileManagement* profileManagement = &ProfileManagement::instance(); DeviceProfile stylusProfile = profileManagement->loadDeviceProfile( DeviceType::Stylus ); @@ -118,6 +127,14 @@ void StylusPageWidget::saveToProfile() // tap to click stylusProfile.setProperty( Property::TabletPcButton, getTabletPcButton() ); + //Raw Sample Rate + eraserProfile.setProperty( Property::RawSample, QString::number(d->ui->horizontalSliderRawSample->value()) ); + stylusProfile.setProperty( Property::RawSample, QString::number(d->ui->horizontalSliderRawSample->value()) ); + + //Suppress Rate + eraserProfile.setProperty( Property::Suppress, QString::number(d->ui->horizontalSliderSuppress->value()) ); + stylusProfile.setProperty( Property::Suppress, QString::number(d->ui->horizontalSliderSuppress->value()) ); + profileManagement->saveDeviceProfile(stylusProfile); profileManagement->saveDeviceProfile(eraserProfile); } diff --git a/src/kcmodule/styluspagewidget.ui b/src/kcmodule/styluspagewidget.ui index bb32aab..1191686 100644 --- a/src/kcmodule/styluspagewidget.ui +++ b/src/kcmodule/styluspagewidget.ui @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>374</width> - <height>404</height> + <width>629</width> + <height>673</height> </rect> </property> <property name="windowTitle"> @@ -22,7 +22,7 @@ <property name="spacing"> <number>10</number> </property> - <item row="1" column="1"> + <item row="1" column="2"> <widget class="QGroupBox" name="buttonGroupBox"> <property name="toolTip"> <string>Defines the button action on the stylus.</string> @@ -103,7 +103,7 @@ If deselected, stylus buttons will work once the stylus is in proximity of the t </layout> </widget> </item> - <item row="0" column="1"> + <item row="0" column="2"> <widget class="QGroupBox" name="eraserBox"> <property name="toolTip"> <string>Sets eraser pressure threshold.</string> @@ -247,7 +247,7 @@ This parameter is independent of the PressureCurve parameter.</string> </layout> </widget> </item> - <item row="2" column="1"> + <item row="2" column="2"> <widget class="QGroupBox" name="tipFeelGroupBox"> <property name="toolTip"> <string>Sets stylus pressure threshold.</string> @@ -381,10 +381,161 @@ This parameter is independent of the PressureCurve parameter.</string> </layout> </widget> </item> - <item row="0" column="0" rowspan="3"> + <item row="3" column="2"> + <widget class="QGroupBox" name="groupBoxRawSample"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="toolTip"> + <string>Number of raw data used to filter the points (default is 4)</string> + </property> + <property name="title"> + <string>Raw Sample Rate</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QSlider" name="horizontalSliderRawSample"> + <property name="toolTip"> + <string>Number of raw data used to filter the points (default is 4)</string> + </property> + <property name="minimum"> + <number>1</number> + </property> + <property name="maximum"> + <number>20</number> + </property> + <property name="pageStep"> + <number>10</number> + </property> + <property name="value"> + <number>4</number> + </property> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="tickPosition"> + <enum>QSlider::TicksBelow</enum> + </property> + <property name="tickInterval"> + <number>1</number> + </property> + </widget> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QLabel" name="labelMinRawSample"> + <property name="text"> + <string>1</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLabel" name="labelMaxRawSample"> + <property name="text"> + <string>20</string> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + </item> + <item row="4" column="2"> + <widget class="QGroupBox" name="groupBoxSupress"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="toolTip"> + <string>Number of points trimmed (default is 2)</string> + </property> + <property name="title"> + <string>Suppress Rate</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_3"> + <item> + <widget class="QSlider" name="horizontalSliderSuppress"> + <property name="minimum"> + <number>0</number> + </property> + <property name="maximum"> + <number>20</number> + </property> + <property name="pageStep"> + <number>7</number> + </property> + <property name="value"> + <number>2</number> + </property> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="tickPosition"> + <enum>QSlider::TicksBelow</enum> + </property> + <property name="tickInterval"> + <number>1</number> + </property> + </widget> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_3"> + <item> + <widget class="QLabel" name="labelMinSuppress"> + <property name="text"> + <string>0</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_2"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLabel" name="labelMaxSuppress"> + <property name="text"> + <string>20</string> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + </item> + <item row="0" column="0" rowspan="5"> <layout class="QVBoxLayout" name="penLayout"> <property name="spacing"> - <number>-1</number> + <number>7</number> </property> <item> <spacer name="penTopSpacer"> @@ -511,8 +662,8 @@ This parameter is independent of the PressureCurve parameter.</string> <slot>onChangeEraserPressureCurve()</slot> <hints> <hint type="sourcelabel"> - <x>320</x> - <y>111</y> + <x>603</x> + <y>130</y> </hint> <hint type="destinationlabel"> <x>311</x> @@ -527,8 +678,8 @@ This parameter is independent of the PressureCurve parameter.</string> <slot>onProfileChanged()</slot> <hints> <hint type="sourcelabel"> - <x>690</x> - <y>269</y> + <x>603</x> + <y>284</y> </hint> <hint type="destinationlabel"> <x>747</x> @@ -543,8 +694,8 @@ This parameter is independent of the PressureCurve parameter.</string> <slot>onChangeTipPressureCurve()</slot> <hints> <hint type="sourcelabel"> - <x>323</x> - <y>405</y> + <x>603</x> + <y>428</y> </hint> <hint type="destinationlabel"> <x>321</x> @@ -552,6 +703,38 @@ This parameter is independent of the PressureCurve parameter.</string> </hint> </hints> </connection> + <connection> + <sender>horizontalSliderRawSample</sender> + <signal>valueChanged(int)</signal> + <receiver>StylusPageWidget</receiver> + <slot>onProfileChanged()</slot> + <hints> + <hint type="sourcelabel"> + <x>320</x> + <y>497</y> + </hint> + <hint type="destinationlabel"> + <x>648</x> + <y>497</y> + </hint> + </hints> + </connection> + <connection> + <sender>horizontalSliderSuppress</sender> + <signal>valueChanged(int)</signal> + <receiver>StylusPageWidget</receiver> + <slot>onProfileChanged()</slot> + <hints> + <hint type="sourcelabel"> + <x>499</x> + <y>598</y> + </hint> + <hint type="destinationlabel"> + <x>663</x> + <y>601</y> + </hint> + </hints> + </connection> </connections> <slots> <slot>onProfileChanged()</slot>
