MailImporter

importmailswidget.cpp
1/*
2 SPDX-FileCopyrightText: 2012-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#include "importmailswidget.h"
8#include "ui_importmailswidget.h"
9
10#include <QAbstractTextDocumentLayout>
11
12using namespace MailImporter;
13
14class MailImporter::ImportMailsWidgetPrivate
15{
16public:
17 ImportMailsWidgetPrivate()
18 : ui(new Ui::ImportMailsWidget)
19 {
20 }
21
22 ~ImportMailsWidgetPrivate()
23 {
24 delete ui;
25 }
26
27 Ui::ImportMailsWidget *const ui;
28};
29
30ImportMailsWidget::ImportMailsWidget(QWidget *parent)
31 : QWidget(parent)
32 , d(new MailImporter::ImportMailsWidgetPrivate)
33{
34 d->ui->setupUi(this);
35}
36
37ImportMailsWidget::~ImportMailsWidget() = default;
38
39void ImportMailsWidget::setStatusMessage(const QString &status)
40{
41 d->ui->textStatus->setText(status);
42}
43
44void ImportMailsWidget::setFrom(const QString &from)
45{
46 d->ui->from->setText(from);
47}
48
49void ImportMailsWidget::setTo(const QString &to)
50{
51 d->ui->to->setText(to);
52}
53
54void ImportMailsWidget::setCurrent(const QString &current)
55{
56 d->ui->current->setText(current);
57}
58
59void ImportMailsWidget::setCurrent(int percent)
60{
61 d->ui->done_current->setValue(percent);
62}
63
64void ImportMailsWidget::setOverall(int percent)
65{
66 d->ui->done_overall->setValue(percent);
67}
68
69void ImportMailsWidget::addItem(QListWidgetItem *item)
70{
71 d->ui->log->addItem(item);
72}
73
74void ImportMailsWidget::setLastCurrentItem()
75{
76 d->ui->log->setCurrentItem(d->ui->log->item(d->ui->log->count() - 1));
77}
78
79void ImportMailsWidget::addInfoLogEntry(const QString &log)
80{
81 d->ui->log->addInfoLogEntry(log);
82}
83
84void ImportMailsWidget::addErrorLogEntry(const QString &log)
85{
86 d->ui->log->addErrorLogEntry(log);
87}
88
89void ImportMailsWidget::clear()
90{
91 d->ui->log->clear();
92 setCurrent(0);
93 setOverall(0);
94 setCurrent(QString());
95 setFrom(QString());
96 setTo(QString());
97}
98
99#include "moc_importmailswidget.cpp"
The ImportMailsWidget class.
Q_SCRIPTABLE CaptureState status()
void setupUi(QWidget *widget)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:14:55 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.