← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~googol/openlp/bug-1046508 into lp:openlp

 

Andreas Preikschat has proposed merging lp:~googol/openlp/bug-1046508 into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)
Related bugs:
  Bug #1046508 in OpenLP: "OSError on changing theme background image"
  https://bugs.launchpad.net/openlp/+bug/1046508

For more details, see:
https://code.launchpad.net/~googol/openlp/bug-1046508/+merge/123009

Hello,

fixed #1046508 (OSError on changing theme background image)

We have to make sure that we inform the components after the theme update and not before.
-- 
https://code.launchpad.net/~googol/openlp/bug-1046508/+merge/123009
Your team OpenLP Core is requested to review the proposed merge of lp:~googol/openlp/bug-1046508 into lp:openlp.
=== modified file 'openlp/core/ui/thememanager.py'
--- openlp/core/ui/thememanager.py	2012-08-27 19:04:53 +0000
+++ openlp/core/ui/thememanager.py	2012-09-06 05:22:19 +0000
@@ -281,9 +281,9 @@
                     for plugin in self.mainwindow.pluginManager.plugins:
                         if plugin.usesTheme(old_theme_name):
                             plugin.renameTheme(old_theme_name, new_theme_name)
-                    self.loadThemes()
                     self.mainwindow.renderer.update_theme(
                         new_theme_name, old_theme_name)
+                    self.loadThemes()
 
     def onCopyTheme(self):
         """
@@ -314,6 +314,7 @@
         theme_data.theme_name = new_theme_name
         theme_data.extend_image_filename(self.path)
         self.saveTheme(theme_data, save_from, save_to)
+        self.loadThemes()
 
     def onEditTheme(self):
         """
@@ -331,6 +332,7 @@
             self.themeForm.exec_(True)
             self.oldBackgroundImage = None
             self.mainwindow.renderer.update_theme(theme.theme_name)
+            self.loadThemes()
 
     def onDeleteTheme(self):
         """
@@ -345,10 +347,10 @@
             row = self.themeListWidget.row(item)
             self.themeListWidget.takeItem(row)
             self.deleteTheme(theme)
+            self.mainwindow.renderer.update_theme(theme, only_delete=True)
             # 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):
         """
@@ -672,7 +674,6 @@
                 theme.background_filename,
                 ImageSource.Theme, QtGui.QColor(theme.background_border_color))
             self.mainwindow.imageManager.processUpdates()
-        self.loadThemes()
 
     def _writeTheme(self, theme, image_from, image_to):
         """


Follow ups