This commit is contained in:
Rob Weber 2021-07-06 09:01:14 -05:00
parent 4c99f43340
commit 696e0773c3
2 changed files with 15 additions and 8 deletions

View File

@ -75,9 +75,8 @@ if(mode == -1):
# figure out if this is a backup or a restore from the user # figure out if this is a backup or a restore from the user
mode = xbmcgui.Dialog().select(utils.getString(30010) + " - " + utils.getString(30023), options) mode = xbmcgui.Dialog().select(utils.getString(30010) + " - " + utils.getString(30023), options)
# check if program should be run # check which mode should be run
if(mode != -1): if(mode != -1):
backup = XbmcBackup()
if(mode == SETTINGS): if(mode == SETTINGS):
# open the settings dialog # open the settings dialog
@ -99,9 +98,11 @@ if(mode != -1):
editor = AdvancedBackupEditor() editor = AdvancedBackupEditor()
editor.copySimpleConfig() editor.copySimpleConfig()
elif(backup.remoteConfigured()): elif(mode == BACKUP or mode == RESTORE):
backup = XbmcBackup()
# if mode was RESTORE # if mode was RESTORE
if(mode == RESTORE): if(mode == RESTORE and backup.remoteConfigured()):
# get list of valid restore points # get list of valid restore points
restorePoints = backup.listBackups() restorePoints = backup.listBackups()
pointNames = [] pointNames = []
@ -133,10 +134,12 @@ if(mode != -1):
backup.restore(selectedSets=params['sets'].split('|')) backup.restore(selectedSets=params['sets'].split('|'))
else: else:
backup.restore() backup.restore()
else: elif(mode == BACKUP and backup.remoteConfigured()):
# mode was BACKUP # mode was BACKUP
backup.backup() backup.backup()
else:
# can't go any further
xbmcgui.Dialog().ok(utils.getString(30010), utils.getString(30045))
utils.openSettings()
else: else:
# can't go any further xbmcgui.Dialog().ok(utils.getString(30010), "%s %s" % (utils.getString(30159), params['mode']))
xbmcgui.Dialog().ok(utils.getString(30010), utils.getString(30045))
utils.openSettings()

View File

@ -617,3 +617,7 @@ msgstr ""
msgctxt "#30158" msgctxt "#30158"
msgid "Run backup on daily, weekly, monthly, or custom schedule" msgid "Run backup on daily, weekly, monthly, or custom schedule"
msgstr "" msgstr ""
msgctxt "#30159"
msgid "Backup started with unknown mode"
msgstr ""