Commit dea8fc9a authored by Laurent Montel's avatar Laurent Montel 😁

Improve generate it

parent 2816178b
......@@ -34,20 +34,28 @@ SieveEditorEmptyTabWidgetLabel::~SieveEditorEmptyTabWidgetLabel()
void SieveEditorEmptyTabWidgetLabel::init()
{
//TODO improve text
const QString placeholderText = QStringLiteral("<html><body style=\"color:#909090; font-size:14px\">"
"<div align='center'>"
"<div style=\"font-size:20px\">%1</div>"
"<div></div>"
"<li>%2"
"<div style=\"font-size:20px\">%3</div>"
"<div></div>"
"<li>%4"
"<div style=\"font-size:20px\">%5</div>"
"<li>%6"
"<div></div>"
"</div>"
"</body></html>").arg(i18n("Debug a script:"), i18nc("These action in from menu tools submenu debug sieve script", "Tools > Debug Sieve Script"),
i18n("Create Rules Graphically:"), i18nc("Action is from menu tools, submenu autogenerate script", "Tools > Autogenerate script"),
i18n("Import script:"), i18nc("Action is from file menu, import submenu", "File > Import"));
QString placeholderText = QStringLiteral("<html><body style=\"color:#909090; font-size:14px\">"
"<div align='center'>");
const QMap<QString, QString> map = {
{i18n("Debug a script:"), i18nc("These action in from menu tools submenu debug sieve script", "Tools > Debug Sieve Script")}
, {i18n("Create Rules Graphically:"), i18nc("Action is from menu tools, submenu autogenerate script", "Tools > Autogenerate script")}
, {i18n("Import script:"), i18nc("Action is from file menu, import submenu", "File > Import")}
, {i18n("Import Sieve Settings"), i18nc("Action is from tools menu, import IMAP settings", "Tools > Import IMAP settings")}
};
addInfo(placeholderText, map);
placeholderText += QStringLiteral("<div></div>"
"</div>"
"</body></html>");
setText(placeholderText);
}
void SieveEditorEmptyTabWidgetLabel::addInfo(QString &placeholderText, const QMap<QString, QString> &map)
{
QMap<QString, QString>::const_iterator i = map.constBegin();
while (i != map.constEnd()) {
placeholderText += QStringLiteral("<div style=\"font-size:20px\">%1</div>"
"<div></div>"
"<li>%2").arg(i.key(), i.value());
++i;
}
}
......@@ -41,6 +41,7 @@
#define SIEVEEDITOREMPTYTABWIDGETLABEL_H
#include <QLabel>
#include <QMap>
class SieveEditorEmptyTabWidgetLabel : public QLabel
{
......@@ -50,6 +51,7 @@ public:
~SieveEditorEmptyTabWidgetLabel();
private:
void addInfo(QString &placeholderText, const QMap<QString, QString> &map);
void init();
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment