Akonadi::CollectionPropertiesDialog Class

A generic and extensible dialog for collection properties. More...

Header: #include <Akonadi/CollectionPropertiesDialog>
CMake: find_package(KPim6 REQUIRED COMPONENTS AkonadiWidgets)
target_link_libraries(mytarget PRIVATE KPim6::AkonadiWidgets)

Public Types

enum DefaultPage { GeneralPage, CachePage }

Public Functions

CollectionPropertiesDialog(const Akonadi::Collection &collection, QWidget *parent = nullptr)
CollectionPropertiesDialog(const Akonadi::Collection &collection, const QStringList &pages, QWidget *parent = nullptr)
virtual ~CollectionPropertiesDialog() override
void setCurrentPage(const QString &name)

Signals

void settingsSaved()

Static Public Members

QString defaultPageObjectName(Akonadi::CollectionPropertiesDialog::DefaultPage page)
void registerPage(Akonadi::CollectionPropertiesPageFactory *factory)
void useDefaultPage(bool use)

Detailed Description

This dialog allows you to show or modify the properties of a collection.

 Akonadi::Collection collection = ...

 CollectionPropertiesDialog dlg( collection, this );
 dlg.exec();

It can be extended by custom pages, which contains gui elements for custom properties.

Author: Volker Krause <vkrause@kde.org>

See also Akonadi::CollectionPropertiesPage.

Member Type Documentation

enum CollectionPropertiesDialog::DefaultPage

Enumerates the registered default pages which can be displayed.

Member Function Documentation

[explicit] CollectionPropertiesDialog::CollectionPropertiesDialog(const Akonadi::Collection &collection, QWidget *parent = nullptr)

Creates a new collection properties dialog.

collection The collection which properties should be shown. parent The parent widget.

CollectionPropertiesDialog::CollectionPropertiesDialog(const Akonadi::Collection &collection, const QStringList &pages, QWidget *parent = nullptr)

Creates a new collection properties dialog.

This constructor allows to specify the subset of registered pages that will be shown as well as their order. The pages have to set an objectName in their constructor to make it work. If an empty list is passed, all registered pages will be loaded. Use defaultPageObjectName() to fetch the object name for a registered default page.

collection The collection which properties should be shown. pages The object names of the pages that shall be loaded. parent The parent widget.

[override virtual noexcept] CollectionPropertiesDialog::~CollectionPropertiesDialog()

Destroys the collection properties dialog.

Note: Never call manually, the dialog is deleted automatically once all changes are written back to the Akonadi storage.

[static] QString CollectionPropertiesDialog::defaultPageObjectName(Akonadi::CollectionPropertiesDialog::DefaultPage page)

Returns the object name of one of the dialog's registered default pages. The object name may be used in the QStringList constructor parameter to specify which default pages should be shown.

page the desired page Returns the page's object name

[static] void CollectionPropertiesDialog::registerPage(Akonadi::CollectionPropertiesPageFactory *factory)

Register custom pages for the collection properties dialog.

factory The properties page factory that provides the custom page.

See also Akonadi::CollectionPropertiesPageFactory.

void CollectionPropertiesDialog::setCurrentPage(const QString &name)

Sets the page to be shown in the tab widget.

name The object name of the page that is to be shown.

[signal] void CollectionPropertiesDialog::settingsSaved()

[static] void CollectionPropertiesDialog::useDefaultPage(bool use)

Sets whether to use default page or not.

use mode of default page's usage