File indexing completed on 2024-05-19 05:35:17
0001 #ifndef oxygenconfigwidget_h 0002 #define oxygenconfigwidget_h 0003 ////////////////////////////////////////////////////////////////////////////// 0004 // oxygenconfigurationui.h 0005 // ------------------- 0006 // 0007 // SPDX-FileCopyrightText: 2009 Hugo Pereira Da Costa <hugo.pereira@free.fr> 0008 // 0009 // SPDX-License-Identifier: MIT 0010 ////////////////////////////////////////////////////////////////////////////// 0011 0012 #include "oxygen.h" 0013 #include "oxygenexceptionlistwidget.h" 0014 #include "oxygensettings.h" 0015 #include "oxygenshadowconfigwidget.h" 0016 #include "ui_oxygenconfigurationui.h" 0017 0018 #include <KCModule> 0019 #include <KSharedConfig> 0020 0021 #include <QSharedPointer> 0022 #include <QWidget> 0023 0024 namespace Oxygen 0025 { 0026 //_____________________________________________ 0027 class ConfigWidget : public KCModule 0028 { 0029 Q_OBJECT 0030 0031 public: 0032 //* constructor 0033 explicit ConfigWidget(QObject *parent, const KPluginMetaData &metaData, const QVariantList &args); 0034 0035 //* default 0036 void defaults() override; 0037 0038 //* load configuration 0039 void load(void) override; 0040 0041 //* save configuration 0042 void save(void) override; 0043 0044 //* true if changed 0045 bool isChanged(void) const 0046 { 0047 return m_changed; 0048 } 0049 0050 //* exceptions 0051 ExceptionListWidget *exceptionListWidget(void) const 0052 { 0053 return m_ui.exceptions; 0054 } 0055 0056 private Q_SLOTS: 0057 0058 //* update changed state 0059 void updateChanged(); 0060 0061 private: 0062 //* set changed state 0063 void setChanged(bool value) 0064 { 0065 m_changed = value; 0066 setNeedsSave(value); 0067 } 0068 0069 //* ui 0070 Ui_OxygenConfigurationUI m_ui; 0071 0072 //* kconfiguration object 0073 KSharedConfig::Ptr m_configuration; 0074 0075 //* internal exception 0076 InternalSettingsPtr m_internalSettings; 0077 0078 //* changed state 0079 bool m_changed = false; 0080 }; 0081 } 0082 0083 #endif