forked from openlp/openlp
Fix up interface better
This commit is contained in:
parent
2e82d92ebc
commit
f23e603314
@ -401,9 +401,12 @@ class ServiceManager(OpenLPMixin, RegistryMixin, QtGui.QWidget, Ui_ServiceManage
|
|||||||
|
|
||||||
:param suffix_list: New Suffix's to be supported
|
:param suffix_list: New Suffix's to be supported
|
||||||
"""
|
"""
|
||||||
for suffix in suffix_list:
|
if isinstance(suffix_list, str):
|
||||||
if suffix not in self.suffixes:
|
self.suffixes.append(suffix_list)
|
||||||
self.suffixes.append(suffix)
|
else:
|
||||||
|
for suffix in suffix_list:
|
||||||
|
if suffix not in self.suffixes:
|
||||||
|
self.suffixes.append(suffix)
|
||||||
|
|
||||||
def on_new_service_clicked(self, field=None):
|
def on_new_service_clicked(self, field=None):
|
||||||
"""
|
"""
|
||||||
|
@ -92,7 +92,7 @@ class PresentationMediaItem(MediaManagerItem):
|
|||||||
for file_type in file_types:
|
for file_type in file_types:
|
||||||
if file_type not in file_type_string:
|
if file_type not in file_type_string:
|
||||||
file_type_string += '*.%s ' % file_type
|
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
|
self.on_new_file_masks = translate('PresentationPlugin.MediaItem', 'Presentations (%s)') % file_type_string
|
||||||
|
|
||||||
def required_icons(self):
|
def required_icons(self):
|
||||||
|
@ -83,6 +83,9 @@ class TestServiceManager(TestCase):
|
|||||||
# GIVEN: A new service manager instance.
|
# GIVEN: A new service manager instance.
|
||||||
service_manager = ServiceManager(None)
|
service_manager = ServiceManager(None)
|
||||||
# WHEN: a suffix is added.
|
# 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.
|
# 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