forked from openlp/openlp
Fix up interface better
This commit is contained in:
parent
2e82d92ebc
commit
f23e603314
@ -401,6 +401,9 @@ class ServiceManager(OpenLPMixin, RegistryMixin, QtGui.QWidget, Ui_ServiceManage
|
||||
|
||||
:param suffix_list: New Suffix's to be supported
|
||||
"""
|
||||
if isinstance(suffix_list, str):
|
||||
self.suffixes.append(suffix_list)
|
||||
else:
|
||||
for suffix in suffix_list:
|
||||
if suffix not in self.suffixes:
|
||||
self.suffixes.append(suffix)
|
||||
|
@ -92,7 +92,7 @@ class PresentationMediaItem(MediaManagerItem):
|
||||
for file_type in file_types:
|
||||
if file_type not in file_type_string:
|
||||
file_type_string += '*.%s ' % file_type
|
||||
self.service_manager.supported_suffixes([file_type])
|
||||
self.service_manager.supported_suffixes(file_type)
|
||||
self.on_new_file_masks = translate('PresentationPlugin.MediaItem', 'Presentations (%s)') % file_type_string
|
||||
|
||||
def required_icons(self):
|
||||
|
@ -83,6 +83,9 @@ class TestServiceManager(TestCase):
|
||||
# GIVEN: A new service manager instance.
|
||||
service_manager = ServiceManager(None)
|
||||
# WHEN: a suffix is added.
|
||||
service_manager.supported_suffixes(['txt'])
|
||||
service_manager.supported_suffixes('txt')
|
||||
service_manager.supported_suffixes(['pptx', 'ppt'])
|
||||
# THEN: The the controller should be registered in the registry.
|
||||
self.assertEqual('txt' in service_manager.suffixes, True, 'The suffix should be in the list')
|
||||
self.assertEqual('txt' in service_manager.suffixes, True, 'The suffix txt should be in the list')
|
||||
self.assertEqual('ppt' in service_manager.suffixes, True, 'The suffix ppt should be in the list')
|
||||
self.assertEqual('pptx' in service_manager.suffixes, True, 'The suffix pptx should be in the list')
|
||||
|
Loading…
Reference in New Issue
Block a user