Skip to content

Commit

Permalink
prompt to close Kodi when restore completes
Browse files Browse the repository at this point in the history
closes #228
  • Loading branch information
robweber committed Jan 25, 2024
1 parent f6fae17 commit 090842b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

- You can now append a suffix to the end of each backup name (folder or zip file). This is only available in the Advanced or Expert settings.
- validation file now saves a list of all installed addons and versions
- prompt to close Kodi at the end of successful restore

### Changed

- added new line between file size and file name, was unreadable on some systems due to string resizing
- modified GitHub issue template slightly
- translations sync
- token files are stored in a `.json` instead of a `.txt` file
- file discovery process now flags directories with an `is_dir` metadata property instead of prefixing with a dash (-). This was done for legacy reasons and there is no reason for it.
- file discovery process now flags directories with an `is_dir` metadata property instead of prefixing with a dash (-). This was done for legacy reasons and there is no reason for it.

### Fixed

Expand Down
2 changes: 1 addition & 1 deletion resources/language/resource.language.en_gb/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ msgid "Restart Kodi"
msgstr ""

msgctxt "#30078"
msgid "You should restart Kodi to continue"
msgid "A restart is recommended, select Yes to close Kodi"
msgstr ""

msgctxt "#30079"
Expand Down
9 changes: 8 additions & 1 deletion resources/lib/backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,9 @@ def restore(self, progressOverride=False, selectedSets=None):
self._createResumeBackupFile()

# do not continue running
xbmcgui.Dialog().ok(utils.getString(30077), utils.getString(30078))
if(xbmcgui.Dialog().yesno(utils.getString(30077), utils.getString(30078), autoclose=15000)):
xbmc.executebuiltin('Quit')

return

# check if settings should be restored from this backup
Expand Down Expand Up @@ -347,6 +349,11 @@ def restore(self, progressOverride=False, selectedSets=None):
# call update addons to refresh everything
xbmc.executebuiltin('UpdateLocalAddons')

# notify user that restart is recommended
if(xbmcgui.Dialog().yesno(utils.getString(30077), utils.getString(30078), autoclose=15000)):
xbmc.executebuiltin('Quit')


def _setupVFS(self, mode=-1, progressOverride=False):
# set windows setting to true
window = xbmcgui.Window(10000)
Expand Down

0 comments on commit 090842b

Please sign in to comment.