File indexing completed on 2024-04-21 03:51:03

0001 /*
0002     SPDX-FileCopyrightText: 2007 Frederik Gladhorn <frederik.gladhorn@kdemail.net>
0003     SPDX-FileCopyrightText: 2014 Inge Wallin <inge@lysator.liu.se>
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef CONFIGUREPRACTICEDIALOG_H
0008 #define CONFIGUREPRACTICEDIALOG_H
0009 
0010 #include <KConfigDialog>
0011 #include <KConfigSkeleton>
0012 #include <KEduVocDocument>
0013 
0014 class GeneralPracticeOptions;
0015 class SpecificPracticeOptions;
0016 class ThresholdOptions;
0017 class BlockOptions;
0018 
0019 /**
0020  *
0021  */
0022 class ConfigurePracticeDialog : public KConfigDialog
0023 {
0024     Q_OBJECT
0025 
0026 public:
0027     ConfigurePracticeDialog(KEduVocDocument *doc, QWidget *parent, const QString &name, KConfigSkeleton *config);
0028 
0029     ~ConfigurePracticeDialog() override;
0030 
0031     void commitData();
0032 
0033 private Q_SLOTS:
0034     /**
0035      * Called when the user clicks Apply or OK.
0036      */
0037     void updateSettings() override;
0038     /**
0039      * Updates dialog widgets. Here only used after loading a profile.
0040      * Profiles only store the settings of the last three pages in the dialog.
0041      */
0042     void updateWidgets() override;
0043     /**
0044      * Called when the user clicks Default
0045      */
0046     void updateWidgetsDefault() override;
0047 
0048     /**
0049      * Returns true if the current state of the dialog is different from the saved settings
0050      */
0051     bool hasChanged() override;
0052 
0053 private:
0054     /**
0055      * Returns true if the current state of the dialog represents the default settings.
0056      */
0057     bool isDefault() override;
0058 
0059     GeneralPracticeOptions *m_generalPracticeOptions{nullptr};
0060     BlockOptions *m_blockOptions{nullptr};
0061     ThresholdOptions *m_thresholdOptions{nullptr};
0062     SpecificPracticeOptions *m_specificPracticeOptions{nullptr};
0063 
0064     KConfigSkeleton *m_config{nullptr};
0065 };
0066 
0067 #endif // ConfigurePracticeDialog_included