def onRename(self): idx = self.currentIdx f = self.model["flds"][idx] name = self._uniqueName(_("New name:"), self.currentIdx, f["name"]) if not name: return self.change_tracker.mark_basic() self.mm.rename_field(self.model, f, name) gui_hooks.fields_did_rename_field(self, f, f["name"]) self.saveField() self.fillFields() self.form.fieldList.setCurrentRow(idx)
def onRename(self) -> None: idx = self.currentIdx f = self.model["flds"][idx] name = self._uniqueName(tr(TR.ACTIONS_NEW_NAME), self.currentIdx, f["name"]) if not name: return old_name = f["name"] self.change_tracker.mark_basic() self.mm.rename_field(self.model, f, name) gui_hooks.fields_did_rename_field(self, f, old_name) self.saveField() self.fillFields() self.form.fieldList.setCurrentRow(idx)