Enhancement #7881 - keep manage tags editor positioned near last delete.

This commit is contained in:
Charles Haley 2010-12-13 12:33:33 +00:00
parent d80ae09ce8
commit ae8764d456

View File

@ -105,9 +105,13 @@ class TagListEditor(QDialog, Ui_TagListEditor):
if not question_dialog(self, _('Are your sure?'), if not question_dialog(self, _('Are your sure?'),
'<p>'+_('Are you certain you want to delete the following items?')+'<br>'+ct): '<p>'+_('Are you certain you want to delete the following items?')+'<br>'+ct):
return return
row = self.available_tags.row(deletes[0])
for item in deletes: for item in deletes:
(id,ign) = item.data(Qt.UserRole).toInt() (id,ign) = item.data(Qt.UserRole).toInt()
self.to_delete.append(id) self.to_delete.append(id)
self.available_tags.takeItem(self.available_tags.row(item)) self.available_tags.takeItem(self.available_tags.row(item))
if row >= self.available_tags.count():
row = self.available_tags.count() - 1
if row >= 0:
self.available_tags.scrollToItem(self.available_tags.item(row))