KDE PIM support for the p≡p engine
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

68 lines
1.6 KiB

/*
SPDX-FileCopyrightText: 2015-2021 Laurent Montel <montel@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "pep_plugininterface.h"
#include <KActionCollection>
#include <KLocalizedString>
#include <QAction>
#include <kde_pep_common/pep_wizard.h>
pEpPluginInterface::pEpPluginInterface(QObject *parent)
: PimCommon::GenericPluginInterface(parent)
{
}
pEpPluginInterface::~pEpPluginInterface()
{
}
void pEpPluginInterface::createAction(KActionCollection *ac)
{
QAction *action;
QIcon::setThemeName(QStringLiteral("hicolor"));
action = new QAction(i18n("&p≡p Wizard..."), this);
action->setIcon(QIcon::fromTheme(QStringLiteral("akonadi-pep")));
ac->addAction(QStringLiteral("pepWizard"), action);
connect(action, &QAction::triggered, this, &pEpPluginInterface::slotActivated);
addActionType(PimCommon::ActionType(action, PimCommon::ActionType::ToolBar));
}
void pEpPluginInterface::slotActivated()
{
Q_EMIT emitPluginActivated(this);
}
void pEpPluginInterface::setCurrentItems(const Akonadi::Item::List &items)
{
qDebug() << __func__;
}
void pEpPluginInterface::setItems(const Akonadi::Item::List &items)
{
qDebug() << __func__;
}
void pEpPluginInterface::setCurrentCollection(const Akonadi::Collection &col)
{
qDebug() << __func__;
}
void pEpPluginInterface::setCollections(const Akonadi::Collection::List &cols)
{
qDebug() << __func__;
}
pEpPluginInterface::RequireTypes pEpPluginInterface::requiresFeatures() const
{
return RequireType::CurrentItems;
}
void pEpPluginInterface::exec()
{
pEpWizard wiz(parentWidget());
wiz.exec();
}