radioviz.models.app_state

Application state management module.

This module provides the AppState class which manages the global application state, including tracking whether images are available and managing the currently active window. The state changes are propagated through Qt signals to notify interested components.

Classes

AppState()

Application state manager.

class radioviz.models.app_state.AppState[source]

Bases: QObject

Application state manager.

This class maintains the global application state including image availability and the currently active window. It emits signals when the state changes, allowing other parts of the application to react to these changes.

The state includes: - Whether images are available in the application - Which window is currently active

Initialize the application state.

Creates a new instance with default values where no images are available and no window is active.

_get_active_window() SubWindowController[Any] | None[source]

Get the currently active window controller.

Returns:

The active window controller or None if no window is active

Return type:

Union[‘SubWindowController’, None]

_set_active_window(value: SubWindowController[Any] | None) None[source]

Set the active window controller.

Manages the transition between window states and updates image availability accordingly. Emits the changed signal when state changes.

Parameters:

value (Union['SubWindowController', None]) – The new active window controller or None

on_window_change(window_controller: ForwardRef('SubWindowController[Any]') | None) None[source]

Handle window change events.

Updates the active window and image availability status based on the provided window controller. Emits the changed signal when state changes.

Parameters:

window_controller (Union['SubWindowController', None]) – The new active window controller or None

property active_window: SubWindowController[Any] | None

Get the currently active window controller.

Returns:

The active window controller or None if no window is active

Return type:

Union[‘SubWindowController’, None]

changed

Signal emitted when the application state changes.

property has_images: bool

Check if images are available in the application.

Returns:

True if images are available, False otherwise

Return type:

bool