diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index f36445d60..8aebda375 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -653,9 +653,9 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): self.activePlugin.app_startup() else: self.activePlugin.toggleStatus(PluginStatus.Inactive) - self.themeManagerContents.change_global_from_tab() - self.themeManagerContents.load_themes(True) + # Set global theme and Registry().execute(u'theme_update_global', self.themeManagerContents.global_theme) + self.themeManagerContents.load_first_time_themes() # Check if any Bibles downloaded. If there are, they will be processed. Registry().execute(u'bibles_load_list', True) self.application.set_normal_cursor() diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index a2a187465..a92e977f2 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -60,6 +60,7 @@ class ThemeManager(QtGui.QWidget): QtGui.QWidget.__init__(self, parent) Registry().register(u'theme_manager', self) Registry().register_function(u'bootstrap_initialise', self.load_first_time_themes) + Registry().register_function(u'bootstrap_post_set_up', self._push_themes) self.settingsSection = u'themes' self.themeForm = ThemeForm(self) self.fileRenameForm = FileRenameForm() @@ -142,7 +143,7 @@ class ThemeManager(QtGui.QWidget): self.oldBackgroundImage = None self.badV1NameChars = re.compile(r'[%+\[\]]') # Last little bits of setting up - self.change_global_from_tab() + self.global_theme = Settings().value(self.settingsSection + u'/global theme') def check_list_state(self, item): """ diff --git a/tests/interfaces/openlp_core_ui/test_settings_form.py b/tests/interfaces/openlp_core_ui/test_settings_form.py index 20955840b..679c62d6f 100644 --- a/tests/interfaces/openlp_core_ui/test_settings_form.py +++ b/tests/interfaces/openlp_core_ui/test_settings_form.py @@ -49,8 +49,8 @@ class TestSettingsForm(TestCase): # WHEN displaying the UI and pressing cancel with patch(u'PyQt4.QtGui.QDialog.reject') as mocked_reject: - okWidget = self.form.button_box.button(self.form.button_box.Cancel) - QtTest.QTest.mouseClick(okWidget, QtCore.Qt.LeftButton) + cancelWidget = self.form.button_box.button(self.form.button_box.Cancel) + QtTest.QTest.mouseClick(cancelWidget, QtCore.Qt.LeftButton) # THEN the dialog reject should have been called assert mocked_reject.call_count == 1, u'The QDialog.reject should have been called' @@ -82,7 +82,7 @@ class TestSettingsForm(TestCase): QtTest.QTest.mouseClick(okWidget, QtCore.Qt.LeftButton) # THEN the processing stack should be empty - assert len(self.form.processes) == 0, u'The one requested process should have been added to the stack' + assert len(self.form.processes) == 0, u'The one requested process should have been removed from the stack' def register_multiple_functions_test(self): """