forked from openlp/openlp
Fix theme handling
This commit is contained in:
parent
762a99dd66
commit
7efe1320fb
@ -653,9 +653,9 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||||||
self.activePlugin.app_startup()
|
self.activePlugin.app_startup()
|
||||||
else:
|
else:
|
||||||
self.activePlugin.toggleStatus(PluginStatus.Inactive)
|
self.activePlugin.toggleStatus(PluginStatus.Inactive)
|
||||||
self.themeManagerContents.change_global_from_tab()
|
# Set global theme and
|
||||||
self.themeManagerContents.load_themes(True)
|
|
||||||
Registry().execute(u'theme_update_global', self.themeManagerContents.global_theme)
|
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.
|
# Check if any Bibles downloaded. If there are, they will be processed.
|
||||||
Registry().execute(u'bibles_load_list', True)
|
Registry().execute(u'bibles_load_list', True)
|
||||||
self.application.set_normal_cursor()
|
self.application.set_normal_cursor()
|
||||||
|
@ -60,6 +60,7 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
QtGui.QWidget.__init__(self, parent)
|
QtGui.QWidget.__init__(self, parent)
|
||||||
Registry().register(u'theme_manager', self)
|
Registry().register(u'theme_manager', self)
|
||||||
Registry().register_function(u'bootstrap_initialise', self.load_first_time_themes)
|
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.settingsSection = u'themes'
|
||||||
self.themeForm = ThemeForm(self)
|
self.themeForm = ThemeForm(self)
|
||||||
self.fileRenameForm = FileRenameForm()
|
self.fileRenameForm = FileRenameForm()
|
||||||
@ -142,7 +143,7 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
self.oldBackgroundImage = None
|
self.oldBackgroundImage = None
|
||||||
self.badV1NameChars = re.compile(r'[%+\[\]]')
|
self.badV1NameChars = re.compile(r'[%+\[\]]')
|
||||||
# Last little bits of setting up
|
# 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):
|
def check_list_state(self, item):
|
||||||
"""
|
"""
|
||||||
|
@ -49,8 +49,8 @@ class TestSettingsForm(TestCase):
|
|||||||
|
|
||||||
# WHEN displaying the UI and pressing cancel
|
# WHEN displaying the UI and pressing cancel
|
||||||
with patch(u'PyQt4.QtGui.QDialog.reject') as mocked_reject:
|
with patch(u'PyQt4.QtGui.QDialog.reject') as mocked_reject:
|
||||||
okWidget = self.form.button_box.button(self.form.button_box.Cancel)
|
cancelWidget = self.form.button_box.button(self.form.button_box.Cancel)
|
||||||
QtTest.QTest.mouseClick(okWidget, QtCore.Qt.LeftButton)
|
QtTest.QTest.mouseClick(cancelWidget, QtCore.Qt.LeftButton)
|
||||||
|
|
||||||
# THEN the dialog reject should have been called
|
# THEN the dialog reject should have been called
|
||||||
assert mocked_reject.call_count == 1, u'The QDialog.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)
|
QtTest.QTest.mouseClick(okWidget, QtCore.Qt.LeftButton)
|
||||||
|
|
||||||
# THEN the processing stack should be empty
|
# 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):
|
def register_multiple_functions_test(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user