Fix multi-line text in progress dialog (#21)

This commit is contained in:
mediaminister 2020-04-17 08:33:20 +00:00 committed by GitHub
parent 74769ffc47
commit 40af262ae6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)