Changeset View
Changeset View
Standalone View
Standalone View
core/ModuleView.cpp
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Line(s) | 52 | public: | |||
---|---|---|---|---|---|
56 | KPageWidget* mPageWidget = nullptr; | 56 | KPageWidget* mPageWidget = nullptr; | ||
57 | QVBoxLayout* mLayout = nullptr; | 57 | QVBoxLayout* mLayout = nullptr; | ||
58 | QDialogButtonBox* mButtons = nullptr; | 58 | QDialogButtonBox* mButtons = nullptr; | ||
59 | KAuth::ObjectDecorator* mApplyAuthorize = nullptr; | 59 | KAuth::ObjectDecorator* mApplyAuthorize = nullptr; | ||
60 | QPushButton* mApply = nullptr; | 60 | QPushButton* mApply = nullptr; | ||
61 | QPushButton* mReset = nullptr; | 61 | QPushButton* mReset = nullptr; | ||
62 | QPushButton* mDefault = nullptr; | 62 | QPushButton* mDefault = nullptr; | ||
63 | QPushButton* mHelp = nullptr; | 63 | QPushButton* mHelp = nullptr; | ||
64 | bool pageChangeSupressed; | 64 | bool pageChangeSupressed = false; | ||
65 | bool mSaveStatistics = true; | ||||
65 | }; | 66 | }; | ||
66 | 67 | | |||
67 | ModuleView::ModuleView( QWidget * parent ) | 68 | ModuleView::ModuleView( QWidget * parent ) | ||
68 | : QWidget( parent ) | 69 | : QWidget( parent ) | ||
69 | , d( new Private() ) | 70 | , d( new Private() ) | ||
70 | { | 71 | { | ||
71 | // Configure a layout first | 72 | // Configure a layout first | ||
72 | d->mLayout = new QVBoxLayout(this); | 73 | d->mLayout = new QVBoxLayout(this); | ||
▲ Show 20 Lines • Show All 267 Lines • ▼ Show 20 Line(s) | 333 | { | |||
340 | if( d->pageChangeSupressed ) { | 341 | if( d->pageChangeSupressed ) { | ||
341 | return; | 342 | return; | ||
342 | } | 343 | } | ||
343 | // We need to get the state of the now active module | 344 | // We need to get the state of the now active module | ||
344 | stateChanged(); | 345 | stateChanged(); | ||
345 | 346 | | |||
346 | KCModuleProxy * activeModule = d->mPages.value( d->mPageWidget->currentPage() ); | 347 | KCModuleProxy * activeModule = d->mPages.value( d->mPageWidget->currentPage() ); | ||
347 | if (activeModule) { | 348 | if (activeModule) { | ||
349 | if (d->mSaveStatistics) { | ||||
meven: We might want to have a different url scheme like "kinfo" insteat of "kcm" and "org.kde. | |||||
that's a good point. mart: that's a good point.
Tough, at the moment we don't do anything with the statistics in… | |||||
We can ignore this for now, for sure, since we don't have a use case indeed. meven: We can ignore this for now, for sure, since we don't have a use case indeed.
KFeedback may like… | |||||
348 | KActivities::ResourceInstance::notifyAccessed(QUrl(QStringLiteral("kcm:") + activeModule->moduleInfo().service()->storageId()), | 350 | KActivities::ResourceInstance::notifyAccessed(QUrl(QStringLiteral("kcm:") + activeModule->moduleInfo().service()->storageId()), | ||
349 | QStringLiteral("org.kde.systemsettings")); | 351 | QStringLiteral("org.kde.systemsettings")); | ||
352 | } | ||||
350 | if (activeModule->realModule() && activeModule->realModule()->inherits("KCModuleQml")) { | 353 | if (activeModule->realModule() && activeModule->realModule()->inherits("KCModuleQml")) { | ||
351 | d->mButtons->setContentsMargins( | 354 | d->mButtons->setContentsMargins( | ||
352 | style()->pixelMetric(QStyle::PM_LayoutLeftMargin), | 355 | style()->pixelMetric(QStyle::PM_LayoutLeftMargin), | ||
353 | style()->pixelMetric(QStyle::PM_LayoutTopMargin), | 356 | style()->pixelMetric(QStyle::PM_LayoutTopMargin), | ||
354 | style()->pixelMetric(QStyle::PM_LayoutRightMargin), | 357 | style()->pixelMetric(QStyle::PM_LayoutRightMargin), | ||
355 | style()->pixelMetric(QStyle::PM_LayoutBottomMargin)); | 358 | style()->pixelMetric(QStyle::PM_LayoutBottomMargin)); | ||
356 | d->mLayout->setContentsMargins(0, 0, 0, 0); | 359 | d->mLayout->setContentsMargins(0, 0, 0, 0); | ||
357 | } else { | 360 | } else { | ||
▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Line(s) | 422 | { | |||
420 | d->mPageWidget->setFaceType(type); | 423 | d->mPageWidget->setFaceType(type); | ||
421 | } | 424 | } | ||
422 | 425 | | |||
423 | KPageView::FaceType ModuleView::faceType() const | 426 | KPageView::FaceType ModuleView::faceType() const | ||
424 | { | 427 | { | ||
425 | return d->mPageWidget->faceType(); | 428 | return d->mPageWidget->faceType(); | ||
426 | } | 429 | } | ||
427 | 430 | | |||
431 | void ModuleView::setSaveStatistics(bool save) | ||||
432 | { | ||||
433 | d->mSaveStatistics = save; | ||||
434 | } | ||||
435 | | ||||
436 | bool ModuleView::saveStatistics() const | ||||
437 | { | ||||
438 | return d->mSaveStatistics; | ||||
439 | } | ||||
440 | | ||||
441 | void ModuleView::setApplyVisible(bool visible) | ||||
442 | { | ||||
443 | d->mApply->setVisible(visible); | ||||
444 | } | ||||
445 | | ||||
446 | bool ModuleView::isApplyVisible() const | ||||
447 | { | ||||
448 | return d->mApply->isVisible(); | ||||
449 | } | ||||
450 | | ||||
451 | void ModuleView::setDefaultsVisible(bool visible) | ||||
452 | { | ||||
453 | d->mDefault->setVisible(visible); | ||||
454 | } | ||||
455 | | ||||
456 | bool ModuleView::isDefaultsVisible() const | ||||
457 | { | ||||
458 | return d->mDefault->isVisible(); | ||||
459 | } | ||||
460 | | ||||
461 | void ModuleView::setResetVisible(bool visible) | ||||
462 | { | ||||
463 | d->mReset->setVisible(visible); | ||||
464 | } | ||||
465 | | ||||
466 | bool ModuleView::isResetVisible() const | ||||
467 | { | ||||
468 | return d->mReset->isVisible(); | ||||
469 | } | ||||
470 | |
We might want to have a different url scheme like "kinfo" insteat of "kcm" and "org.kde.kinfocenter" instead of "org.kde.systemsettings"