remotecontentwidget.cpp 1.14 KB
Newer Older
1
2
3
4
5
6
7
8
9
/*
   SPDX-FileCopyrightText: 2021 Laurent Montel <montel@kde.org>

   SPDX-License-Identifier: LGPL-2.0-or-later
*/

#include "remotecontentwidget.h"

#include <QVBoxLayout>
Laurent Montel's avatar
Laurent Montel committed
10
11
12
13
#include <QLabel>
#include <KLocalizedString>
#include <QLineEdit>

14
15
16
using namespace MessageViewer;
RemoteContentWidget::RemoteContentWidget(QWidget *parent)
    : QWidget(parent)
Laurent Montel's avatar
Laurent Montel committed
17
    , mLineEdit(new QLineEdit(this))
18
19
20
21
{
    auto mainLayout = new QVBoxLayout(this);
    mainLayout->setObjectName(QStringLiteral("mainLayout"));
    mainLayout->setContentsMargins({});
Laurent Montel's avatar
Laurent Montel committed
22
23
24
    auto label = new QLabel(i18n("Url"), this);
    label->setObjectName(QStringLiteral("label"));
    mainLayout->addWidget(label);
25

Laurent Montel's avatar
Laurent Montel committed
26
27
    mLineEdit->setObjectName(QStringLiteral("mLineEdit"));
    mainLayout->addWidget(mLineEdit);
28
29
30
31
32
33
}

RemoteContentWidget::~RemoteContentWidget()
{

}
34
35
36

RemoteContentInfo RemoteContentWidget::info() const
{
Laurent Montel's avatar
Laurent Montel committed
37
38
39
    RemoteContentInfo info;
    info.setUrl(mLineEdit->text());
    //info.setStatus() TODO implement
40
    //TODO
Laurent Montel's avatar
Laurent Montel committed
41
    return info;
42
}
Laurent Montel's avatar
Laurent Montel committed
43
44
45

void RemoteContentWidget::setInfo(const RemoteContentInfo &info)
{
Laurent Montel's avatar
Laurent Montel committed
46
47
    mLineEdit->setText(info.url());
    //mLineEdit->setText(info.status());
Laurent Montel's avatar
Laurent Montel committed
48
49
    //TODO
}