diff --git a/openlp/core/ui/themeprogressform.py b/openlp/core/ui/themeprogressform.py index 634eb9cb6..0ce5cbc6c 100644 --- a/openlp/core/ui/themeprogressform.py +++ b/openlp/core/ui/themeprogressform.py @@ -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) diff --git a/tests/openlp_core/ui/test_themeprogressform.py b/tests/openlp_core/ui/test_themeprogressform.py index dfb91f496..a6b62cda8 100644 --- a/tests/openlp_core/ui/test_themeprogressform.py +++ b/tests/openlp_core/ui/test_themeprogressform.py @@ -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