summaryrefslogtreecommitdiff
path: root/poezio/core
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2021-04-15 18:44:22 +0200
committermathieui <mathieui@mathieui.net>2021-04-15 18:44:22 +0200
commita17e5a456b9bf1a949d9ed1d0d1df90013c69e6d (patch)
treecff15b765af64f8aed4ed860580a2c7d26c9bd38 /poezio/core
parent56bab711924cd7a660c874abf40fd545693f8d98 (diff)
downloadpoezio-a17e5a456b9bf1a949d9ed1d0d1df90013c69e6d.tar.gz
poezio-a17e5a456b9bf1a949d9ed1d0d1df90013c69e6d.tar.bz2
poezio-a17e5a456b9bf1a949d9ed1d0d1df90013c69e6d.tar.xz
poezio-a17e5a456b9bf1a949d9ed1d0d1df90013c69e6d.zip
internal: add a different class for UI messages
Diffstat (limited to 'poezio/core')
-rw-r--r--poezio/core/core.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/poezio/core/core.py b/poezio/core/core.py
index a940e142..9fa003b6 100644
--- a/poezio/core/core.py
+++ b/poezio/core/core.py
@@ -75,6 +75,7 @@ from poezio.core.structs import (
from poezio.ui.types import (
Message,
PersistentInfoMessage,
+ UIMessage,
)
log = logging.getLogger(__name__)
@@ -1381,13 +1382,10 @@ class Core:
'Did not show the message:\n\t%s> %s \n\tdue to filter_info_messages configuration',
typ, msg)
return False
- colors = get_theme().INFO_COLORS
- color = colors.get(typ.lower(), colors.get('default', None))
nb_lines = self.information_buffer.add_message(
- Message(
+ UIMessage(
txt=msg,
- nickname=typ,
- nick_color=color
+ level=typ,
)
)
popup_on = config.getlist('information_buffer_popup_on')
@@ -1763,11 +1761,9 @@ class Core:
return
error_message = get_error_message(error)
tab.add_message(
- Message(
+ UIMessage(
error_message,
- highlight=True,
- nickname='Error',
- nick_color=get_theme().COLOR_ERROR_MSG,
+ level='Error',
),
)
code = error['error']['code']