Fix theme handling

This commit is contained in:
Tim Bentley 2013-03-12 09:09:42 +00:00
parent 762a99dd66
commit 7efe1320fb
3 changed files with 7 additions and 6 deletions

View File

@ -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()

View File

@ -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):
"""

View File

@ -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):
"""