More encoding fixes for dialogs

This commit is contained in:
tomkat83 2016-03-07 13:38:45 +01:00
parent 4996d7122f
commit 398ef64d96
7 changed files with 27 additions and 24 deletions

View file

@ -162,7 +162,8 @@ class Artwork():
import xbmcaddon
string = xbmcaddon.Addon().getLocalizedString
if not xbmcgui.Dialog().yesno("Image Texture Cache", string(39250)):
if not xbmcgui.Dialog().yesno(
"Image Texture Cache", string(39250).encode('utf-8')):
return
self.logMsg("Doing Image Cache Sync", 1)
@ -171,7 +172,8 @@ class Artwork():
dialog.create("Emby for Kodi", "Image Cache Sync")
# ask to rest all existing or not
if xbmcgui.Dialog().yesno("Image Texture Cache", string(39251), ""):
if xbmcgui.Dialog().yesno(
"Image Texture Cache", string(39251).encode('utf-8'), ""):
self.logMsg("Resetting all cache data first", 1)
# Remove all existing textures first
path = xbmc.translatePath("special://thumbnails/").decode('utf-8')

View file

@ -156,7 +156,7 @@ def resetAuth():
string = xbmcaddon.Addon().getLocalizedString
resp = xbmcgui.Dialog().yesno(
heading="Warning",
line1=string(39206))
line1=string(39206).encode('utf-8'))
if resp == 1:
utils.logMsg("PLEX", "Reset login attempts.", 1)
utils.window('emby_serverStatus', value="Auth")
@ -226,14 +226,14 @@ def resetDeviceId():
"Failed to generate a new device Id: %s" % e, 1)
dialog.ok(
heading=addonName,
line1=language(33032))
line1=language(33032).encode('utf-8'))
else:
utils.logMsg(addonName,
"Successfully removed old deviceId: %s New deviceId: %s"
% (deviceId_old, deviceId), 1)
dialog.ok(
heading=addonName,
line1=language(33033))
line1=language(33033).encode('utf-8'))
xbmc.executebuiltin('RestartApp')
##### ADD ADDITIONAL USERS #####
@ -1160,6 +1160,6 @@ def RunLibScan(mode):
# Server is not online, do not run the sync
string = xbmcaddon.Addon().getLocalizedString
xbmcgui.Dialog().ok(heading=addonName,
line1=string(39205))
line1=string(39205).encode('utf-8'))
else:
utils.window('plex_runLibScan', value='full')

View file

@ -164,10 +164,10 @@ class ThreadedShowSyncInfo(Thread):
threadStopped = self.threadStopped
downloadLock = self.locks[0]
processLock = self.locks[1]
dialog.create("%s: Sync %s: %s items"
% (self.addonName.encode('utf-8'),
self.itemType.encode('utf-8'),
str(total)),
dialog.create(("%s: Sync %s: %s items"
% (self.addonName,
self.itemType,
str(total))).encode('utf-8'),
"Starting")
global getMetadataCount
global processMetadataCount
@ -188,9 +188,9 @@ class ThreadedShowSyncInfo(Thread):
try:
dialog.update(
percentage,
message="Downloaded: %s. Processed: %s: %s"
message=("Downloaded: %s. Processed: %s: %s"
% (getMetadataProgress, processMetadataProgress,
viewName.decode('utf-8')))
viewName))).encode('utf-8')
except:
# Wierd formating of the string viewName?!?
pass
@ -236,7 +236,7 @@ class LibrarySync(Thread):
return
xbmcgui.Dialog().notification(
heading=self.addonName,
message=message,
message=message.encode('utf-8'),
icon="special://home/addons/plugin.video.plexkodiconnect/icon.png",
sound=False)

View file

@ -523,7 +523,10 @@ class Player(xbmc.Player):
# Plex: never delete
offerDelete = False
if percentComplete >= markPlayedAt and offerDelete:
resp = xbmcgui.Dialog().yesno(lang(30091), lang(33015), autoclose=120000)
resp = xbmcgui.Dialog().yesno(
lang(30091).encode('utf-8'),
lang(33015).encode('utf-8'),
autoclose=120000)
if not resp:
log("User skipped deletion.", 1)
continue

View file

@ -8,7 +8,6 @@ from urllib import urlencode
import xbmc
import xbmcgui
import playbackutils
import embydb_functions as embydb
import read_embyserver as embyserver
import utils

View file

@ -343,7 +343,7 @@ class PlayUtils():
#audioStreamsChannelsList[audioNum] = stream.attrib['channels']
audioStreamsList.append(index)
audioStreams.append(track)
audioStreams.append(track.encode('utf-8'))
audioNum += 1
# Subtitles
@ -367,11 +367,11 @@ class PlayUtils():
downloadableStreams.append(index)
subtitleStreamsList.append(index)
subtitleStreams.append(track)
subtitleStreams.append(track.encode('utf-8'))
subNum += 1
if audioNum > 1:
resp = dialog.select(lang(33013), audioStreams)
resp = dialog.select(lang(33013).encode('utf-8'), audioStreams)
if resp > -1:
# User selected audio
playurlprefs['audioStreamID'] = audioStreamsList[resp]
@ -384,7 +384,7 @@ class PlayUtils():
playurlprefs['audioBoost'] = utils.settings('audioBoost')
if subNum > 1:
resp = dialog.select(lang(33014), subtitleStreams)
resp = dialog.select(lang(33014).encode('utf-8'), subtitleStreams)
if resp == 0:
# User selected no subtitles
playurlprefs["skipSubtitles"] = 1

View file

@ -171,9 +171,8 @@ class Service():
self.welcome_msg = False
xbmcgui.Dialog().notification(
heading=self.addonName,
message=("%s %s"
% (lang(33000).encode('utf-8'),
user.currUser.encode('utf-8'))),
message=("%s %s" % (lang(33000), user.currUser)
).encode('utf-8'),
icon="special://home/addons/plugin.video.plexkodiconnect/icon.png",
time=2000,
sound=False)
@ -227,7 +226,7 @@ class Service():
xbmcgui.Dialog().notification(
heading=lang(33001).encode('utf-8'),
message="%s %s" % (self.addonName, lang(33002).encode('utf-8')),
message=("%s %s" % (self.addonName, lang(33002))).encode('utf-8'),
icon="special://home/addons/plugin.video."
"plexkodiconnect/icon.png",
sound=False)