# HG changeset patch # User Goffi # Date 1576841284 -3600 # Node ID d909473a76ccda488b8b76c9d2071b306f3bdfbd # Parent 9464ad3b2eceaf3c84beddb11ecb2a4c3900e67a jp (xmlui_manager): use level for notes: display notes in specific colors according to level, and use stderr for warnings and errors. diff -r 9464ad3b2ece -r d909473a76cc sat_frontends/jp/xmlui_manager.py --- a/sat_frontends/jp/xmlui_manager.py Fri Dec 20 12:28:04 2019 +0100 +++ b/sat_frontends/jp/xmlui_manager.py Fri Dec 20 12:28:04 2019 +0100 @@ -444,8 +444,15 @@ self.title, self.message, self.level = title, message, level async def show(self): - # TODO: handle title and level - self.disp(self.message) + # TODO: handle title + error = self.level in (C.XMLUI_DATA_LVL_WARNING, C.XMLUI_DATA_LVL_ERROR) + if self.level == C.XMLUI_DATA_LVL_WARNING: + msg = A.color(C.A_WARNING, self.message) + elif self.level == C.XMLUI_DATA_LVL_ERROR: + msg = A.color(C.A_FAILURE, self.message) + else: + msg = self.message + self.disp(msg, error=error) class ConfirmDialog(xmlui_base.ConfirmDialog, Dialog):