Enhancement #2019513: category editor: allow selections only in the current column instead of reporting an error.

This commit is contained in:
Charles Haley 2023-05-21 08:40:02 +01:00
parent 625fcca0ae
commit b82b2fde97

View File

@ -647,16 +647,11 @@ class TagListEditor(QDialog, Ui_TagListEditor):
self.table.blockSignals(False) self.table.blockSignals(False)
def selection_changed(self): def selection_changed(self):
col0 = tuple(item for item in self.table.selectedItems() if item.column() == 0) if self.table.currentIndex().isValid():
col3 = tuple(item for item in self.table.selectedItems() if item.column() == 3) col = self.table.currentIndex().column()
if col0 and col3:
error_dialog(self, _('Cannot select in multiple columns'),
'<p>'+_('Selection of items in multiple columns is not supported. '
'The selection will be cleared')+'<br>',
show=True)
sm = self.table.selectionModel()
self.table.blockSignals(True) self.table.blockSignals(True)
sm.clear() for itm in (item for item in self.table.selectedItems() if item.column() != col):
itm.setSelected(False)
self.table.blockSignals(False) self.table.blockSignals(False)
def check_for_deleted_items(self, show_error=False): def check_for_deleted_items(self, show_error=False):