7#include "gravatarconfiguresettingswidget.h"
10#include "gravatarsettings.h"
11#include <Gravatar/GravatarCache>
12#include <KConfigDialogManager>
13#include <KLocalization>
14#include <KLocalizedString>
23using namespace Gravatar;
25GravatarConfigureSettingsWidget::GravatarConfigureSettingsWidget(
QWidget *parent)
29 topLayout->setObjectName(
"mainlayout"_L1);
30 topLayout->setContentsMargins(0, 0, 0, 0);
31 mUseDefaultPixmap =
new QCheckBox(
i18nc(
"@option:check",
"Use Default Image"),
this);
32 mUseDefaultPixmap->setObjectName(
"kcfg_GravatarUseDefaultImage"_L1);
33 topLayout->addWidget(mUseDefaultPixmap);
35 mUseLibravatar =
new QCheckBox(
i18nc(
"@option:check",
"Use Libravatar"),
this);
36 mUseLibravatar->setObjectName(
"kcfg_LibravatarSupportEnabled"_L1);
37 topLayout->addWidget(mUseLibravatar);
39 mFallbackGravatar =
new QCheckBox(
i18nc(
"@option:check",
"Fallback to Gravatar"),
this);
40 mFallbackGravatar->setObjectName(
"kcfg_FallbackToGravatar"_L1);
41 topLayout->addWidget(mFallbackGravatar);
43 mFallbackGravatar->setEnabled(
false);
47 auto lab =
new QLabel(
i18nc(
"@label:textbox",
"Gravatar Cache Size:"),
this);
48 lab->setObjectName(
"gravatarcachesizelabel"_L1);
49 cacheSizeLayout->addWidget(lab);
51 mGravatarCacheSize =
new QSpinBox(
this);
52 mGravatarCacheSize->setMinimum(1);
53 mGravatarCacheSize->setMaximum(9999);
55 mGravatarCacheSize->setObjectName(
"kcfg_GravatarCacheSize"_L1);
56 cacheSizeLayout->addWidget(mGravatarCacheSize);
57 cacheSizeLayout->addStretch();
60 separator->setObjectName(
"separator"_L1);
61 topLayout->addWidget(separator);
65 mClearGravatarCache =
new QPushButton(
i18nc(
"@action:button",
"Clear Gravatar Cache"),
this);
66 mClearGravatarCache->setObjectName(
"cleargravatarcachebutton"_L1);
67 buttonLayout->addWidget(mClearGravatarCache);
68 buttonLayout->addStretch();
71 separator->setObjectName(
"separator2"_L1);
72 topLayout->addWidget(separator);
79GravatarConfigureSettingsWidget::~GravatarConfigureSettingsWidget() =
default;
81void GravatarConfigureSettingsWidget::slotClearGravatarCache()
83 Gravatar::GravatarCache::self()->clearAllCache();
86void GravatarConfigureSettingsWidget::slotRestoreDefault()
91void GravatarConfigureSettingsWidget::save()
96void GravatarConfigureSettingsWidget::load()
101#include "moc_gravatarconfiguresettingswidget.cpp"
void updateWidgetsDefault()
QString i18nc(const char *context, const char *text, const TYPE &arg...)
KLocalizedString KI18N_EXPORT ki18ncp(const char *context, const char *singular, const char *plural)
void setupSpinBoxFormatString(T *spinBox, const KLocalizedString &formatString)
void addLayout(QLayout *layout, int stretch)
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)