Support for delete background images

main
Bob Mottram 2020-07-25 11:00:50 +01:00
parent 30dabd12a1
commit 6fdc7d6401
1 changed files with 16 additions and 0 deletions

View File

@ -596,6 +596,8 @@ def setThemeImages(baseDir: str, name: str) -> None:
baseDir + '/img/login-background.png' baseDir + '/img/login-background.png'
sharesBackgroundImageFilename = \ sharesBackgroundImageFilename = \
baseDir + '/img/shares-background.png' baseDir + '/img/shares-background.png'
deleteBackgroundImageFilename = \
baseDir + '/img/delete-background.png'
profileImageFilename = \ profileImageFilename = \
baseDir + '/img/image.png' baseDir + '/img/image.png'
bannerFilename = \ bannerFilename = \
@ -607,6 +609,8 @@ def setThemeImages(baseDir: str, name: str) -> None:
baseDir + '/img/login_background_' + themeNameLower + '.png' baseDir + '/img/login_background_' + themeNameLower + '.png'
sharesBackgroundImageFilename = \ sharesBackgroundImageFilename = \
baseDir + '/img/shares_background_' + themeNameLower + '.png' baseDir + '/img/shares_background_' + themeNameLower + '.png'
deleteBackgroundImageFilename = \
baseDir + '/img/delete_background_' + themeNameLower + '.png'
profileImageFilename = \ profileImageFilename = \
baseDir + '/img/image_' + themeNameLower + '.png' baseDir + '/img/image_' + themeNameLower + '.png'
bannerFilename = \ bannerFilename = \
@ -648,6 +652,18 @@ def setThemeImages(baseDir: str, name: str) -> None:
except BaseException: except BaseException:
pass pass
if os.path.isfile(deleteBackgroundImageFilename):
try:
copyfile(deleteBackgroundImageFilename,
accountDir + '/delete-background.png')
except BaseException:
pass
elif os.path.isfile(accountDir + '/delete-background.png'):
try:
os.remove(accountDir + '/delete-background.png')
except BaseException:
pass
if os.path.isfile(profileImageFilename) and \ if os.path.isfile(profileImageFilename) and \
os.path.isfile(bannerFilename): os.path.isfile(bannerFilename):
try: try: