Commit 47e3a516 authored by Laurent Montel's avatar Laurent Montel 😁

Port KOPrefsDialogPlugins to KCModule

parent c03015bb
......@@ -1266,7 +1266,7 @@ private:
Dialog for selecting and configuring KOrganizer plugins
*/
KOPrefsDialogPlugins::KOPrefsDialogPlugins(QWidget *parent)
: KPrefsModule(KOPrefs::instance(), parent)
: KCModule(parent)
{
QBoxLayout *topTopLayout = new QVBoxLayout(this);
mTreeWidget = new QTreeWidget(this);
......@@ -1324,7 +1324,7 @@ KOPrefsDialogPlugins::KOPrefsDialogPlugins(QWidget *parent)
connect(mTreeWidget, &QTreeWidget::itemSelectionChanged, this,
&KOPrefsDialogPlugins::selectionChanged);
connect(mTreeWidget, &QTreeWidget::itemChanged, this, &KOPrefsDialogPlugins::selectionChanged);
connect(mTreeWidget, &QTreeWidget::itemClicked, this, &KOPrefsDialogPlugins::slotWidChanged);
connect(mTreeWidget, &QTreeWidget::itemClicked, this, &KOPrefsDialogPlugins::slotConfigChanged);
load();
......@@ -1337,7 +1337,12 @@ KOPrefsDialogPlugins::~KOPrefsDialogPlugins()
delete mOthers;
}
void KOPrefsDialogPlugins::usrReadConfig()
void KOPrefsDialogPlugins::slotConfigChanged()
{
Q_EMIT markAsChanged();
}
void KOPrefsDialogPlugins::load()
{
mTreeWidget->clear();
const KService::List plugins = KOCore::self()->availablePlugins() + KOCore::self()->availableParts();
......@@ -1386,7 +1391,7 @@ void KOPrefsDialogPlugins::usrReadConfig()
#endif
}
void KOPrefsDialogPlugins::usrWriteConfig()
void KOPrefsDialogPlugins::save()
{
QStringList selectedPlugins;
......@@ -1424,7 +1429,7 @@ void KOPrefsDialogPlugins::configure()
plugin->configure(this);
delete plugin;
slotWidChanged();
slotConfigChanged();
} else {
KMessageBox::sorry(this,
i18nc("@info", "Unable to configure this plugin"),
......@@ -1469,7 +1474,7 @@ void KOPrefsDialogPlugins::positioningChanged()
mDecorationsAtAgendaViewBottom.remove(decoration);
}
slotWidChanged();
slotConfigChanged();
}
void KOPrefsDialogPlugins::selectionChanged()
......@@ -1535,7 +1540,7 @@ void KOPrefsDialogPlugins::selectionChanged()
mPositioningGroupBox->show();
}
slotWidChanged();
slotConfigChanged();
}
extern "C"
......
......@@ -125,21 +125,23 @@ private:
Ui::KOGroupwarePrefsPage *mGroupwarePage = nullptr;
};
class KCM_KORGANIZER_EXPORT KOPrefsDialogPlugins : public KPIM::KPrefsModule
class KCM_KORGANIZER_EXPORT KOPrefsDialogPlugins : public KCModule
{
Q_OBJECT
public:
explicit KOPrefsDialogPlugins(QWidget *parent);
~KOPrefsDialogPlugins() override;
void save() override;
void load() override;
protected Q_SLOTS:
void usrWriteConfig() override;
void usrReadConfig() override;
void configure();
void selectionChanged();
void positioningChanged();
private:
void slotConfigChanged();
void buildList();
QTreeWidget *mTreeWidget = nullptr;
QLabel *mDescription = nullptr;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment