diff options
author | mathieui <mathieui@mathieui.net> | 2021-04-15 18:44:22 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2021-04-15 18:44:22 +0200 |
commit | a17e5a456b9bf1a949d9ed1d0d1df90013c69e6d (patch) | |
tree | cff15b765af64f8aed4ed860580a2c7d26c9bd38 /poezio/core/core.py | |
parent | 56bab711924cd7a660c874abf40fd545693f8d98 (diff) | |
download | poezio-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/core.py')
-rw-r--r-- | poezio/core/core.py | 14 |
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'] |