LibKmahjongg

kmahjonggconfigdialog.cpp
1/*
2 SPDX-FileCopyrightText: 2006 Mauricio Piacentini <mauricio@tabuleiro.com>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7// own
8#include "kmahjonggconfigdialog.h"
9
10// KF
11#include <KConfig>
12#include <KLocalizedString>
13
14// LibKMahjongg
15#include "kmahjonggbackgroundselector.h"
16#include "kmahjonggtilesetselector.h"
17#include "libkmahjongg_debug.h"
18
19class KMahjonggConfigDialogPrivate
20{
21public:
22 explicit KMahjonggConfigDialogPrivate(KConfigSkeleton *config)
23 : m_config(config)
24 {}
25
26public:
27 KConfigSkeleton *m_config;
28};
29
30KMahjonggConfigDialog::KMahjonggConfigDialog(QWidget *parent, const QString &name, KConfigSkeleton *config)
31 : KConfigDialog(parent, name, config)
32 , d_ptr(new KMahjonggConfigDialogPrivate(config))
33{
34 setFaceType(List);
35 setModal(true);
36}
37
38KMahjonggConfigDialog::~KMahjonggConfigDialog() = default;
39
40void KMahjonggConfigDialog::addTilesetPage()
41{
43
44 auto *ts = new KMahjonggTilesetSelector(this, d->m_config);
45 // TODO: Use the cards icon for our page for now, need to get one for tilesets made
46 addPage(ts, i18nc("@title:tab", "Tiles"), QStringLiteral("games-config-tiles"));
47}
48
49void KMahjonggConfigDialog::addBackgroundPage()
50{
52
53 auto *ts = new KMahjonggBackgroundSelector(this, d->m_config);
54 // TODO: need icon
55 addPage(ts, i18nc("@title:tab", "Background"), QStringLiteral("games-config-background"));
56}
57
58void KMahjonggConfigDialog::updateWidgetsDefault()
59{
60 // qCDebug(LIBKMAHJONGG_LOG) << "updateWidgetsDefault";
61}
62
63#include "moc_kmahjonggconfigdialog.cpp"
KPageWidgetItem * addPage(QWidget *page, const QString &itemName, const QString &pixmapName=QString(), const QString &header=QString(), bool manage=true)
An extended config dialog with convenience methods to add pages for managing tilesets & backgrounds.
QString i18nc(const char *context, const char *text, const TYPE &arg...)
QString name(GameStandardAction id)
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:48:34 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.