File indexing completed on 2024-12-01 04:37:01
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 "roomquotemessagewidget.h" 0008 #include <KLocalizedString> 0009 #include <QAction> 0010 #include <QPushButton> 0011 0012 RoomQuoteMessageWidget::RoomQuoteMessageWidget(QWidget *parent) 0013 : KMessageWidget(parent) 0014 { 0015 setCloseButtonVisible(false); 0016 setMessageType(Information); 0017 setPosition(KMessageWidget::Header); 0018 setWordWrap(true); 0019 setVisible(false); 0020 auto cancelReplyingInThreadAction = new QAction(i18n("Cancel"), this); 0021 connect(cancelReplyingInThreadAction, &QAction::triggered, this, &RoomQuoteMessageWidget::cancelQuoteMessage); 0022 addAction(cancelReplyingInThreadAction); 0023 } 0024 0025 RoomQuoteMessageWidget::~RoomQuoteMessageWidget() = default; 0026 0027 void RoomQuoteMessageWidget::setMessageText(const QString &str) 0028 { 0029 setText(i18n("Quote Message: \'%1\'", str)); 0030 } 0031 0032 #include "moc_roomquotemessagewidget.cpp"