File indexing completed on 2025-01-05 04:49:44

0001 /*
0002    SPDX-FileCopyrightText: 2015-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "standardsheaderstyleinterface.h"
0008 #include <KActionCollection>
0009 #include <KLocalizedString>
0010 #include <KToggleAction>
0011 
0012 using namespace MessageViewer;
0013 StandardsHeaderStyleInterface::StandardsHeaderStyleInterface(MessageViewer::HeaderStylePlugin *plugin, QObject *parent)
0014     : MessageViewer::HeaderStyleInterface(plugin, parent)
0015 {
0016 }
0017 
0018 StandardsHeaderStyleInterface::~StandardsHeaderStyleInterface() = default;
0019 
0020 void StandardsHeaderStyleInterface::createAction(KActionMenu *menu, QActionGroup *actionGroup, KActionCollection *ac)
0021 {
0022     auto act = new KToggleAction(i18nc("View->headers->", "&Standard Headers"), this);
0023     ac->addAction(QStringLiteral("view_headers_standard"), act);
0024     connect(act, &KToggleAction::triggered, this, &StandardsHeaderStyleInterface::slotStyleChanged);
0025     addHelpTextAction(act, i18n("Show standard list of message headers"));
0026     mAction.append(act);
0027     addActionToMenu(menu, actionGroup);
0028 }
0029 
0030 void StandardsHeaderStyleInterface::activateAction()
0031 {
0032     mAction.at(0)->setChecked(true);
0033 }
0034 
0035 #include "moc_standardsheaderstyleinterface.cpp"