From 45a9b5f6156099e25499d3951cf5107e5a9cd7f7 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Wed, 23 May 2012 23:02:34 +0200 Subject: [PATCH] clean ups --- openlp/core/lib/renderer.py | 10 +++++++--- openlp/core/ui/thememanager.py | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index 50ede0eac..268571f7b 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -93,7 +93,7 @@ class Renderer(object): self.display.setup() self._calculate_default() - def update_theme(self, theme_name, old_theme_name=None): + def update_theme(self, theme_name, old_theme_name=None, only_delete=False): """ This method updates the theme in ``_theme_dimensions`` when a theme has been edited or renamed. @@ -104,13 +104,17 @@ class Renderer(object): ``old_theme_name`` The old theme name. Has only to be passed, when the theme has been renamed. Defaults to *None*. + + ``only_delete`` + a """ if old_theme_name is not None and \ old_theme_name in self._theme_dimensions: del self._theme_dimensions[old_theme_name] if theme_name in self._theme_dimensions: del self._theme_dimensions[theme_name] - self._set_theme(theme_name) + if not only_delete: + self._set_theme(theme_name) def _set_theme(self, theme_name): """ @@ -233,7 +237,7 @@ class Renderer(object): self.imageManager.add_image(theme_data.theme_name, theme_data.background_filename, u'theme', QtGui.QColor(theme_data.background_border_color)) - theme_data, main, footer = self.post_render(theme_data) + theme_data, main, footer = self.pre_render(theme_data) serviceItem.themedata = theme_data serviceItem.main = main serviceItem.footer = footer diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 075cd80ac..4200babf7 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -349,6 +349,7 @@ class ThemeManager(QtGui.QWidget): # As we do not reload the themes, push out the change. Reload the # list as the internal lists and events need to be triggered. self._pushThemes() + self.mainwindow.renderer.update_theme(theme, only_delete=True) def deleteTheme(self, theme): """ @@ -668,7 +669,6 @@ class ThemeManager(QtGui.QWidget): u'theme', QtGui.QColor(theme.background_border_color)) self.mainwindow.imageManager.process_updates() self.loadThemes() - #self.mainwindow.renderer.update_theme() def _writeTheme(self, theme, image_from, image_to): """