Move dialog instance
This commit is contained in:
parent
b103309ceb
commit
bc36750d52
2 changed files with 6 additions and 11 deletions
|
@ -3,6 +3,7 @@ from logging import getLogger
|
||||||
from threading import Thread, Lock
|
from threading import Thread, Lock
|
||||||
|
|
||||||
from xbmc import sleep
|
from xbmc import sleep
|
||||||
|
from xbmcgui import DialogProgressBG
|
||||||
|
|
||||||
from utils import thread_methods, language as lang
|
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.
|
Threaded class to show the Kodi statusbar of the metadata download.
|
||||||
|
|
||||||
Input:
|
Input:
|
||||||
dialog xbmcgui.DialogProgressBG() object to show progress
|
|
||||||
total: Total number of items to get
|
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.total = total
|
||||||
self.dialog = dialog
|
|
||||||
self.item_type = item_type
|
self.item_type = item_type
|
||||||
Thread.__init__(self)
|
Thread.__init__(self)
|
||||||
|
|
||||||
|
@ -50,8 +50,8 @@ class Threaded_Show_Sync_Info(Thread):
|
||||||
"""
|
"""
|
||||||
log.debug('Show sync info thread started')
|
log.debug('Show sync info thread started')
|
||||||
# cache local variables because it's faster
|
# cache local variables because it's faster
|
||||||
total = self.total
|
total = self.totaltal
|
||||||
dialog = self.dialog
|
dialog = DialogProgressBG('dialoglogProgressBG')
|
||||||
thread_stopped = self.thread_stopped
|
thread_stopped = self.thread_stopped
|
||||||
dialog.create("%s %s: %s %s"
|
dialog.create("%s %s: %s %s"
|
||||||
% (lang(39714), self.item_type, str(total), lang(39715)))
|
% (lang(39714), self.item_type, str(total), lang(39715)))
|
||||||
|
|
|
@ -6,7 +6,6 @@ import Queue
|
||||||
from random import shuffle
|
from random import shuffle
|
||||||
|
|
||||||
import xbmc
|
import xbmc
|
||||||
import xbmcgui
|
|
||||||
from xbmcvfs import exists
|
from xbmcvfs import exists
|
||||||
|
|
||||||
from utils import window, settings, getUnixTimestamp, sourcesXML,\
|
from utils import window, settings, getUnixTimestamp, sourcesXML,\
|
||||||
|
@ -736,11 +735,7 @@ class LibrarySync(Thread):
|
||||||
threads.append(thread)
|
threads.append(thread)
|
||||||
# Start one thread to show sync progress ONLY for new PMS items
|
# Start one thread to show sync progress ONLY for new PMS items
|
||||||
if self.new_items_only is True and window('dbSyncIndicator') == 'true':
|
if self.new_items_only is True and window('dbSyncIndicator') == 'true':
|
||||||
dialog = xbmcgui.DialogProgressBG()
|
thread = sync_info.Threaded_Show_Sync_Info(itemNumber, itemType)
|
||||||
thread = sync_info.Threaded_Show_Sync_Info(
|
|
||||||
dialog,
|
|
||||||
itemNumber,
|
|
||||||
itemType)
|
|
||||||
thread.setDaemon(True)
|
thread.setDaemon(True)
|
||||||
thread.start()
|
thread.start()
|
||||||
threads.append(thread)
|
threads.append(thread)
|
||||||
|
|
Loading…
Reference in a new issue