Bug #1909507: Enhancement: permit disambiguation of columns such as formats and #formats in rules editor.

This commit is contained in:
Charles Haley 2020-12-29 09:17:29 +00:00
parent 01b6c8c5b2
commit e62a22f000
2 changed files with 6 additions and 4 deletions

View File

@ -242,7 +242,8 @@ class TemplateDialog(QDialog, Ui_TemplateDialog):
if self.coloring:
self.color_layout.setVisible(True)
for n1, k1 in cols:
self.colored_field.addItem(n1, k1)
self.colored_field.addItem(n1 +
(' (' + k1 + ')' if k1 != color_row_key else ''), k1)
self.colored_field.setCurrentIndex(self.colored_field.findData(color_field))
elif self.iconing or self.embleming:
self.icon_layout.setVisible(True)
@ -253,7 +254,7 @@ class TemplateDialog(QDialog, Ui_TemplateDialog):
self.icon_field.setVisible(False)
for n1, k1 in cols:
self.icon_field.addItem(n1, k1)
self.icon_field.addItem('{} ({})'.format(n1, k1), k1)
self.icon_file_names = []
d = os.path.join(config_dir, 'cc_icons')
if os.path.exists(d):

View File

@ -137,7 +137,7 @@ class ConditionEditor(QWidget): # {{{
for key in sorted(
conditionable_columns(fm),
key=lambda key: sort_key(fm[key]['name'])):
self.column_box.addItem(fm[key]['name'], key)
self.column_box.addItem('{} ({})'.format(fm[key]['name'], key), key)
self.column_box.setCurrentIndex(0)
self.column_box.currentIndexChanged.connect(self.init_action_box)
@ -443,7 +443,8 @@ class RuleEditor(QDialog): # {{{
continue
name = all_columns_string if key == color_row_key else fm[key]['name']
if name:
self.column_box.addItem(name, key)
self.column_box.addItem(name +
(' (' + key + ')' if key != color_row_key else ''), key)
self.column_box.setCurrentIndex(0)
if self.rule_kind == 'color':