mirror of
https://github.com/KDE/latte-dock.git
synced 2025-01-18 18:03:42 +03:00
add report error message for unknown screens
This commit is contained in:
parent
71e291ccec
commit
e41ed77ce6
@ -1431,6 +1431,8 @@ QString GenericLayout::reportHtml(const ScreenPool *screenPool)
|
|||||||
//! sort views data
|
//! sort views data
|
||||||
viewsData = sortedViewsData(viewsData);
|
viewsData = sortedViewsData(viewsData);
|
||||||
|
|
||||||
|
QStringList unknownScreens;
|
||||||
|
|
||||||
//! print viewData results
|
//! print viewData results
|
||||||
for (int i=0; i<viewsData.count(); ++i) {
|
for (int i=0; i<viewsData.count(); ++i) {
|
||||||
report += "<tr>";
|
report += "<tr>";
|
||||||
@ -1448,7 +1450,13 @@ QString GenericLayout::reportHtml(const ScreenPool *screenPool)
|
|||||||
screenStr = "<font color='green'>" + screenStr + "</font>";
|
screenStr = "<font color='green'>" + screenStr + "</font>";
|
||||||
}
|
}
|
||||||
if (!viewsData[i].onPrimary) {
|
if (!viewsData[i].onPrimary) {
|
||||||
screenStr = screenPool->connector(viewsData[i].screenId);
|
if (!screenPool->hasId(viewsData[i].screenId)) {
|
||||||
|
screenStr = "<font color='red'><i>[" + QString::number(viewsData[i].screenId) + "]</i></font>";
|
||||||
|
|
||||||
|
unknownScreens << QString("[" + QString::number(viewsData[i].screenId) + "]");
|
||||||
|
} else {
|
||||||
|
screenStr = screenPool->connector(viewsData[i].screenId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(viewsData[i].active) {
|
if(viewsData[i].active) {
|
||||||
screenStr = "<b>" + screenStr + "</b>";
|
screenStr = "<b>" + screenStr + "</b>";
|
||||||
@ -1489,15 +1497,22 @@ QString GenericLayout::reportHtml(const ScreenPool *screenPool)
|
|||||||
QStringList errorsList;
|
QStringList errorsList;
|
||||||
bool broken = m_storage->layoutIsBroken(errorsList);
|
bool broken = m_storage->layoutIsBroken(errorsList);
|
||||||
|
|
||||||
if (!broken) {
|
if (!broken && unknownScreens.count() == 0) {
|
||||||
report += "<font color='green'>" + i18n("No errors were identified for this layout...") + "</font><br/>";
|
report += "<font color='green'>" + i18n("No errors were identified for this layout...") + "</font><br/>";
|
||||||
} else {
|
} else {
|
||||||
report += "<font color='red'><b>" + i18n("Errors:") + "</b></font><br/>";
|
report += "<font color='red'><b>" + i18n("Errors:") + "</b></font><br/>";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (broken){
|
||||||
for(int i=0; i<errorsList.count(); ++i) {
|
for(int i=0; i<errorsList.count(); ++i) {
|
||||||
report += "<font color='red'><b>[" + QString::number(i) + "] - " + errorsList[i] + "</b></font><br/>";
|
report += "<font color='red'><b>[" + QString::number(i) + "] - " + errorsList[i] + "</b></font><br/>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (unknownScreens.count() > 0) {
|
||||||
|
report += "<font color='red'><b>" + i18n("Unknown screens: ") + unknownScreens.join(", ") + "</b></font><br/>";
|
||||||
|
}
|
||||||
|
|
||||||
return report;
|
return report;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user