service fixes

This commit is contained in:
Phill Ridout 2017-11-22 21:39:40 +00:00
parent a4cfd2cdda
commit 29f7d8967f
3 changed files with 6 additions and 5 deletions

View File

@ -498,8 +498,6 @@ class MediaController(RegistryBase, LogMixin, RegistryProperties):
:param controller: The media controller. :param controller: The media controller.
:return: True if setup succeeded else False. :return: True if setup succeeded else False.
""" """
if controller is None:
controller = self.display_controllers[DisplayControllerType.Plugin]
# stop running videos # stop running videos
self.media_reset(controller) self.media_reset(controller)
# Setup media info # Setup media info

View File

@ -350,7 +350,10 @@ class ServiceManager(QtWidgets.QWidget, RegistryBase, Ui_ServiceManager, LogMixi
if modified: if modified:
self.service_id += 1 self.service_id += 1
self._modified = modified self._modified = modified
service_file = self.short_file_name() or translate('OpenLP.ServiceManager', 'Untitled Service') if self._service_path:
service_file = self._service_path.name
else:
service_file = translate('OpenLP.ServiceManager', 'Untitled Service')
self.main_window.set_service_modified(modified, service_file) self.main_window.set_service_modified(modified, service_file)
def is_modified(self): def is_modified(self):
@ -367,7 +370,7 @@ class ServiceManager(QtWidgets.QWidget, RegistryBase, Ui_ServiceManager, LogMixi
:rtype: None :rtype: None
""" """
self._service_path = file_path self._service_path = file_path
self.main_window.set_service_modified(self.is_modified(), self.short_file_name()) self.main_window.set_service_modified(self.is_modified(), file_path.name)
Settings().setValue('servicemanager/last file', file_path) Settings().setValue('servicemanager/last file', file_path)
if file_path and file_path.suffix == '.oszl': if file_path and file_path.suffix == '.oszl':
self._save_lite = True self._save_lite = True

View File

@ -269,7 +269,7 @@ class MediaMediaItem(MediaManagerItem, RegistryProperties):
service_item.add_from_command(filename, name, CLAPPERBOARD) service_item.add_from_command(filename, name, CLAPPERBOARD)
service_item.title = clip_name service_item.title = clip_name
# Set the length # Set the length
self.media_controller.media_setup_optical(name, title, audio_track, subtitle_track, start, end, None, None) #self.media_controller.media_setup_optical(name, title, audio_track, subtitle_track, start, end, None, None)
service_item.set_media_length((end - start) / 1000) service_item.set_media_length((end - start) / 1000)
service_item.start_time = start / 1000 service_item.start_time = start / 1000
service_item.end_time = end / 1000 service_item.end_time = end / 1000