forked from openlp/openlp
ThemeProgressForm show progress
This commit is contained in:
parent
37b631b187
commit
0d16ce667f
@ -40,8 +40,6 @@ class ThemeProgressForm(QtWidgets.QDialog, UiThemeProgressDialog, RegistryProper
|
|||||||
|
|
||||||
def show(self):
|
def show(self):
|
||||||
self.progress_bar.setValue(0)
|
self.progress_bar.setValue(0)
|
||||||
self.progress_bar.setMinimum(0)
|
|
||||||
self.progress_bar.setMaximum(0)
|
|
||||||
try:
|
try:
|
||||||
screens = ScreenList()
|
screens = ScreenList()
|
||||||
self.ratio = screens.current.display_geometry.width() / screens.current.display_geometry.height()
|
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):
|
def _set_theme_list(self, value):
|
||||||
"""Property setter"""
|
"""Property setter"""
|
||||||
self._theme_list = value
|
self._theme_list = value
|
||||||
|
self.progress_bar.setMinimum(0)
|
||||||
self.progress_bar.setMaximum(len(self._theme_list))
|
self.progress_bar.setMaximum(len(self._theme_list))
|
||||||
|
|
||||||
theme_list = property(_get_theme_list, _set_theme_list)
|
theme_list = property(_get_theme_list, _set_theme_list)
|
||||||
|
@ -71,8 +71,6 @@ class TestThemeProgressForm(TestCase, TestMixin):
|
|||||||
|
|
||||||
# THEN: The correct display ratio is calculated and the form is shown
|
# THEN: The correct display ratio is calculated and the form is shown
|
||||||
expected_ratio = 16 / 9
|
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)
|
form.progress_bar.setValue.assert_called_once_with(0)
|
||||||
assert form.ratio == expected_ratio
|
assert form.ratio == expected_ratio
|
||||||
assert form.theme_preview_layout.aspect_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
|
# THEN: The correct display ratio is calculated and the form is shown
|
||||||
expected_ratio = 16 / 9
|
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)
|
form.progress_bar.setValue.assert_called_once_with(0)
|
||||||
assert form.ratio == expected_ratio
|
assert form.ratio == expected_ratio
|
||||||
assert form.theme_preview_layout.aspect_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
|
theme_list = form.theme_list
|
||||||
|
|
||||||
# THEN: The theme list should be correct
|
# 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)
|
form.progress_bar.setMaximum.assert_called_once_with(2)
|
||||||
assert theme_list == test_theme_list
|
assert theme_list == test_theme_list
|
||||||
|
Loading…
Reference in New Issue
Block a user