From 090842b03cc1b17b6eb0aeef5e93bb7fbdfea0ab Mon Sep 17 00:00:00 2001 From: Rob Weber Date: Thu, 25 Jan 2024 09:13:02 -0600 Subject: [PATCH] prompt to close Kodi when restore completes closes #228 --- changelog.md | 3 ++- resources/language/resource.language.en_gb/strings.po | 2 +- resources/lib/backup.py | 9 ++++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/changelog.md b/changelog.md index 40b8929..8641ddd 100644 --- a/changelog.md +++ b/changelog.md @@ -10,6 +10,7 @@ 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 @@ -17,7 +18,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - 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 diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index 2b1f06c..39eee0a 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -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" diff --git a/resources/lib/backup.py b/resources/lib/backup.py index 471a9e7..0be8b90 100644 --- a/resources/lib/backup.py +++ b/resources/lib/backup.py @@ -285,7 +285,9 @@ class XbmcBackup: 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 @@ -347,6 +349,11 @@ class XbmcBackup: # 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)