File indexing completed on 2024-05-12 05:21:22
0001 /* 0002 This file is part of KOrganizer. 0003 0004 SPDX-FileCopyrightText: 2004 Tobias Koenig <tokoe@kde.org> 0005 SPDX-FileCopyrightText: 2004 Cornelius Schumacher <schumacher@kde.org> 0006 0007 SPDX-License-Identifier: LGPL-2.0-or-later 0008 */ 0009 0010 #pragma once 0011 #include <KCModule> 0012 #include <KPluginMetaData> 0013 class QLabel; 0014 class QPushButton; 0015 class QTreeWidget; 0016 class QTreeWidgetItem; 0017 0018 class KCMDesignerFields : public KCModule 0019 { 0020 Q_OBJECT 0021 public: 0022 explicit KCMDesignerFields(QObject *parent, const KPluginMetaData &data = {}); 0023 0024 void load() override; 0025 void save() override; 0026 void defaults() override; 0027 0028 protected: 0029 void loadUiFiles(); 0030 void loadActivePages(const QStringList &); 0031 [[nodiscard]] QStringList saveActivePages(); 0032 0033 virtual QString localUiDir() = 0; 0034 virtual QString uiPath() = 0; 0035 virtual void writeActivePages(const QStringList &) = 0; 0036 virtual QStringList readActivePages() = 0; 0037 virtual QString applicationName() = 0; 0038 0039 private Q_SLOTS: 0040 void updatePreview(); 0041 void itemClicked(QTreeWidgetItem *); 0042 void startDesigner(); 0043 void rebuildList(); 0044 void deleteFile(); 0045 void importFile(); 0046 void delayedInit(); 0047 void showWhatsThis(const QString &href); 0048 0049 private: 0050 void initGUI(); 0051 0052 QTreeWidget *mPageView = nullptr; 0053 QLabel *mPagePreview = nullptr; 0054 QLabel *mPageDetails = nullptr; 0055 QPushButton *mDeleteButton = nullptr; 0056 QPushButton *mImportButton = nullptr; 0057 QPushButton *mDesignerButton = nullptr; 0058 };