Fix two custom column preferences editor problems:

1) cannot edit a just-edited column. Get a message that it is not a custom column.
2) cannot delete a newly-added column. It disappears from the list but is created anyway.
This commit is contained in:
Charles Haley 2010-09-07 20:41:45 +01:00
parent fdc81f4dae
commit b6bd654948
2 changed files with 4 additions and 2 deletions

View File

@ -105,7 +105,10 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
return
self.opt_columns.item(idx).setCheckState(False)
self.opt_columns.takeItem(idx)
self.custcols[col]['*deleteme'] = True
if self.custcols[col]['colnum'] is None:
del self.custcols[col] # A newly-added column was deleted
else:
self.custcols[col]['*deleteme'] = True
self.changed_signal.emit()
def add_custcol(self):

View File

@ -161,7 +161,6 @@ class CreateCustomColumn(QDialog, Ui_QCreateCustomColumn):
else:
idx = self.parent.opt_columns.currentRow()
item = self.parent.opt_columns.item(idx)
item.setData(Qt.UserRole, QVariant(key))
item.setText(col_heading)
self.parent.custcols[self.orig_column_name]['label'] = col
self.parent.custcols[self.orig_column_name]['name'] = col_heading