def doScheduledBackup(self, progress_mode): if (progress_mode != 2): utils.showNotification(utils.getString(30053)) backup = XbmcBackup() if (backup.remoteConfigured()): if (utils.getSettingInt('progress_mode') in [0, 1]): backup.backup(True) else: backup.backup(False) # check if this is a "one-off" if (utils.getSettingInt("schedule_interval") == 0): # disable the scheduler after this run self.enabled = False utils.setSetting('enable_scheduler', 'false') else: utils.showNotification(utils.getString(30045))
if ("archive" in params): # check that the user give archive exists if (params['archive'] in folderNames): # set the index selectedRestore = folderNames.index(params['archive']) utils.log(str(selectedRestore) + " : " + params['archive']) else: utils.showNotification(utils.getString(30045)) utils.log(params['archive'] + ' is not a valid restore point') else: # allow user to select the backup to restore from selectedRestore = xbmcgui.Dialog().select( utils.getString(30010) + " - " + utils.getString(30021), pointNames) if (selectedRestore != -1): backup.selectRestore(restorePoints[selectedRestore][0]) if ('sets' in params): backup.restore(selectedSets=params['sets'].split('|')) else: backup.restore() else: backup.backup() else: # can't go any further xbmcgui.Dialog().ok(utils.getString(30010), utils.getString(30045)) utils.openSettings()