OpenLP not running due to various Float / Int issues.

This commit is contained in:
Tim Bentley 2021-11-28 14:13:28 +00:00 committed by Raoul Snyman
parent b9f27a5252
commit 1603bfb705
5 changed files with 18 additions and 15 deletions

View File

@ -642,6 +642,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow, LogMixin, RegistryPropert
# We have -disable-web-security added by our code. # We have -disable-web-security added by our code.
# If a file is passed in we will have that as well so count of 2 # If a file is passed in we will have that as well so count of 2
# If not we need to see if we want to use the previous file.so count of 1 # If not we need to see if we want to use the previous file.so count of 1
self.log_info(self.application.args)
if self.application.args and len(self.application.args) > 1: if self.application.args and len(self.application.args) > 1:
self.open_cmd_line_files(self.application.args) self.open_cmd_line_files(self.application.args)
elif self.settings.value('core/auto open'): elif self.settings.value('core/auto open'):
@ -1408,9 +1409,11 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow, LogMixin, RegistryPropert
""" """
Open files passed in through command line arguments Open files passed in through command line arguments
:param list[str] args: List of remaining positionall arguments :param list[str] args: List of remaining positional arguments
""" """
for arg in args: for arg in args:
self.log_info(arg)
file_name = os.path.expanduser(arg) file_name = os.path.expanduser(arg)
if os.path.isfile(file_name): if os.path.isfile(file_name):
self.log_info("File name found")
self.service_manager_contents.load_file(Path(file_name)) self.service_manager_contents.load_file(Path(file_name))

View File

@ -432,7 +432,7 @@ class SlideController(QtWidgets.QWidget, LogMixin, RegistryProperties):
self.toolbar.set_widget_visible('song_menu', False) self.toolbar.set_widget_visible('song_menu', False)
# Screen preview area # Screen preview area
self.preview_frame = QtWidgets.QFrame(self.splitter) self.preview_frame = QtWidgets.QFrame(self.splitter)
self.preview_frame.setGeometry(QtCore.QRect(0, 0, 300, 300 * self.ratio)) self.preview_frame.setGeometry(QtCore.QRect(0, 0, 300, int(300 * self.ratio)))
self.preview_frame.setMinimumHeight(100) self.preview_frame.setMinimumHeight(100)
self.preview_frame.setSizePolicy(QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Ignored, self.preview_frame.setSizePolicy(QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Ignored,
QtWidgets.QSizePolicy.Ignored, QtWidgets.QSizePolicy.Ignored,

View File

@ -309,16 +309,16 @@ class ThemeForm(QtWidgets.QWizard, Ui_ThemeWizard, RegistryProperties):
""" """
# Main Area # Main Area
self.area_position_page.use_main_default_location = not self.theme.font_main_override self.area_position_page.use_main_default_location = not self.theme.font_main_override
self.area_position_page.main_x = self.theme.font_main_x self.area_position_page.main_x = int(self.theme.font_main_x)
self.area_position_page.main_y = self.theme.font_main_y self.area_position_page.main_y = int(self.theme.font_main_y)
self.area_position_page.main_height = self.theme.font_main_height self.area_position_page.main_height = int(self.theme.font_main_height)
self.area_position_page.main_width = self.theme.font_main_width self.area_position_page.main_width = int(self.theme.font_main_width)
# Footer # Footer
self.area_position_page.use_footer_default_location = not self.theme.font_footer_override self.area_position_page.use_footer_default_location = not self.theme.font_footer_override
self.area_position_page.footer_x = self.theme.font_footer_x self.area_position_page.footer_x = int(self.theme.font_footer_x)
self.area_position_page.footer_y = self.theme.font_footer_y self.area_position_page.footer_y = int(self.theme.font_footer_y)
self.area_position_page.footer_height = self.theme.font_footer_height self.area_position_page.footer_height = int(self.theme.font_footer_height)
self.area_position_page.footer_width = self.theme.font_footer_width self.area_position_page.footer_width = int(self.theme.font_footer_width)
def set_alignment_page_values(self): def set_alignment_page_values(self):
""" """

View File

@ -158,7 +158,7 @@ class AspectRatioLayout(QtWidgets.QLayout):
y = rect.height() - self.margin - height y = rect.height() - self.margin - height
else: else:
y = self.margin + (available_height - height) / 2 y = self.margin + (available_height - height) / 2
widget.setGeometry(rect.x() + self.margin, rect.y() + y, width, height) widget.setGeometry(int(rect.x() + self.margin), int(rect.y() + y), int(width), int(height))
else: else:
if self._item.alignment() & QtCore.Qt.AlignLeft: if self._item.alignment() & QtCore.Qt.AlignLeft:
x = self.margin x = self.margin
@ -166,8 +166,8 @@ class AspectRatioLayout(QtWidgets.QLayout):
x = rect.width() - self.margin - width x = rect.width() - self.margin - width
else: else:
x = self.margin + (available_width - width) / 2 x = self.margin + (available_width - width) / 2
widget.setGeometry(rect.x() + int(x), rect.y() + self.margin, width, height) widget.setGeometry(int(rect.x()) + int(x), int(rect.y() + self.margin), int(width), int(height))
self.resize.emit(QtCore.QSize(width, height)) self.resize.emit(QtCore.QSize(int(width), int(height)))
def sizeHint(self): def sizeHint(self):
""" """

View File

@ -133,7 +133,7 @@ class ListPreviewWidget(QtWidgets.QTableWidget, RegistryProperties):
height = min(height, self.auto_row_height) height = min(height, self.auto_row_height)
# Apply new height to slides # Apply new height to slides
for slide_index in range(len(self.service_item.slides)): for slide_index in range(len(self.service_item.slides)):
self.setRowHeight(slide_index, height) self.setRowHeight(slide_index, int(height))
def row_resized(self, row, old_height, new_height): def row_resized(self, row, old_height, new_height):
""" """
@ -238,7 +238,7 @@ class ListPreviewWidget(QtWidgets.QTableWidget, RegistryProperties):
# First set the height to 1 and then to the right height. This makes the item display correctly. # First set the height to 1 and then to the right height. This makes the item display correctly.
# If this is not done, sometimes the image item is displayed as blank. # If this is not done, sometimes the image item is displayed as blank.
self.setRowHeight(slide_index, 1) self.setRowHeight(slide_index, 1)
self.setRowHeight(slide_index, slide_height) self.setRowHeight(slide_index, int(slide_height))
self.setVerticalHeaderLabels(text) self.setVerticalHeaderLabels(text)
if self.service_item.is_text(): if self.service_item.is_text():
self.resizeRowsToContents() self.resizeRowsToContents()