core.generator.ui.contents.anthem_content

File:

EuljiroWorship/core/generator/ui/contents/anthem_content.py

Author:

Benjamin Jaedon Choi - https://github.com/saintbenjamin

Affiliated Church:

The Eulji-ro Presbyterian Church [대한예수교장로회(통합) 을지로교회]

Address:

The Eulji-ro Presbyterian Church, 24-10, Eulji-ro 20-gil, Jung-gu, Seoul 04549, South Korea

Telephone:

+82-2-2266-3070

E-mail:

euljirochurch [at] G.M.A.I.L. (replace [at] with @ and G.M.A.I.L as you understood.)

License:

MIT License with Attribution Requirement (see LICENSE file for details); Copyright (c) 2025 The Eulji-ro Presbyterian Church.

UI content widget for editing “anthem” style slides.

This module defines core.generator.ui.contents.anthem_content.AnthemContent, a QWidget responsible for collecting input data required to generate an “anthem”-style slide. The widget provides fields for specifying the choir name and the anthem title, and converts the input into a standardized slide dictionary used by the generator.

The widget integrates with core.generator.utils.slide_input_submitter.SlideInputSubmitter to support automatic submission and synchronization with the parent generator window.

class core.generator.ui.contents.anthem_content.AnthemContent(*args, **kwargs)[source]

Bases: QWidget

Content editor widget for “anthem” style slides.

This widget provides input fields for composing anthem-style slides, typically used for choir or special music presentations. It allows the user to specify:

  • Choir or group name

  • Anthem title

The collected input is transformed into a slide dictionary containing caption, caption_choir, and headline fields, which are later consumed by the slide generator/exporter and controller.

Parameters:
  • caption (str)

  • headline (str)

caption

Initial caption text passed from existing slide data. Typically represents the main group or choir name.

Type:

str

headline

Initial headline text passed from existing slide data. Typically represents the anthem title.

Type:

str

generator_window

Reference to the slide generator window. Used for automatic submission, synchronization, and triggering save/update logic.

name_input

Input field for choir or group name.

Type:

QLineEdit

headline_input

Input field for the anthem title.

Type:

QLineEdit

submitter

Helper object that watches input fields and submits slide data back to the generator window when changes occur.

Type:

SlideInputSubmitter

__init__(parent, generator_window, caption='', headline='')[source]

Initialize the anthem content editor.

Parameters:
  • parent (QWidget) – Parent widget container.

  • generator_window – Reference to the generator window, used for submitting slide data and triggering auto-save behavior.

  • caption (str) – Initial caption value, typically containing the choir name.

  • headline (str) – Initial headline value, typically containing the anthem title.

Returns:

None

build_ui()[source]

Construct the UI elements for editing an “anthem”-style slide.

This method builds input fields for the choir name and anthem title, arranges them vertically, and registers the inputs with core.generator.utils.slide_input_submitter.SlideInputSubmitter to enable automatic submission and synchronization with the generator window.

Parameters:

None

Returns:

None

build_anthem_slide()[source]

Conditionally generate anthem slide data.

This method checks whether at least one input field contains non-empty text. If all inputs are empty, no slide data is generated.

Parameters:

None

Returns:

Slide data dictionary if at least one input is provided; otherwise, None.

Return type:

dict | None

get_slide_data()[source]

Generate the slide data dictionary for an anthem slide.

The method parses the choir name input to separate the main caption and choir identifier. Default values are applied when the input does not match the expected format.

Parameters:

None

Returns:

Dictionary representing the anthem slide, including:

  • style

  • caption

  • caption_choir

  • headline

Return type:

dict