controller.utils.emergency_caption_handler

File:

EuljiroWorship/controller/utils/emergency_caption_handler.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.

Handles the emergency caption workflow triggered from the slide controller.

This module coordinates the emergency caption process by:

  • Launching the emergency caption dialog

  • Collecting finalized slide data from the dialog

  • Writing emergency slides to the slide output JSON file

The handler acts as a thin orchestration layer between the UI dialog (controller.ui.emergency_caption_dialog.EmergencyCaptionDialog), the slide factory, and the slide output file.

class controller.utils.emergency_caption_handler.EmergencyCaptionHandler(parent)[source]

Bases: object

Manages the emergency caption input and export workflow.

This class coordinates the full emergency-caption lifecycle:

  • Opening the emergency caption dialog as a modal window

  • Retrieving finalized slide data from the dialog

  • Writing emergency slides to the slide output JSON file

The handler itself does not parse or format slide content. Slide construction is delegated to:

parent

Parent widget used to anchor the emergency caption dialog as a modal window.

Type:

QWidget

slide_factory

Factory instance responsible for constructing emergency slide dictionaries from validated dialog input.

Type:

EmergencySlideFactory

__init__(parent)[source]

Initialize the emergency caption handler.

Parameters:

parent (QWidget) – Parent widget used to anchor the emergency caption dialog as a modal window.

Returns:

None

handle()[source]

Launch the emergency caption dialog and export generated slides.

This method:

  • Opens the emergency caption dialog

  • Waits for user confirmation or cancellation

  • Retrieves finalized slide data from the dialog

  • Writes the slides to the configured slide output file

If the dialog is cancelled, no file is written.

Returns:

List of generated emergency slide dictionaries if confirmed, or None if the dialog was cancelled.

Return type:

list[dict] | None