jp (xmlui_manager): use level for notes:
display notes in specific colors according to level, and use stderr for warnings and errors.
This commit is contained in:
parent
ef3bea43b8
commit
5c1dd0da49
1 changed files with 9 additions and 2 deletions
|
|
@ -444,8 +444,15 @@ class NoteDialog(xmlui_base.NoteDialog, Dialog):
|
|||
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):
|
||||
|
|
|
|||
Loading…
Reference in a new issue