From 40af262ae62cefcb5e913e74a1850a87ff6551a4 Mon Sep 17 00:00:00 2001 From: mediaminister <45148099+mediaminister@users.noreply.github.com> Date: Fri, 17 Apr 2020 08:33:20 +0000 Subject: [PATCH] Fix multi-line text in progress dialog (#21) --- resources/lib/kodiutils.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/resources/lib/kodiutils.py b/resources/lib/kodiutils.py index 7203598..170efbe 100644 --- a/resources/lib/kodiutils.py +++ b/resources/lib/kodiutils.py @@ -264,13 +264,17 @@ class progress(xbmcgui.DialogProgress, object): # pylint: disable=invalid-name, def create(self, heading, message=''): # pylint: disable=arguments-differ """Create and show a progress dialog""" if kodi_version_major() < 19: - return super(progress, self).create(heading, line1=message) + lines = message.split('\n', 2) + line1, line2, line3 = (lines + [None] * (3-len(lines))) + return super(progress, self).create(heading, line1=line1, line2=line2, line3=line3) return super(progress, self).create(heading, message=message) def update(self, percent, message=''): # pylint: disable=arguments-differ """Update the progress dialog""" if kodi_version_major() < 19: - return super(progress, self).update(percent, line1=message) + lines = message.split('\n', 2) + line1, line2, line3 = (lines + [None] * (3-len(lines))) + return super(progress, self).update(percent, line1=line1, line2=line2, line3=line3) return super(progress, self).update(percent, message=message)