Messagelib

remotecontentdialog.cpp
1/*
2 SPDX-FileCopyrightText: 2021-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "remotecontentdialog.h"
8#include "remotecontentwidget.h"
9#include <QDialogButtonBox>
10#include <QPushButton>
11#include <QVBoxLayout>
12using namespace MessageViewer;
13RemoteContentDialog::RemoteContentDialog(QWidget *parent)
14 : QDialog(parent)
15 , mRemoveContentWidget(new RemoteContentWidget(this))
16{
17 auto mainLayout = new QVBoxLayout(this);
18 mainLayout->setObjectName(QLatin1StringView("mainLayout"));
19
20 mRemoveContentWidget->setObjectName(QLatin1StringView("mRemoveContentWidget"));
21 mainLayout->addWidget(mRemoveContentWidget);
22
24 buttonBox->setObjectName(QLatin1StringView("buttonBox"));
25 connect(buttonBox, &QDialogButtonBox::accepted, this, &RemoteContentDialog::accept);
26 connect(buttonBox, &QDialogButtonBox::rejected, this, &RemoteContentDialog::reject);
27 mainLayout->addWidget(buttonBox);
28 QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
29 okButton->setEnabled(false);
30 connect(mRemoveContentWidget, &RemoteContentWidget::updateOkButton, this, [okButton](bool enabled) {
31 okButton->setEnabled(enabled);
32 });
33}
34
35RemoteContentDialog::~RemoteContentDialog() = default;
36
37RemoteContentInfo RemoteContentDialog::info() const
38{
39 return mRemoveContentWidget->info();
40}
41
42void RemoteContentDialog::setInfo(const RemoteContentInfo &info)
43{
44 mRemoveContentWidget->setInfo(info);
45}
46
47#include "moc_remotecontentdialog.cpp"
The RemoteContentInfo class.
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
void setEnabled(bool)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 11 2024 12:08:46 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.