Skip to content

hkb_editor.gui.dialogs.mass_rename_dialog

mass_rename_dialog

Bases: DpgItem

A dialog for renaming a record hierarchy via regular expressions.

Offers a search/replace pattern pair with a live preview and applies the substitution to the name field of every record reachable from root, in topological order and inside a single transaction. On confirm, callback receives the list of records that were actually altered.

Parameters:

Name Type Description Default
root HkbRecord

Record whose subgraph will be renamed.

required
callback callable

Called as callback(tag, altered, user_data) on confirm.

None
initial_search str

Pre-filled search pattern.

None
initial_replace str

Pre-filled replacement pattern.

None
title str

Window title bar label.

'Mass Rename'
tag int or str

Explicit tag; auto-generated if None.

None
user_data any

Passed through to callback.

None

pin_objects property

pin_objects: bool

Whether the caller should pin the renamed records.

apply

apply() -> list[HkbRecord]

Rename every named record below the root. Returns the altered ones.

show_message

show_message(
    msg: str = None, color: RGBA = style.red
) -> None

Show or hide the notification label. Pass msg=None to hide.

Ko-fi donations