Fix multi-line text in progress dialog (#21)
This commit is contained in:
parent
74769ffc47
commit
40af262ae6
@ -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)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user