From 696c413ceed630cd1c67713c1ecb42d1fa958bcb Mon Sep 17 00:00:00 2001 From: andreas Date: Sat, 26 Jun 2010 18:08:38 +0200 Subject: [PATCH] Improved delete button behaviour --- openlp/core/ui/serviceitemeditform.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openlp/core/ui/serviceitemeditform.py b/openlp/core/ui/serviceitemeditform.py index 4355ab797..098701ef1 100644 --- a/openlp/core/ui/serviceitemeditform.py +++ b/openlp/core/ui/serviceitemeditform.py @@ -88,9 +88,13 @@ class ServiceItemEditForm(QtGui.QDialog, Ui_ServiceItemEditDialog): """ items = self.listWidget.selectedItems() for item in items: - row = self.listWidget.row(item) + row = self.listWidget.row(item) self.itemList.remove(self.itemList[row]) self.loadData() + if row == self.listWidget.count(): + self.listWidget.setCurrentRow(row - 1) + else: + self.listWidget.setCurrentRow(row) def onItemUp(self): """