Commit 2bda77a87196d5a9247e2df606c1d0a58904d77a

  • avatar
  • swiesner <swiesner @283d02a7-25f6-0310…ecb5cbfe19da.>
  • Sun Jun 13 13:03:14 CEST 2010
Avoid repeated error messages if the touchpad is not available

git-svn-id: svn+ssh://svn.kde.org/home/kde/trunk/playground/utils/synaptiks@1137525 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
  
118118 QDBusConnection::ExportScriptableContents);
119119
120120 if (!touchpad) {
121 if (!Touchpad::isSupported()) {
122 this->notifyError(
123 i18nc("@info daemon error notification",
124 "<warning>The system does not support touchpad "
125 "configuration.</warning>"));
126 } else {
127 this->notifyError(
128 i18nc("@info daemon error notification",
129 "<warning>No configurable touchpad was "
130 "found.</warning>"));
121 // we did not yet know, that touchpad configuration is not supported
122 // on this system, so show an error message to the user
123 if (!d->config->touchpadNotSupported()) {
124 if (!Touchpad::isSupported()) {
125 this->notifyError(
126 i18nc("@info daemon error notification",
127 "<warning>The system does not support touchpad "
128 "configuration.</warning>"));
129 } else {
130 this->notifyError(
131 i18nc("@info daemon error notification",
132 "<warning>No configurable touchpad was "
133 "found.</warning>"));
134 }
135 // remember, that touchpad configuration is not supported to
136 // avoid needless repetitions of the above error messages
137 d->config->setTouchpadNotSupported(true);
138 d->config->writeConfig();
131139 }
132140 } else {
141 // a touchpad is available, so enable the error messages again
142 d->config->setTouchpadNotSupported(false);
143 d->config->writeConfig();
133144 // create the touchpad manager
134145 d->touchpadManager = new TouchpadManager(touchpad, monitor, this);
135146 this->connect(d->touchpadManager,
151151 this->connect(d->touchpadManager,
152152 SIGNAL(touchpadError(const QString&)),
153153 SLOT(notifyError(const QString&)));
154
155154
156155 // dump settings from touchpad driver to configuration and write the
157156 // settings to a file to make them available to the kcmodule
  
3737 </entry>
3838 </group>
3939 <group name="General">
40 <entry name="TouchpadNotSupported" type="Bool">
41 <label>Used by the deamon to avoid repeated error messages on systems
42with no configurable touchpad.</label>
43 <default>false</default>
44 </entry>
4045 <entry name="TouchpadStateAtStartup" type="Enum">
4146 <label>The initial state of the touchpad at daemon startup. Change
4247this to forcibly enable or disable the touchpad.</label>