From 23d71700aa2b32d1390cc51c4ed284a1191d5f90 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Mon, 3 Jan 2011 19:47:14 +0000 Subject: [PATCH] Theme handling changes --- openlp.pyw | 6 +++--- openlp/core/ui/themeform.py | 16 +++++++++------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/openlp.pyw b/openlp.pyw index d5975b1a4..bc08940bb 100755 --- a/openlp.pyw +++ b/openlp.pyw @@ -150,9 +150,9 @@ class OpenLP(QtGui.QApplication): log.info(u'Openlp version %s' % app_version[u'version']) return app_version - def notify(self, obj, evt): - #TODO needed for presentation exceptions - return QtGui.QApplication.notify(self, obj, evt) +# def notify(self, obj, evt): +# #TODO needed for presentation exceptions +# return QtGui.QApplication.notify(self, obj, evt) def run(self): """ diff --git a/openlp/core/ui/themeform.py b/openlp/core/ui/themeform.py index e0b522947..f5b119fa8 100644 --- a/openlp/core/ui/themeform.py +++ b/openlp/core/ui/themeform.py @@ -291,9 +291,10 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): self.updateThemeAllowed = True self.themeNameLabel.setVisible(not edit) self.themeNameEdit.setVisible(not edit) + self.edit = edit if edit: self.setWindowTitle(unicode(translate('OpenLP.ThemeWizard', - 'Edit Theme %s')) % self.theme.theme_name) + 'Edit Theme - %s')) % self.theme.theme_name) self.next() else: self.setWindowTitle(translate('OpenLP.ThemeWizard', 'New Theme')) @@ -586,12 +587,13 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): filename = \ os.path.split(unicode(self.theme.background_filename))[1] saveTo = os.path.join(self.path, self.theme.theme_name, filename) - saveFrom = self.theme.background_filename# - if self.thememanager.checkIfThemeExists(self.theme.theme_name): - self.thememanager.saveTheme(self.theme, saveFrom, saveTo) - self.accepted = True - return QtGui.QDialog.accept(self) - return + saveFrom = self.theme.background_filename + if not self.edit: + if not self.thememanager.checkIfThemeExists(self.theme.theme_name): + return + self.accepted = True + self.thememanager.saveTheme(self.theme, saveFrom, saveTo) + return QtGui.QDialog.accept(self) def _colorButton(self, field): """