def METHOD_NAME(self, actions, header):
    _dialogitems = [f'{i}' for i in actions]
    _dialogitems += [get_localized(32441), get_localized(190)]  # Add additional "new step" and save item
    # Choose the step to edit
    x = Dialog().select(header, _dialogitems)
    if x == -1:  # User cancelled
        return -1
    if _dialogitems[x] == get_localized(190):  # User wants to save
        return actions
    if _dialogitems[x] == get_localized(32441):  # User wants to add a new step
        if len(actions) == 0:  # No actions so needs a plugin path for search TODO: Add directory walk
            action = f'plugin://{self.player.get("plugin")}/'
        else:  # Init an empty action dictionary if not first step
            action = {}
    else:  # Set the selected step as our action to edit
        action = actions[x]
    # Edit the action
    if isinstance(action, str):  # First step is a string so we want to edit manually with keboard
        action = Dialog().input(get_localized(32446).format(header), defaultt=action)
    else:  # Else present dialog to edit rules
        action = self._edit_keymatch_step(deepcopy(action), header=get_localized(32445).format(x + 1))
    if action == -1:
        pass  # Do nothing as user cancelled
    elif x >= len(actions):
        actions.append(action)
    else:
        actions[x] = action
    if not action:  # Don't add empties. If user deleted all rules from step then delete it
        actions.pop(x)
    return self.METHOD_NAME(actions, header=header)