diff --git a/default.py b/default.py index 3ad6fdd..cf46179 100644 --- a/default.py +++ b/default.py @@ -75,9 +75,8 @@ if(mode == -1): # figure out if this is a backup or a restore from the user 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): - backup = XbmcBackup() if(mode == SETTINGS): # open the settings dialog @@ -99,9 +98,11 @@ if(mode != -1): editor = AdvancedBackupEditor() editor.copySimpleConfig() - elif(backup.remoteConfigured()): + elif(mode == BACKUP or mode == RESTORE): + backup = XbmcBackup() + # if mode was RESTORE - if(mode == RESTORE): + if(mode == RESTORE and backup.remoteConfigured()): # get list of valid restore points restorePoints = backup.listBackups() pointNames = [] @@ -133,10 +134,12 @@ if(mode != -1): backup.restore(selectedSets=params['sets'].split('|')) else: backup.restore() - else: + elif(mode == BACKUP and backup.remoteConfigured()): # mode was BACKUP backup.backup() + else: + # can't go any further + xbmcgui.Dialog().ok(utils.getString(30010), utils.getString(30045)) + utils.openSettings() else: - # can't go any further - xbmcgui.Dialog().ok(utils.getString(30010), utils.getString(30045)) - utils.openSettings() + xbmcgui.Dialog().ok(utils.getString(30010), "%s %s" % (utils.getString(30159), params['mode'])) diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index d146b24..04bb526 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -617,3 +617,7 @@ msgstr "" msgctxt "#30158" msgid "Run backup on daily, weekly, monthly, or custom schedule" msgstr "" + +msgctxt "#30159" +msgid "Backup started with unknown mode" +msgstr ""