File indexing completed on 2025-01-19 04:46:54
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 "enterpriseheaderstyleinterface.h" 0008 #include <KActionCollection> 0009 #include <KLocalizedString> 0010 #include <KToggleAction> 0011 using namespace MessageViewer; 0012 EnterpriseHeaderStyleInterface::EnterpriseHeaderStyleInterface(MessageViewer::HeaderStylePlugin *plugin, QObject *parent) 0013 : MessageViewer::HeaderStyleInterface(plugin, parent) 0014 { 0015 } 0016 0017 EnterpriseHeaderStyleInterface::~EnterpriseHeaderStyleInterface() = default; 0018 0019 void EnterpriseHeaderStyleInterface::createAction(KActionMenu *menu, QActionGroup *actionGroup, KActionCollection *ac) 0020 { 0021 auto act = new KToggleAction(i18nc("View->headers->", "&Enterprise Headers"), this); 0022 ac->addAction(QStringLiteral("view_headers_enterprise"), act); 0023 connect(act, &KToggleAction::triggered, this, &EnterpriseHeaderStyleInterface::slotStyleChanged); 0024 addHelpTextAction(act, i18n("Show the list of headers in Enterprise style")); 0025 mAction.append(act); 0026 addActionToMenu(menu, actionGroup); 0027 } 0028 0029 void EnterpriseHeaderStyleInterface::activateAction() 0030 { 0031 mAction.at(0)->setChecked(true); 0032 } 0033 0034 #include "moc_enterpriseheaderstyleinterface.cpp"