forked from openlp/openlp
Minor tidy ups
This commit is contained in:
parent
eb115a0ad4
commit
573f31fd45
@ -6,7 +6,7 @@
|
|||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
body {
|
body {
|
||||||
background: transparent !important;
|
background: transparent !important;
|
||||||
color: #fff !important;
|
color: rgb(255, 255, 255) !important;
|
||||||
}
|
}
|
||||||
sup {
|
sup {
|
||||||
vertical-align: super !important;
|
vertical-align: super !important;
|
||||||
|
@ -150,7 +150,7 @@ def handle_db_error(plugin_name, db_file_path):
|
|||||||
Log and report to the user that a database cannot be loaded
|
Log and report to the user that a database cannot be loaded
|
||||||
|
|
||||||
:param plugin_name: Name of plugin
|
:param plugin_name: Name of plugin
|
||||||
:param openlp.core.common.path.Path db_file_path: File name of database
|
:param openlp.core.common.path.Path db_file_path: File name of database
|
||||||
:return: None
|
:return: None
|
||||||
"""
|
"""
|
||||||
db_path = get_db_path(plugin_name, db_file_path)
|
db_path = get_db_path(plugin_name, db_file_path)
|
||||||
|
@ -454,14 +454,13 @@ class MediaManagerItem(QtWidgets.QWidget, RegistryProperties):
|
|||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def generate_slide_data(self, service_item, *, item=None, xml_version=False, remote=False,
|
def generate_slide_data(self, service_item, *, item=None, remote=False, context=ServiceItemContext.Live,
|
||||||
context=ServiceItemContext.Live, file_path=None):
|
file_path=None):
|
||||||
"""
|
"""
|
||||||
Generate the slide data. Needs to be implemented by the plugin.
|
Generate the slide data. Needs to be implemented by the plugin.
|
||||||
|
|
||||||
:param service_item: The service Item to be processed
|
:param service_item: The service Item to be processed
|
||||||
:param item: The database item to be used to build the service item
|
:param item: The database item to be used to build the service item
|
||||||
:param xml_version:
|
|
||||||
:param remote: Was this remote triggered (False)
|
:param remote: Was this remote triggered (False)
|
||||||
:param context: The service context
|
:param context: The service context
|
||||||
:param openlp.core.common.path.Path file_path:
|
:param openlp.core.common.path.Path file_path:
|
||||||
@ -626,17 +625,16 @@ class MediaManagerItem(QtWidgets.QWidget, RegistryProperties):
|
|||||||
'You must select a {title} '
|
'You must select a {title} '
|
||||||
'service item.').format(title=self.title))
|
'service item.').format(title=self.title))
|
||||||
|
|
||||||
def build_service_item(self, item=None, xml_version=False, remote=False, context=ServiceItemContext.Live):
|
def build_service_item(self, item=None, remote=False, context=ServiceItemContext.Live):
|
||||||
"""
|
"""
|
||||||
Common method for generating a service item
|
Common method for generating a service item
|
||||||
:param item: Service Item to be built.
|
:param item: Service Item to be built.
|
||||||
:param xml_version: version of XML (False)
|
|
||||||
:param remote: Remote triggered (False)
|
:param remote: Remote triggered (False)
|
||||||
:param context: The context on which this is called
|
:param context: The context on which this is called
|
||||||
"""
|
"""
|
||||||
service_item = ServiceItem(self.plugin)
|
service_item = ServiceItem(self.plugin)
|
||||||
service_item.add_icon()
|
service_item.add_icon()
|
||||||
if self.generate_slide_data(service_item, item=item, xml_version=xml_version, remote=remote, context=context):
|
if self.generate_slide_data(service_item, item=item, remote=remote, context=context):
|
||||||
return service_item
|
return service_item
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
@ -263,7 +263,7 @@ class ServiceItem(RegistryProperties):
|
|||||||
file_location = os.path.join(path, file_name)
|
file_location = os.path.join(path, file_name)
|
||||||
file_location_hash = md5_hash(file_location.encode('utf-8'))
|
file_location_hash = md5_hash(file_location.encode('utf-8'))
|
||||||
image = os.path.join(str(AppLocation.get_section_data_path(self.name)), 'thumbnails',
|
image = os.path.join(str(AppLocation.get_section_data_path(self.name)), 'thumbnails',
|
||||||
file_location_hash, ntpath.basename(image)) #TODO: Pathlib
|
file_location_hash, ntpath.basename(image)) # TODO: Pathlib
|
||||||
self.slides.append({'title': file_name, 'image': image, 'path': path, 'display_title': display_title,
|
self.slides.append({'title': file_name, 'image': image, 'path': path, 'display_title': display_title,
|
||||||
'notes': notes, 'thumbnail': image})
|
'notes': notes, 'thumbnail': image})
|
||||||
# if self.is_capable(ItemCapabilities.HasThumbnails):
|
# if self.is_capable(ItemCapabilities.HasThumbnails):
|
||||||
|
Loading…
Reference in New Issue
Block a user