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 import xbmcaddon
string = xbmcaddon.Addon().getLocalizedString 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 return
self.logMsg("Doing Image Cache Sync", 1) self.logMsg("Doing Image Cache Sync", 1)
@ -171,7 +172,8 @@ class Artwork():
dialog.create("Emby for Kodi", "Image Cache Sync") dialog.create("Emby for Kodi", "Image Cache Sync")
# ask to rest all existing or not # 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) self.logMsg("Resetting all cache data first", 1)
# Remove all existing textures first # Remove all existing textures first
path = xbmc.translatePath("special://thumbnails/").decode('utf-8') path = xbmc.translatePath("special://thumbnails/").decode('utf-8')

View file

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

View file

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

View file

@ -523,7 +523,10 @@ class Player(xbmc.Player):
# Plex: never delete # Plex: never delete
offerDelete = False offerDelete = False
if percentComplete >= markPlayedAt and offerDelete: 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: if not resp:
log("User skipped deletion.", 1) log("User skipped deletion.", 1)
continue continue

View file

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

View file

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

View file

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