Messagelib

remotecontentdialog.cpp
1 /*
2  SPDX-FileCopyrightText: 2021-2022 Laurent Montel <[email protected]>
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>
12 using namespace MessageViewer;
13 RemoteContentDialog::RemoteContentDialog(QWidget *parent)
14  : QDialog(parent)
15  , mRemoveContentWidget(new RemoteContentWidget(this))
16 {
17  auto mainLayout = new QVBoxLayout(this);
18  mainLayout->setObjectName(QStringLiteral("mainLayout"));
19 
20  mRemoveContentWidget->setObjectName(QStringLiteral("mRemoveContentWidget"));
21  mainLayout->addWidget(mRemoveContentWidget);
22 
24  buttonBox->setObjectName(QStringLiteral("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 
35 RemoteContentDialog::~RemoteContentDialog() = default;
36 
37 RemoteContentInfo RemoteContentDialog::info() const
38 {
39  return mRemoveContentWidget->info();
40 }
41 
42 void RemoteContentDialog::setInfo(const RemoteContentInfo &info)
43 {
44  mRemoveContentWidget->setInfo(info);
45 }
The RemoteContentInfo class.
virtual void reject()
virtual void accept()
void setEnabled(bool)
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Tue May 24 2022 04:08:04 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.