File indexing completed on 2024-04-21 04:05:21

0001 /*
0002     SPDX-FileCopyrightText: 2006 Mauricio Piacentini <mauricio@tabuleiro.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 // own
0008 #include "kmahjonggconfigdialog.h"
0009 
0010 // KF
0011 #include <KConfig>
0012 #include <KLocalizedString>
0013 
0014 // LibKMahjongg
0015 #include "kmahjonggbackgroundselector.h"
0016 #include "kmahjonggtilesetselector.h"
0017 #include "libkmahjongg_debug.h"
0018 
0019 class KMahjonggConfigDialogPrivate
0020 {
0021 public:
0022     explicit KMahjonggConfigDialogPrivate(KConfigSkeleton *config)
0023         : m_config(config)
0024     {}
0025 
0026 public:
0027     KConfigSkeleton *m_config;
0028 };
0029 
0030 KMahjonggConfigDialog::KMahjonggConfigDialog(QWidget *parent, const QString &name, KConfigSkeleton *config)
0031     : KConfigDialog(parent, name, config)
0032     , d_ptr(new KMahjonggConfigDialogPrivate(config))
0033 {
0034     setFaceType(List);
0035     setModal(true);
0036 }
0037 
0038 KMahjonggConfigDialog::~KMahjonggConfigDialog() = default;
0039 
0040 void KMahjonggConfigDialog::addTilesetPage()
0041 {
0042     Q_D(KMahjonggConfigDialog);
0043 
0044     auto *ts = new KMahjonggTilesetSelector(this, d->m_config);
0045     // TODO: Use the cards icon for our page for now, need to get one for tilesets made
0046     addPage(ts, i18n("Tiles"), QStringLiteral("games-config-tiles"));
0047 }
0048 
0049 void KMahjonggConfigDialog::addBackgroundPage()
0050 {
0051     Q_D(KMahjonggConfigDialog);
0052 
0053     auto *ts = new KMahjonggBackgroundSelector(this, d->m_config);
0054     // TODO: need icon
0055     addPage(ts, i18n("Background"), QStringLiteral("games-config-background"));
0056 }
0057 
0058 void KMahjonggConfigDialog::updateWidgetsDefault()
0059 {
0060     // qCDebug(LIBKMAHJONGG_LOG) << "updateWidgetsDefault";
0061 }
0062 
0063 #include "moc_kmahjonggconfigdialog.cpp"