Move dialog instance

This commit is contained in:
croneter 2017-08-18 10:37:30 +02:00
parent b103309ceb
commit bc36750d52
2 changed files with 6 additions and 11 deletions

View file

@ -3,6 +3,7 @@ from logging import getLogger
from threading import Thread, Lock
from xbmc import sleep
from xbmcgui import DialogProgressBG
from utils import thread_methods, language as lang
@ -24,12 +25,11 @@ class Threaded_Show_Sync_Info(Thread):
Threaded class to show the Kodi statusbar of the metadata download.
Input:
dialog xbmcgui.DialogProgressBG() object to show progress
total: Total number of items to get
item_type:
"""
def __init__(self, dialog, total, item_type):
def __init__(self, total, item_type):
self.total = total
self.dialog = dialog
self.item_type = item_type
Thread.__init__(self)
@ -50,8 +50,8 @@ class Threaded_Show_Sync_Info(Thread):
"""
log.debug('Show sync info thread started')
# cache local variables because it's faster
total = self.total
dialog = self.dialog
total = self.totaltal
dialog = DialogProgressBG('dialoglogProgressBG')
thread_stopped = self.thread_stopped
dialog.create("%s %s: %s %s"
% (lang(39714), self.item_type, str(total), lang(39715)))

View file

@ -6,7 +6,6 @@ import Queue
from random import shuffle
import xbmc
import xbmcgui
from xbmcvfs import exists
from utils import window, settings, getUnixTimestamp, sourcesXML,\
@ -736,11 +735,7 @@ class LibrarySync(Thread):
threads.append(thread)
# Start one thread to show sync progress ONLY for new PMS items
if self.new_items_only is True and window('dbSyncIndicator') == 'true':
dialog = xbmcgui.DialogProgressBG()
thread = sync_info.Threaded_Show_Sync_Info(
dialog,
itemNumber,
itemType)
thread = sync_info.Threaded_Show_Sync_Info(itemNumber, itemType)
thread.setDaemon(True)
thread.start()
threads.append(thread)