Libksieve

sieveinfowidget.cpp
1 /*
2  SPDX-FileCopyrightText: 2013-2021 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-only
5 */
6 
7 #include "sieveinfowidget.h"
8 
9 #include <KLocalizedString>
10 
11 #include <QHBoxLayout>
12 #include <QTextEdit>
13 
14 using namespace KSieveUi;
15 SieveInfoWidget::SieveInfoWidget(QWidget *parent)
16  : QWidget(parent)
17  , mInfo(new QTextEdit(this))
18 {
19  auto lay = new QHBoxLayout(this);
20  lay->setContentsMargins({});
21  mInfo->setReadOnly(true);
22  mInfo->setAcceptRichText(true);
23  lay->addWidget(mInfo);
24 }
25 
26 SieveInfoWidget::~SieveInfoWidget()
27 {
28 }
29 
30 void SieveInfoWidget::setServerInfo(QStringList serverInfos)
31 {
32  serverInfos.sort();
33  QString result = QLatin1String("<qt><b>") + i18n("Sieve server supports:") + QLatin1String("</b><ul>");
34  for (const QString &info : qAsConst(serverInfos)) {
35  result += QLatin1String("<li>") + info;
36  }
37  result += QLatin1String("</ul></qt>");
38  mInfo->setHtml(result);
39 }
QString i18n(const char *text, const TYPE &arg...)
void sort(Qt::CaseSensitivity cs)
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Fri Apr 16 2021 23:09:34 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.