def METHOD_NAME(self, action, default=None):
    # load the action
    self._action = action
    self._default = default
    self.toplabel.setText('<p>{}</p>'.format(
        _("Here you can edit the shortcuts for {name}").format(
            name=f'<br/><b>{action.text()}</b>:')))
    self.toppixmap.setPixmap(action.icon().pixmap(32))
    shortcuts = action.shortcuts()
    self.buttonDefault.setVisible(bool(default))
    if default is not None and shortcuts == default:
        self.buttonDefault.setChecked(True)
    else:
        if shortcuts:
            self.buttonCustom.setChecked(True)
            for num, key in enumerate(shortcuts[:4]):
                self.keybuttons[num].setShortcut(key)
                self.checkConflict(num)
        else:
            self.buttonNone.setChecked(True)
    if default:
        ds = "; ".join(key.toString(QKeySequence.NativeText) for key in default)
    else:
        ds = _("no keyboard shortcut", "none")
    self.buttonDefault.setText(_("Use &default shortcut ({name})").format(name=ds))
    return self.exec_()