File indexing completed on 2024-05-19 05:04:04
0001 /* 0002 SPDX-FileCopyrightText: 2020-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #include "directchannelinfodialog.h" 0008 #include "directchannelinfowidget.h" 0009 #include <KConfigGroup> 0010 #include <KLocalizedString> 0011 #include <KSharedConfig> 0012 #include <QDialogButtonBox> 0013 #include <QVBoxLayout> 0014 0015 DirectChannelInfoDialog::DirectChannelInfoDialog(RocketChatAccount *account, QWidget *parent) 0016 : QDialog(parent) 0017 , mDirectChannelInfoWidget(new DirectChannelInfoWidget(account, this)) 0018 { 0019 setWindowTitle(i18nc("@title:window", "User Info")); 0020 auto mainLayout = new QVBoxLayout(this); 0021 mainLayout->setObjectName(QStringLiteral("mainLayout")); 0022 0023 mDirectChannelInfoWidget->setObjectName(QStringLiteral("mDirectChannelInfoWidget")); 0024 mainLayout->addWidget(mDirectChannelInfoWidget); 0025 0026 auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Close, this); 0027 buttonBox->setObjectName(QStringLiteral("buttonBox")); 0028 connect(buttonBox, &QDialogButtonBox::rejected, this, &DirectChannelInfoDialog::reject); 0029 mainLayout->addWidget(buttonBox); 0030 } 0031 0032 DirectChannelInfoDialog::~DirectChannelInfoDialog() = default; 0033 0034 void DirectChannelInfoDialog::setUserName(const QString &userName) 0035 { 0036 mDirectChannelInfoWidget->setUserName(userName); 0037 } 0038 0039 void DirectChannelInfoDialog::setRoles(const QVector<RoleInfo> &newRoles) 0040 { 0041 mDirectChannelInfoWidget->setRoles(newRoles); 0042 } 0043 0044 #include "moc_directchannelinfodialog.cpp"