forked from openlp/openlp
Add theme delete functionality
This commit is contained in:
parent
a02835f0f8
commit
79e7e09d65
@ -20,6 +20,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
import os,os.path
|
import os,os.path
|
||||||
import sys
|
import sys
|
||||||
import zipfile
|
import zipfile
|
||||||
|
import shutil
|
||||||
|
|
||||||
from time import sleep
|
from time import sleep
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
@ -198,7 +199,19 @@ class ThemeManager(QWidget):
|
|||||||
self.amendThemeForm.exec_()
|
self.amendThemeForm.exec_()
|
||||||
|
|
||||||
def onDeleteTheme(self):
|
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):
|
def onExportTheme(self):
|
||||||
pass
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user