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

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