clear preview bar and fix visibility

This commit is contained in:
Tim Bentley 2018-02-23 09:11:07 +00:00
parent e01396c427
commit 8e33175477
2 changed files with 13 additions and 4 deletions

View File

@ -1386,12 +1386,14 @@ class SlideController(DisplayController, LogMixin, RegistryProperties):
new_item = Registry().get(self.service_item.name).on_remote_edit(self.service_item.edit_id, True)
if new_item:
self.add_service_item(new_item)
def on_clear(self):
"""
Clear the preview bar.
"""
pass
self.preview_widget.clear_list()
self.toolbar.set_widget_visible(["editSong"], False)
self.toolbar.set_widget_visible(["clear"], False)
def on_preview_add_to_service(self):
"""

View File

@ -146,6 +146,14 @@ class ListPreviewWidget(QtWidgets.QTableWidget, RegistryProperties):
self.screen_ratio = screen_ratio
self.__recalculate_layout()
def clear_list(self):
"""
Clear the preview list
:return:
"""
self.setRowCount(0)
self.clear()
def replace_service_item(self, service_item, width, slide_number):
"""
Replace the current preview items with the ones in service_item and display the given slide
@ -156,8 +164,7 @@ class ListPreviewWidget(QtWidgets.QTableWidget, RegistryProperties):
"""
self.service_item = service_item
self.setRowCount(0)
self.clear()
self.setColumnWidth(0, width)
self.clear_list()
row = 0
text = []
for frame_number, frame in enumerate(self.service_item.get_frames()):