File indexing completed on 2024-04-28 04:21:19
0001 // SPDX-FileCopyrightText: 2003-2022 The KPhotoAlbum Development Team 0002 // 0003 // SPDX-License-Identifier: GPL-2.0-or-later 0004 0005 #ifndef CATEGORYPAGE_H 0006 #define CATEGORYPAGE_H 0007 0008 #include <kpabase/SettingsData.h> 0009 0010 #include <QAbstractItemDelegate> 0011 #include <QLabel> 0012 #include <QWidget> 0013 0014 class QListWidget; 0015 class QListWidgetItem; 0016 class QComboBox; 0017 class QSpinBox; 0018 class QCheckBox; 0019 class QPushButton; 0020 class QGroupBox; 0021 class KIconButton; 0022 0023 namespace DB 0024 { 0025 0026 // Local classes 0027 class MemberMap; 0028 0029 } 0030 0031 namespace Settings 0032 { 0033 0034 // Local classes 0035 class CategoryItem; 0036 class SettingsDialog; 0037 class UntaggedGroupBox; 0038 class SettingsData; 0039 0040 class CategoryPage : public QWidget 0041 { 0042 Q_OBJECT 0043 0044 public: 0045 explicit CategoryPage(QWidget *parent); 0046 void enableDisable(bool); 0047 void saveSettings(Settings::SettingsData *opt, DB::MemberMap *memberMap); 0048 void loadSettings(Settings::SettingsData *opt); 0049 void resetInterface(); 0050 void resetCategoryNamesChanged(); 0051 0052 Q_SIGNALS: 0053 void categoryChangesPending(); 0054 0055 protected Q_SLOTS: 0056 friend class SettingsDialog; 0057 void resetCategoryLabel(); 0058 0059 private Q_SLOTS: 0060 void editSelectedCategory(); 0061 void editCategory(QListWidgetItem *); 0062 void positionableChanged(bool); 0063 void iconChanged(const QString &icon); 0064 void thumbnailSizeChanged(int); 0065 void preferredViewChanged(int); 0066 void newCategory(); 0067 void deleteCurrentCategory(); 0068 void renameCurrentCategory(); 0069 void categoryNameChanged(QListWidgetItem *item); 0070 void saveDbNow(); 0071 0072 private: // Functions 0073 void resetCategory(QListWidgetItem *item); 0074 0075 private: // Variables 0076 QListWidget *m_categoriesListWidget; 0077 QLabel *m_categoryLabel; 0078 QLabel *m_renameLabel; 0079 QLabel *m_positionableLabel; 0080 QCheckBox *m_positionable; 0081 QLabel *m_iconLabel; 0082 KIconButton *m_icon; 0083 QLabel *m_thumbnailSizeInCategoryLabel; 0084 QSpinBox *m_thumbnailSizeInCategory; 0085 QLabel *m_preferredViewLabel; 0086 QComboBox *m_preferredView; 0087 QPushButton *m_delItem; 0088 QPushButton *m_renameItem; 0089 Settings::CategoryItem *m_currentCategory; 0090 QList<CategoryItem *> m_deletedCategories; 0091 UntaggedGroupBox *m_untaggedBox; 0092 QString m_categoryNameBeforeEdit; 0093 QLabel *m_dbNotSavedLabel; 0094 QPushButton *m_saveDbNowButton; 0095 bool m_categoryNamesChanged; 0096 QPushButton *m_newCategoryButton; 0097 }; 0098 0099 } 0100 0101 #endif // CATEGORYPAGE_H 0102 0103 // vi:expandtab:tabstop=4 shiftwidth=4: