Merge branch 'fix-themeprogressform-progress-bar' into 'master'

ThemeProgressForm show progress

Closes #346

See merge request openlp/openlp!105
This commit is contained in:
Raoul Snyman 2019-12-19 15:25:05 +00:00
commit f4b2f5cc7e
2 changed files with 2 additions and 6 deletions

View File

@ -40,8 +40,6 @@ class ThemeProgressForm(QtWidgets.QDialog, UiThemeProgressDialog, RegistryProper
def show(self):
self.progress_bar.setValue(0)
self.progress_bar.setMinimum(0)
self.progress_bar.setMaximum(0)
try:
screens = ScreenList()
self.ratio = screens.current.display_geometry.width() / screens.current.display_geometry.height()
@ -64,6 +62,7 @@ class ThemeProgressForm(QtWidgets.QDialog, UiThemeProgressDialog, RegistryProper
def _set_theme_list(self, value):
"""Property setter"""
self._theme_list = value
self.progress_bar.setMinimum(0)
self.progress_bar.setMaximum(len(self._theme_list))
theme_list = property(_get_theme_list, _set_theme_list)

View File

@ -71,8 +71,6 @@ class TestThemeProgressForm(TestCase, TestMixin):
# THEN: The correct display ratio is calculated and the form is shown
expected_ratio = 16 / 9
form.progress_bar.setMinimum.assert_called_once_with(0)
form.progress_bar.setMaximum.assert_called_once_with(0)
form.progress_bar.setValue.assert_called_once_with(0)
assert form.ratio == expected_ratio
assert form.theme_preview_layout.aspect_ratio == expected_ratio
@ -96,8 +94,6 @@ class TestThemeProgressForm(TestCase, TestMixin):
# THEN: The correct display ratio is calculated and the form is shown
expected_ratio = 16 / 9
form.progress_bar.setMinimum.assert_called_once_with(0)
form.progress_bar.setMaximum.assert_called_once_with(0)
form.progress_bar.setValue.assert_called_once_with(0)
assert form.ratio == expected_ratio
assert form.theme_preview_layout.aspect_ratio == expected_ratio
@ -138,5 +134,6 @@ class TestThemeProgressForm(TestCase, TestMixin):
theme_list = form.theme_list
# THEN: The theme list should be correct
form.progress_bar.setMinimum.assert_called_once_with(0)
form.progress_bar.setMaximum.assert_called_once_with(2)
assert theme_list == test_theme_list