9#include <QtCore/QString>
12#include <QtGui/QStandardItem>
13#include <QtGui/QStandardItemModel>
14#include <QtWidgets/QListView>
15#include <QtWidgets/QTextEdit>
16#include <QtWidgets/QVBoxLayout>
22 m_dataModel(dataModel)
24 m_list =
new QStandardItemModel(
this);
36 case SuperfluousAccelerator:
37 addError(model, tr(
"Accelerator possibly superfluous in translation."));
39 case MissingAccelerator:
40 addError(model, tr(
"Accelerator possibly missing in translation."));
42 case SurroundingWhitespaceDiffers:
43 addError(model, tr(
"Translation does not have same leading and trailing whitespace as the source text."));
45 case PunctuationDiffers:
46 addError(model, tr(
"Translation does not end with the same punctuation as the source text."));
48 case IgnoredPhrasebook:
49 addError(model, tr(
"A phrase book suggestion for '%1' was ignored.").arg(arg));
51 case PlaceMarkersDiffer:
52 addError(model, tr(
"Translation does not refer to the same place markers as in the source text."));
54 case NumerusMarkerMissing:
55 addError(model, tr(
"Translation does not contain the necessary %n/%Ln place marker."));
58 addError(model, tr(
"Unknown error"));
65 return (m_list->rowCount() == 0) ? QString() : m_list->item(0)->text();
68void ErrorsView::addError(
int model,
const QString &error)
71 static QLatin1String imageLocation(
":/images/s_check_danger.png");
72 static QPixmap image(imageLocation);
73 static QIcon pxDanger(image);
76 lang = m_dataModel
->model(model
)->localizedLanguage() + QLatin1String(
": ");
77 QStandardItem *item =
new QStandardItem(pxDanger, lang + error);
78 item->setEditable(
false);
79 m_list->appendRow(QList<QStandardItem*>() << item);
void addError(int model, const ErrorType type, const QString &arg=QString())
Combined button and popup list for selecting options.