From 79e7e09d65ac5a1ceb1e1e3b10abf645647109a0 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 19 Apr 2009 19:17:17 +0100 Subject: [PATCH] Add theme delete functionality --- openlp/core/ui/thememanager.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 21e15f3db..e5d77970e 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -20,6 +20,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA import os,os.path import sys import zipfile +import shutil from time import sleep from copy import deepcopy @@ -198,7 +199,19 @@ class ThemeManager(QWidget): self.amendThemeForm.exec_() def onDeleteTheme(self): - pass + items = self.ThemeListView.selectedIndexes() + theme = '' + for item in items: + data = self.Theme_data.getValue(item) + theme = data[3] + th = theme + u'.png' + try: + os.remove(os.path.join(self.path, th)) + except: + pass #if not present do not worry + shutil.rmtree(os.path.join(self.path, theme)) + self.Theme_data.clearItems() + self.loadThemes() def onExportTheme(self): pass