File indexing completed on 2024-12-08 04:34:26

0001 /*
0002    SPDX-FileCopyrightText: 2021-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "otrwidget.h"
0008 
0009 #include <KLocalizedString>
0010 #include <QAction>
0011 
0012 OtrWidget::OtrWidget(QWidget *parent)
0013     : KMessageWidget(parent)
0014 {
0015     setVisible(false);
0016     setCloseButtonVisible(false);
0017     setMessageType(Information);
0018     setPosition(KMessageWidget::Header);
0019     setText(i18n("Otr Activated"));
0020     auto endOtrAction = new QAction(i18n("End OTR"), this);
0021     endOtrAction->setObjectName(QStringLiteral("endOtrAction"));
0022     connect(endOtrAction, &QAction::triggered, this, &OtrWidget::closeOtr);
0023     addAction(endOtrAction);
0024 
0025     auto refreshKeysAction = new QAction(i18n("Refresh Keys"), this);
0026     refreshKeysAction->setObjectName(QStringLiteral("refreshKeysAction"));
0027     connect(refreshKeysAction, &QAction::triggered, this, &OtrWidget::refreshKeys);
0028     addAction(refreshKeysAction);
0029 }
0030 
0031 OtrWidget::~OtrWidget() = default;
0032 
0033 #include "moc_otrwidget.cpp"