mirror of
https://github.com/robweber/xbmcbackup.git
synced 2025-06-22 02:33:41 +02:00
added call to XbmcBackup.run() in service.py file
added showNotification() method so that a notification can display when backup starts via scheduler
This commit is contained in:
@ -106,9 +106,9 @@ class XbmcBackup:
|
||||
|
||||
utils.log(utils.getString(30046))
|
||||
|
||||
def run(self,mode=-1):
|
||||
def run(self,mode=-1,runSilent=False):
|
||||
#check if we should use the progress bar
|
||||
if(utils.getSetting('run_silent') == 'false'):
|
||||
if(utils.getSetting('run_silent') == 'false' and not runSilent):
|
||||
self.progressBar = xbmcgui.DialogProgress()
|
||||
self.progressBar.create(utils.getString(30010),utils.getString(30049) + "......")
|
||||
|
||||
@ -147,6 +147,9 @@ class XbmcBackup:
|
||||
self.restoreFiles()
|
||||
else:
|
||||
xbmcgui.Dialog().ok(utils.getString(30010),utils.getString(30045),self.remote_path)
|
||||
|
||||
if(utils.getSetting('run_silent') == 'false' and not runSilent):
|
||||
self.progressBar.close()
|
||||
|
||||
def syncFiles(self):
|
||||
|
||||
@ -188,9 +191,6 @@ class XbmcBackup:
|
||||
else:
|
||||
vfs.copy(xbmc.makeLegalFilename(source + aFile),xbmc.makeLegalFilename(dest + aFile,False))
|
||||
|
||||
if(utils.getSetting('run_silent') == 'false'):
|
||||
self.progressBar.close()
|
||||
|
||||
def updateProgress(self,message=''):
|
||||
self.filesLeft = self.filesLeft - 1
|
||||
|
||||
|
@ -8,6 +8,9 @@ __Addon = xbmcaddon.Addon(__addon_id__)
|
||||
def log(message,loglevel=xbmc.LOGNOTICE):
|
||||
xbmc.log(encode(__addon_id__ + ": " + message),level=loglevel)
|
||||
|
||||
def showNotification(message):
|
||||
xbmc.executebuiltin("Notification(" + getString(30010) + "," + message + ",4000," + xbmc.translatePath(__Addon.getAddonInfo('path') + "/icon.png") + ")")
|
||||
|
||||
def getSetting(name):
|
||||
return __Addon.getSetting(name)
|
||||
|
||||
|
Reference in New Issue
Block a user