Changeset View
Changeset View
Standalone View
Standalone View
kcms/touchpad/src/kcm/xlib/touchpadconfigxlib.cpp
- This file was moved from kcms/touchpad/src/kcm/touchpadconfig.cpp.
Show All 10 Lines | |||||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | 12 | * GNU General Public License for more details. | ||
13 | * | 13 | * | ||
14 | * You should have received a copy of the GNU General Public License | 14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | 15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
17 | */ | 17 | */ | ||
18 | 18 | | |||
19 | #include "touchpadconfig.h" | 19 | #include "touchpadconfigxlib.h" | ||
20 | 20 | | |||
21 | #include <QScrollArea> | 21 | #include <QScrollArea> | ||
22 | #include <QDBusInterface> | 22 | #include <QDBusInterface> | ||
23 | #include <QTabWidget> | 23 | #include <QTabWidget> | ||
24 | 24 | | |||
25 | #include <KAboutData> | 25 | #include <KAboutData> | ||
26 | #include <QAction> | 26 | #include <QAction> | ||
27 | #include <KLocalizedString> | 27 | #include <KLocalizedString> | ||
28 | #include <KMessageWidget> | 28 | #include <KMessageWidget> | ||
29 | #include <KNotifyConfigWidget> | 29 | #include <KNotifyConfigWidget> | ||
30 | #include <KShortcutsDialog> | 30 | #include <KShortcutsDialog> | ||
31 | #include <KConfigGroup> | 31 | #include <KConfigGroup> | ||
32 | 32 | | |||
33 | #include "../touchpadconfigcontainer.h" | ||||
33 | #include "customslider.h" | 34 | #include "customslider.h" | ||
34 | #include "sliderpair.h" | 35 | #include "sliderpair.h" | ||
35 | #include "touchpadbackend.h" | 36 | #include "touchpadbackend.h" | ||
36 | #include "plugins.h" | 37 | #include "plugins.h" | ||
37 | #include "testarea.h" | 38 | #include "testarea.h" | ||
38 | #include "touchpadinterface.h" | 39 | #include "touchpadinterface.h" | ||
39 | #include "customconfigdialogmanager.h" | 40 | #include "customconfigdialogmanager.h" | ||
40 | #include "kded/kdedactions.h" | 41 | #include "kded/kdedactions.h" | ||
41 | 42 | | |||
42 | #include "version.h" | 43 | #include "version.h" | ||
43 | 44 | | |||
44 | void touchpadApplySavedConfig() | 45 | void touchpadApplySavedConfig() | ||
45 | { | 46 | { | ||
46 | TouchpadBackend *backend = TouchpadBackend::implementation(); | 47 | TouchpadBackend *backend = TouchpadBackend::implementation(); | ||
47 | if (!backend) { | 48 | if (!backend) { | ||
48 | return; | 49 | return; | ||
49 | } | 50 | } | ||
50 | 51 | | |||
51 | TouchpadParameters config; | 52 | TouchpadParameters config; | ||
52 | backend->applyConfig(config.values()); | 53 | backend->applyConfig(config.values()); | ||
53 | } | 54 | } | ||
54 | 55 | | |||
55 | extern "C" | 56 | void TouchpadConfigXlib::kcmInit() | ||
56 | { | | |||
57 | Q_DECL_EXPORT void kcminit_touchpad() | | |||
58 | { | 57 | { | ||
59 | TouchpadParameters::setSystemDefaults(); | 58 | TouchpadParameters::setSystemDefaults(); | ||
60 | touchpadApplySavedConfig(); | 59 | touchpadApplySavedConfig(); | ||
61 | } | 60 | } | ||
62 | } | | |||
63 | 61 | | |||
64 | static void copyHelpFromBuddy(QObject *root) | 62 | static void copyHelpFromBuddy(QObject *root) | ||
65 | { | 63 | { | ||
66 | QLabel *asLabel = qobject_cast<QLabel*>(root); | 64 | QLabel *asLabel = qobject_cast<QLabel*>(root); | ||
67 | if (asLabel && asLabel->buddy()) { | 65 | if (asLabel && asLabel->buddy()) { | ||
68 | if (asLabel->toolTip().isEmpty()) { | 66 | if (asLabel->toolTip().isEmpty()) { | ||
69 | asLabel->setToolTip(asLabel->buddy()->toolTip()); | 67 | asLabel->setToolTip(asLabel->buddy()->toolTip()); | ||
70 | } | 68 | } | ||
Show All 24 Lines | 83 | { | |||
95 | widget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); | 93 | widget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); | ||
96 | 94 | | |||
97 | container->setWidget(widget); | 95 | container->setWidget(widget); | ||
98 | tabs->addTab(container, widget->windowTitle()); | 96 | tabs->addTab(container, widget->windowTitle()); | ||
99 | 97 | | |||
100 | return widget; | 98 | return widget; | ||
101 | } | 99 | } | ||
102 | 100 | | |||
103 | TouchpadConfig::TouchpadConfig(QWidget *parent, const QVariantList &args) | 101 | TouchpadConfigXlib::TouchpadConfigXlib(TouchpadConfigContainer *parent, const QVariantList &args) | ||
104 | : KCModule(parent, args), | 102 | : TouchpadConfigPlugin(parent), | ||
105 | m_configOutOfSync(false) | 103 | m_configOutOfSync(false) | ||
106 | { | 104 | { | ||
107 | KAboutData* data = new KAboutData(QStringLiteral("kcm_touchpad"), | 105 | KAboutData* data = new KAboutData(QStringLiteral("kcm_touchpad"), | ||
108 | i18n("Touchpad KCM"), | 106 | i18n("Touchpad KCM"), | ||
109 | TOUCHPAD_KCM_VERSION, | 107 | TOUCHPAD_KCM_VERSION, | ||
110 | i18n("System Settings module, daemon and Plasma applet for managing your touchpad"), | 108 | i18n("System Settings module, daemon and Plasma applet for managing your touchpad"), | ||
111 | KAboutLicense::GPL_V2, | 109 | KAboutLicense::GPL_V2, | ||
112 | i18n("Copyright © 2013 Alexander Mezin"), | 110 | i18n("Copyright © 2013 Alexander Mezin"), | ||
113 | i18n("This program incorporates work covered by this copyright notice:\n" | 111 | i18n("This program incorporates work covered by this copyright notice:\n" | ||
114 | "Copyright © 2002-2005,2007 Peter Osterlund"), | 112 | "Copyright © 2002-2005,2007 Peter Osterlund"), | ||
115 | QStringLiteral("https://projects.kde.org/projects/playground/utils/kcm-touchpad/"), | 113 | QStringLiteral("https://projects.kde.org/projects/playground/utils/kcm-touchpad/"), | ||
116 | QString()); | 114 | QString()); | ||
117 | 115 | | |||
118 | data->addAuthor(i18n("Alexander Mezin"), | 116 | data->addAuthor(i18n("Alexander Mezin"), | ||
119 | i18n("Developer"), | 117 | i18n("Developer"), | ||
120 | QStringLiteral("mezin.alexander@gmail.com")); | 118 | QStringLiteral("mezin.alexander@gmail.com")); | ||
121 | data->addCredit(i18n("Thomas Pfeiffer"), i18nc("Credits", "Usability, testing")); | 119 | data->addCredit(i18n("Thomas Pfeiffer"), i18nc("Credits", "Usability, testing")); | ||
122 | data->addCredit(i18n("Alex Fiestas"), i18nc("Credits", "Helped a bit")); | 120 | data->addCredit(i18n("Alex Fiestas"), i18nc("Credits", "Helped a bit")); | ||
123 | data->addCredit(i18n("Peter Osterlund"), i18nc("Credits", "Developer of synclient")); | 121 | data->addCredit(i18n("Peter Osterlund"), i18nc("Credits", "Developer of synclient")); | ||
124 | data->addCredit(i18n("Vadim Zaytsev"), i18nc("Credits", "Testing")); | 122 | data->addCredit(i18n("Vadim Zaytsev"), i18nc("Credits", "Testing")); | ||
125 | data->addCredit(i18n("Violetta Raspryagayeva"), i18nc("Credits", "Testing")); | 123 | data->addCredit(i18n("Violetta Raspryagayeva"), i18nc("Credits", "Testing")); | ||
126 | 124 | | |||
127 | 125 | m_parent->setAboutData(data); | |||
128 | setAboutData(data); | | |||
129 | 126 | | |||
130 | QGridLayout *layout = new QGridLayout(this); | 127 | QGridLayout *layout = new QGridLayout(this); | ||
131 | QVBoxLayout *messageLayout = new QVBoxLayout(); | 128 | QVBoxLayout *messageLayout = new QVBoxLayout(); | ||
132 | layout->addLayout(messageLayout, 0, 0, 1, 2); | 129 | layout->addLayout(messageLayout, 0, 0, 1, 2); | ||
133 | 130 | | |||
134 | // Messages | 131 | // Messages | ||
135 | 132 | | |||
136 | m_errorMessage = new KMessageWidget(this); | 133 | m_errorMessage = new KMessageWidget(this); | ||
▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Line(s) | |||||
184 | m_manager = new CustomConfigDialogManager(this, &m_config, | 181 | m_manager = new CustomConfigDialogManager(this, &m_config, | ||
185 | m_backend->supportedParameters()); | 182 | m_backend->supportedParameters()); | ||
186 | connect(m_manager, SIGNAL(widgetModified()), SLOT(checkChanges()), | 183 | connect(m_manager, SIGNAL(widgetModified()), SLOT(checkChanges()), | ||
187 | Qt::QueuedConnection); | 184 | Qt::QueuedConnection); | ||
188 | 185 | | |||
189 | // KDED settings | 186 | // KDED settings | ||
190 | 187 | | |||
191 | m_kdedTab = addTab(m_tabs, m_kded); | 188 | m_kdedTab = addTab(m_tabs, m_kded); | ||
192 | m_daemonConfigManager = addConfig(&m_daemonSettings, m_kdedTab); | 189 | m_daemonConfigManager = m_parent->addConfig(&m_daemonSettings, m_kdedTab); | ||
193 | 190 | | |||
194 | KMessageWidget *kdedMessage = new KMessageWidget(m_kdedTab); | 191 | KMessageWidget *kdedMessage = new KMessageWidget(m_kdedTab); | ||
195 | kdedMessage->setMessageType(KMessageWidget::Information); | 192 | kdedMessage->setMessageType(KMessageWidget::Information); | ||
196 | kdedMessage->setCloseButtonVisible(false); | 193 | kdedMessage->setCloseButtonVisible(false); | ||
197 | kdedMessage->setText( | 194 | kdedMessage->setText( | ||
198 | i18n("These settings won't take effect in the testing area")); | 195 | i18n("These settings won't take effect in the testing area")); | ||
199 | qobject_cast<QVBoxLayout *>(m_kdedTab->layout())-> | 196 | qobject_cast<QVBoxLayout *>(m_kdedTab->layout())-> | ||
200 | insertWidget(0, kdedMessage); | 197 | insertWidget(0, kdedMessage); | ||
Show All 22 Lines | 219 | connect(watch, SIGNAL(finished(QDBusPendingCallWatcher*)), | |||
223 | SLOT(gotReplyFromDaemon(QDBusPendingCallWatcher*))); | 220 | SLOT(gotReplyFromDaemon(QDBusPendingCallWatcher*))); | ||
224 | 221 | | |||
225 | // Testing area | 222 | // Testing area | ||
226 | 223 | | |||
227 | m_testArea = new TestArea(this); | 224 | m_testArea = new TestArea(this); | ||
228 | layout->addWidget(m_testArea, 1, 1); | 225 | layout->addWidget(m_testArea, 1, 1); | ||
229 | connect(m_testArea, SIGNAL(enter()), SLOT(beginTesting())); | 226 | connect(m_testArea, SIGNAL(enter()), SLOT(beginTesting())); | ||
230 | connect(m_testArea, SIGNAL(leave()), SLOT(endTesting())); | 227 | connect(m_testArea, SIGNAL(leave()), SLOT(endTesting())); | ||
231 | connect(this, SIGNAL(changed(bool)), SLOT(onChanged())); | | |||
232 | connect(m_tabs, SIGNAL(currentChanged(int)), SLOT(updateTestAreaEnabled())); | 228 | connect(m_tabs, SIGNAL(currentChanged(int)), SLOT(updateTestAreaEnabled())); | ||
233 | updateTestAreaEnabled(); | 229 | updateTestAreaEnabled(); | ||
234 | } | 230 | } | ||
235 | 231 | | |||
236 | void TouchpadConfig::gotReplyFromDaemon(QDBusPendingCallWatcher *watch) | 232 | void TouchpadConfigXlib::gotReplyFromDaemon(QDBusPendingCallWatcher *watch) | ||
237 | { | 233 | { | ||
238 | QDBusPendingReply<bool> reply = *watch; | 234 | QDBusPendingReply<bool> reply = *watch; | ||
239 | if (reply.isValid() && reply.value()) { | 235 | if (reply.isValid() && reply.value()) { | ||
240 | m_kdedTab->setEnabled(true); | 236 | m_kdedTab->setEnabled(true); | ||
241 | } | 237 | } | ||
242 | watch->deleteLater(); | 238 | watch->deleteLater(); | ||
243 | } | 239 | } | ||
244 | 240 | | |||
245 | void TouchpadConfig::updateMouseList() | 241 | void TouchpadConfigXlib::updateMouseList() | ||
246 | { | 242 | { | ||
247 | QStringList mouses( | 243 | QStringList mouses( | ||
248 | m_backend->listMouses(m_daemonSettings.mouseBlacklist())); | 244 | m_backend->listMouses(m_daemonSettings.mouseBlacklist())); | ||
249 | 245 | | |||
250 | for (int i = 0; i < m_mouseCombo->count(); ) { | 246 | for (int i = 0; i < m_mouseCombo->count(); ) { | ||
251 | if (!mouses.contains(m_mouseCombo->itemText(i))) { | 247 | if (!mouses.contains(m_mouseCombo->itemText(i))) { | ||
252 | m_mouseCombo->removeItem(i); | 248 | m_mouseCombo->removeItem(i); | ||
253 | } else { | 249 | } else { | ||
254 | i++; | 250 | i++; | ||
255 | } | 251 | } | ||
256 | } | 252 | } | ||
257 | 253 | | |||
258 | Q_FOREACH (const QString &i, mouses) { | 254 | Q_FOREACH (const QString &i, mouses) { | ||
259 | if (!m_mouseCombo->contains(i)) { | 255 | if (!m_mouseCombo->contains(i)) { | ||
260 | m_mouseCombo->addItem(i); | 256 | m_mouseCombo->addItem(i); | ||
261 | } | 257 | } | ||
262 | } | 258 | } | ||
263 | } | 259 | } | ||
264 | 260 | | |||
265 | QVariantHash TouchpadConfig::getActiveConfig() | 261 | QVariantHash TouchpadConfigXlib::getActiveConfig() | ||
266 | { | 262 | { | ||
267 | if (m_prevConfig) { | 263 | if (m_prevConfig) { | ||
268 | return *m_prevConfig; | 264 | return *m_prevConfig; | ||
269 | } | 265 | } | ||
270 | 266 | | |||
271 | QVariantHash activeConfig; | 267 | QVariantHash activeConfig; | ||
272 | if (!m_backend->getConfig(activeConfig)) { | 268 | if (!m_backend->getConfig(activeConfig)) { | ||
273 | m_errorMessage->setText(m_backend->errorString()); | 269 | m_errorMessage->setText(m_backend->errorString()); | ||
274 | QMetaObject::invokeMethod(m_errorMessage, "animatedShow", | 270 | QMetaObject::invokeMethod(m_errorMessage, "animatedShow", | ||
275 | Qt::QueuedConnection); | 271 | Qt::QueuedConnection); | ||
276 | } | 272 | } | ||
277 | return activeConfig; | 273 | return activeConfig; | ||
278 | } | 274 | } | ||
279 | 275 | | |||
280 | void TouchpadConfig::loadActiveConfig() | 276 | void TouchpadConfigXlib::loadActiveConfig() | ||
281 | { | 277 | { | ||
282 | m_manager->setWidgetProperties(getActiveConfig()); | 278 | m_manager->setWidgetProperties(getActiveConfig()); | ||
283 | m_configOutOfSync = false; | 279 | m_configOutOfSync = false; | ||
284 | m_configOutOfSyncMessage->animatedHide(); | 280 | m_configOutOfSyncMessage->animatedHide(); | ||
285 | } | 281 | } | ||
286 | 282 | | |||
287 | void TouchpadConfig::load() | 283 | void TouchpadConfigXlib::load() | ||
288 | { | 284 | { | ||
289 | m_manager->updateWidgets(); | 285 | m_manager->updateWidgets(); | ||
290 | 286 | | |||
291 | KCModule::load(); | 287 | m_parent->kcmLoad(); | ||
292 | 288 | | |||
293 | m_configOutOfSync = !m_manager->compareWidgetProperties(getActiveConfig()); | 289 | m_configOutOfSync = !m_manager->compareWidgetProperties(getActiveConfig()); | ||
294 | } | 290 | } | ||
295 | 291 | | |||
296 | void TouchpadConfig::save() | 292 | void TouchpadConfigXlib::save() | ||
297 | { | 293 | { | ||
298 | m_manager->updateSettings(); | 294 | m_manager->updateSettings(); | ||
299 | 295 | | |||
300 | m_configOutOfSync = false; | 296 | m_configOutOfSync = false; | ||
301 | m_configOutOfSyncMessage->animatedHide(); | 297 | m_configOutOfSyncMessage->animatedHide(); | ||
302 | 298 | | |||
303 | bool daemonSettingsChanged = m_daemonConfigManager->hasChanged(); | 299 | bool daemonSettingsChanged = m_daemonConfigManager->hasChanged(); | ||
304 | 300 | | |||
305 | KCModule::save(); | 301 | m_parent->kcmSave(); | ||
306 | 302 | | |||
307 | if (m_backend->applyConfig(m_config.values())) { | 303 | if (m_backend->applyConfig(m_config.values())) { | ||
308 | m_errorMessage->animatedHide(); | 304 | m_errorMessage->animatedHide(); | ||
309 | } else { | 305 | } else { | ||
310 | m_errorMessage->setText(m_backend->errorString()); | 306 | m_errorMessage->setText(m_backend->errorString()); | ||
311 | m_errorMessage->animatedShow(); | 307 | m_errorMessage->animatedShow(); | ||
312 | } | 308 | } | ||
313 | 309 | | |||
314 | if (daemonSettingsChanged) { | 310 | if (daemonSettingsChanged) { | ||
315 | m_daemon->reloadSettings(); | 311 | m_daemon->reloadSettings(); | ||
316 | updateMouseList(); | 312 | updateMouseList(); | ||
317 | } | 313 | } | ||
318 | } | 314 | } | ||
319 | 315 | | |||
320 | void TouchpadConfig::defaults() | 316 | void TouchpadConfigXlib::defaults() | ||
321 | { | 317 | { | ||
322 | m_manager->updateWidgetsDefault(); | 318 | m_manager->updateWidgetsDefault(); | ||
323 | 319 | | |||
324 | KCModule::defaults(); | 320 | m_parent->kcmDefaults(); | ||
325 | } | 321 | } | ||
326 | 322 | | |||
327 | void TouchpadConfig::checkChanges() | 323 | void TouchpadConfigXlib::checkChanges() | ||
328 | { | 324 | { | ||
329 | if (!m_backend->hasTouchpad()) { | 325 | if (!m_backend->touchpadCount()) { | ||
330 | return; | 326 | return; | ||
331 | } | 327 | } | ||
332 | unmanagedWidgetChangeState(m_manager->hasChangedFuzzy() | 328 | m_parent->unmanagedWidgetChangeState(m_manager->hasChangedFuzzy() | ||
333 | || m_configOutOfSync); | 329 | || m_configOutOfSync); | ||
334 | if (m_configOutOfSync) { | 330 | if (m_configOutOfSync) { | ||
335 | m_configOutOfSyncMessage->animatedShow(); | 331 | m_configOutOfSyncMessage->animatedShow(); | ||
336 | } else { | 332 | } else { | ||
337 | m_configOutOfSyncMessage->animatedHide(); | 333 | m_configOutOfSyncMessage->animatedHide(); | ||
338 | } | 334 | } | ||
339 | } | 335 | } | ||
340 | 336 | | |||
341 | void TouchpadConfig::hideEvent(QHideEvent *e) | 337 | void TouchpadConfigXlib::hideEvent(QHideEvent *e) | ||
342 | { | 338 | { | ||
339 | Q_UNUSED( e ); | ||||
343 | endTesting(); | 340 | endTesting(); | ||
344 | KCModule::hideEvent(e); | | |||
345 | } | 341 | } | ||
346 | 342 | | |||
347 | TouchpadConfig::~TouchpadConfig() | 343 | TouchpadConfigXlib::~TouchpadConfigXlib() | ||
348 | { | 344 | { | ||
349 | endTesting(); | 345 | endTesting(); | ||
350 | } | 346 | } | ||
351 | 347 | | |||
352 | void TouchpadConfig::onChanged() | 348 | void TouchpadConfigXlib::onChanged() | ||
353 | { | 349 | { | ||
354 | if (m_testArea->underMouse()) { | 350 | if (m_testArea->underMouse()) { | ||
355 | beginTesting(); | 351 | beginTesting(); | ||
356 | } | 352 | } | ||
357 | } | 353 | } | ||
358 | 354 | | |||
359 | void TouchpadConfig::beginTesting() | 355 | void TouchpadConfigXlib::beginTesting() | ||
360 | { | 356 | { | ||
361 | if (!m_prevConfig) { | 357 | if (!m_prevConfig) { | ||
362 | m_prevConfig.reset(new QVariantHash()); | 358 | m_prevConfig.reset(new QVariantHash()); | ||
363 | m_backend->getConfig(*m_prevConfig.data()); | 359 | m_backend->getConfig(*m_prevConfig.data()); | ||
364 | } | 360 | } | ||
365 | m_backend->applyConfig(m_manager->currentWidgetProperties()); | 361 | m_backend->applyConfig(m_manager->currentWidgetProperties()); | ||
366 | } | 362 | } | ||
367 | 363 | | |||
368 | void TouchpadConfig::endTesting() | 364 | void TouchpadConfigXlib::endTesting() | ||
369 | { | 365 | { | ||
370 | if (!m_prevConfig) { | 366 | if (!m_prevConfig) { | ||
371 | return; | 367 | return; | ||
372 | } | 368 | } | ||
373 | m_backend->applyConfig(*m_prevConfig.data()); | 369 | m_backend->applyConfig(*m_prevConfig.data()); | ||
374 | m_prevConfig.reset(); | 370 | m_prevConfig.reset(); | ||
375 | } | 371 | } | ||
376 | 372 | | |||
377 | void TouchpadConfig::updateTestAreaEnabled() | 373 | void TouchpadConfigXlib::updateTestAreaEnabled() | ||
378 | { | 374 | { | ||
379 | bool enable = true; | 375 | bool enable = true; | ||
380 | for (QWidget *i = m_kdedTab; i; i = i->parentWidget()) { | 376 | for (QWidget *i = m_kdedTab; i; i = i->parentWidget()) { | ||
381 | if (i == m_tabs->currentWidget()) { | 377 | if (i == m_tabs->currentWidget()) { | ||
382 | enable = false; | 378 | enable = false; | ||
383 | break; | 379 | break; | ||
384 | } | 380 | } | ||
385 | } | 381 | } | ||
386 | 382 | | |||
387 | m_testArea->setEnabled(enable); | 383 | m_testArea->setEnabled(enable); | ||
388 | m_testArea->setMouseTracking(enable); | 384 | m_testArea->setMouseTracking(enable); | ||
389 | if (!enable) { | 385 | if (!enable) { | ||
390 | endTesting(); | 386 | endTesting(); | ||
391 | } | 387 | } | ||
392 | } | 388 | } | ||
393 | 389 | | |||
394 | void TouchpadConfig::showConfigureNotificationsDialog() | 390 | void TouchpadConfigXlib::showConfigureNotificationsDialog() | ||
395 | { | 391 | { | ||
396 | KNotifyConfigWidget *widget = | 392 | KNotifyConfigWidget *widget = | ||
397 | KNotifyConfigWidget::configure(0, componentData().componentName()); | 393 | KNotifyConfigWidget::configure(0, m_parent->componentData().componentName()); | ||
398 | QDialog *dialog = qobject_cast<QDialog*>(widget->topLevelWidget()); | 394 | QDialog *dialog = qobject_cast<QDialog*>(widget->topLevelWidget()); | ||
399 | connect(dialog, SIGNAL(finished()), dialog, SLOT(deleteLater())); | 395 | connect(dialog, SIGNAL(finished()), dialog, SLOT(deleteLater())); | ||
400 | } | 396 | } |