diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 0b81f9fd4..d5ddbe182 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -150,7 +150,7 @@ class ServiceManager(QWidget): # i=deepcopy(item) # print i # print i.imgs - self.service_data.insertRow(row, item) + self.service_data.insertRow(row+1, item) # for i in self.service_data: # print item.imgs # print i.imgs diff --git a/openlp/core/ui/test/test_service_manager.py b/openlp/core/ui/test/test_service_manager.py index 0944dc78c..19d76b5ba 100644 --- a/openlp/core/ui/test/test_service_manager.py +++ b/openlp/core/ui/test/test_service_manager.py @@ -77,6 +77,67 @@ class TestServiceManager_base: assert lines[1] == "test.gif" log.info("done") + def test_2items_as_separate_items(self): + # If nothing is selected when item is added, a new base service item is added + log.info("test_2items_as_separate_items") + item=ImageServiceItem(None) + item.add("test.gif") + self.s.addServiceItem(item) + item=ImageServiceItem(None) + item.add("test2.gif") + item.add("test3.gif") + self.s.addServiceItem(item) + answer = self.s.oos_as_text() + log.info("Answer = " + str(answer)) + lines=answer.split("\n") + log.info("lines = " + str(lines)) + assert lines[0].startswith("#