File indexing completed on 2024-07-14 12:00:28

0001 /*
0002     This file is part of Choqok, the KDE micro-blogging client
0003 
0004     SPDX-FileCopyrightText: 2009-2010 Mehrdad Momeny <mehrdad.momeny@gmail.com>
0005 
0006     SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0007 */
0008 
0009 #include "nowlisteningconfig.h"
0010 
0011 #include <QPlainTextEdit>
0012 #include <QVBoxLayout>
0013 
0014 #include <KAboutData>
0015 #include <KPluginFactory>
0016 
0017 #include "nowlisteningsettings.h"
0018 
0019 K_PLUGIN_CLASS_WITH_JSON(NowListeningConfig, "choqok_nowlistening_config.json")
0020 
0021 NowListeningConfig::NowListeningConfig(QWidget *parent, const QVariantList &args)
0022     : KCModule(parent, args)
0023 {
0024     QVBoxLayout *layout = new QVBoxLayout(this);
0025     QWidget *wd = new QWidget(this);
0026     wd->setObjectName(QLatin1String("mNowListeningCtl"));
0027     ui.setupUi(wd);
0028     addConfig(NowListeningSettings::self(), wd);
0029     layout->addWidget(wd);
0030     setButtons(KCModule::Apply | KCModule::Default);
0031     connect(ui.kcfg_templateString, &QPlainTextEdit::textChanged,
0032             this, &NowListeningConfig::emitChanged);
0033 }
0034 
0035 NowListeningConfig::~NowListeningConfig()
0036 {
0037 
0038 }
0039 
0040 void NowListeningConfig::defaults()
0041 {
0042     KCModule::defaults();
0043 }
0044 
0045 void NowListeningConfig::load()
0046 {
0047     KCModule::load();
0048 }
0049 
0050 void NowListeningConfig::save()
0051 {
0052     KCModule::save();
0053 }
0054 
0055 void NowListeningConfig::emitChanged()
0056 {
0057     Q_EMIT changed(true);
0058     disconnect(ui.kcfg_templateString, &QPlainTextEdit::textChanged,
0059                this, &NowListeningConfig::emitChanged);
0060 }
0061 
0062 #include "moc_nowlisteningconfig.cpp"
0063 #include "nowlisteningconfig.moc"