Theme handling changes

This commit is contained in:
Tim Bentley 2011-01-03 19:47:14 +00:00
parent 3bb309e623
commit 23d71700aa
2 changed files with 12 additions and 10 deletions

View File

@ -150,9 +150,9 @@ class OpenLP(QtGui.QApplication):
log.info(u'Openlp version %s' % app_version[u'version']) log.info(u'Openlp version %s' % app_version[u'version'])
return app_version return app_version
def notify(self, obj, evt): # def notify(self, obj, evt):
#TODO needed for presentation exceptions # #TODO needed for presentation exceptions
return QtGui.QApplication.notify(self, obj, evt) # return QtGui.QApplication.notify(self, obj, evt)
def run(self): def run(self):
""" """

View File

@ -291,9 +291,10 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
self.updateThemeAllowed = True self.updateThemeAllowed = True
self.themeNameLabel.setVisible(not edit) self.themeNameLabel.setVisible(not edit)
self.themeNameEdit.setVisible(not edit) self.themeNameEdit.setVisible(not edit)
self.edit = edit
if edit: if edit:
self.setWindowTitle(unicode(translate('OpenLP.ThemeWizard', self.setWindowTitle(unicode(translate('OpenLP.ThemeWizard',
'Edit Theme %s')) % self.theme.theme_name) 'Edit Theme - %s')) % self.theme.theme_name)
self.next() self.next()
else: else:
self.setWindowTitle(translate('OpenLP.ThemeWizard', 'New Theme')) self.setWindowTitle(translate('OpenLP.ThemeWizard', 'New Theme'))
@ -586,12 +587,13 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
filename = \ filename = \
os.path.split(unicode(self.theme.background_filename))[1] os.path.split(unicode(self.theme.background_filename))[1]
saveTo = os.path.join(self.path, self.theme.theme_name, filename) saveTo = os.path.join(self.path, self.theme.theme_name, filename)
saveFrom = self.theme.background_filename# saveFrom = self.theme.background_filename
if self.thememanager.checkIfThemeExists(self.theme.theme_name): if not self.edit:
self.thememanager.saveTheme(self.theme, saveFrom, saveTo) if not self.thememanager.checkIfThemeExists(self.theme.theme_name):
self.accepted = True return
return QtGui.QDialog.accept(self) self.accepted = True
return self.thememanager.saveTheme(self.theme, saveFrom, saveTo)
return QtGui.QDialog.accept(self)
def _colorButton(self, field): def _colorButton(self, field):
""" """