core.plugin.slide_controller_launcher

File:

EuljiroWorship/core/plugin/controller_launcher.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.

Launches and manages the slide controller subprocess for integrated slide output control.

This module provides a small utility class responsible for starting the slide controller (controller.slide_controller) as a subprocess. It ensures that the controller is launched only once and keeps track of the running process for basic status checks.

The launcher is intended to be used by the slide generator or main application entry point, allowing the controller to behave as a managed child process rather than a standalone application.

class core.plugin.slide_controller_launcher.SlideControllerLauncher[source]

Bases: object

Manages the lifecycle of the slide controller subprocess.

This class provides a minimal supervisory layer for launching and tracking the slide controller process from the generator UI. Its responsibility is limited to preventing duplicate launches and reporting basic runtime status; it does not attempt to restart, monitor health, or forcibly terminate the controller.

The launcher maintains an internal reference to the subprocess handle and uses it to determine whether the controller is currently active. Launch requests issued while the controller is already running are safely ignored.

Error handling is intentionally lightweight and UI-aware: if a Qt parent widget is available, launch failures are reported via a warning dialog; otherwise, errors are emitted to standard output.

This design is suited for a user-driven workflow where the controller is started explicitly by the generator and stopped externally or by user action, rather than by automatic process management.

proc

Handle to the currently running slide controller subprocess, or None if no controller has been launched.

Type:

subprocess.Popen | None

__init__()[source]

Initialize the slide controller launcher.

The launcher starts with no active subprocess. Once the slide controller is launched, the subprocess handle is stored internally and reused for subsequent status checks.

Returns:

None

is_running()[source]

Check whether the slide controller process is currently running.

This method verifies that a subprocess has been launched and that it has not yet terminated.

Returns:

True if the controller subprocess is active, False otherwise.

Return type:

bool

launch_if_needed(parent_widget=None)[source]

Launch the slide controller subprocess if it is not already running.

If the controller process is already active, this method exits without performing any action.

If the launch fails, an error message is reported as follows:

  • If a Qt parent widget is provided, a warning dialog is shown.

  • Otherwise, the error is printed to standard output.

Parameters:

parent_widget (QWidget | None) – Optional parent widget used for displaying error dialogs.

Returns:

None