File indexing completed on 2024-12-22 05:01:00
0001 /* 0002 This file is part of KMail, the KDE mail client. 0003 SPDX-FileCopyrightText: 2004 Till Adam <adam@kde.org> 0004 SPDX-FileCopyrightText: 2013 Jonathan Marten <jjm@keelhaul.me.uk> 0005 0006 SPDX-License-Identifier: GPL-2.0-only 0007 */ 0008 0009 #pragma once 0010 0011 #include <MailCommon/FolderSettings> 0012 0013 #include <Akonadi/CollectionPropertiesPage> 0014 0015 template<typename T> 0016 class QSharedPointer; 0017 0018 class KKeySequenceWidget; 0019 0020 class CollectionShortcutPage : public Akonadi::CollectionPropertiesPage 0021 { 0022 Q_OBJECT 0023 public: 0024 explicit CollectionShortcutPage(QWidget *parent = nullptr); 0025 ~CollectionShortcutPage() override; 0026 0027 void load(const Akonadi::Collection &col) override; 0028 void save(Akonadi::Collection &col) override; 0029 0030 private: 0031 void slotShortcutChanged(); 0032 void init(const Akonadi::Collection &); 0033 QSharedPointer<MailCommon::FolderSettings> mFolder; 0034 Akonadi::Collection mCurrentCollection; 0035 KKeySequenceWidget *const mKeySeqWidget; 0036 bool mShortcutChanged = false; 0037 }; 0038 0039 AKONADI_COLLECTION_PROPERTIES_PAGE_FACTORY(CollectionShortcutPageFactory, CollectionShortcutPage)