In the Sort by tool, use a combo box when saving to make it easier to replace an existing sort.

This commit is contained in:
Charles Haley 2023-04-19 21:43:25 +01:00
parent d153d026e9
commit dbd0d591cf

View File

@ -143,9 +143,13 @@ class ChooseMultiSort(Dialog):
spec = self.current_sort_spec spec = self.current_sort_spec
if not spec: if not spec:
return self.no_column_selected_error() return self.no_column_selected_error()
name, ok = QInputDialog.getText(self, _('Choose name'), d = QInputDialog(self)
_('Choose a name for these settings')) d.setComboBoxEditable(True)
if ok: d.setComboBoxItems(self.saved_specs.keys())
d.setWindowTitle(_('Choose name'))
d.setLabelText(_('Choose a name for these settings'))
if d.exec():
name = d.textValue()
q = self.saved_specs q = self.saved_specs
q[name] = spec q[name] = spec
self.saved_specs = q self.saved_specs = q