core.generator.ui.slide_table_manager

File:

EuljiroWorship/core/generator/ui/slide_table_manager.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.

Row-level table operations for the slide generator.

This module defines core.generator.ui.slide_table_manager.SlideTableManager, a helper class responsible for manipulating rows in the slide table widget used by the generator UI. It encapsulates all row operations (insert, delete, move, swap) and coordinates with the parent generator to enforce edit restrictions (e.g., when the slide controller is running).

class core.generator.ui.slide_table_manager.SlideTableManager(table, generator)[source]

Bases: object

Manage row-level operations on the slide table.

This class owns all logic related to modifying the table rows that represent slides, including insertion, duplication, deletion, reordering, and style selection handling. It delegates edit-safety checks to the parent generator to ensure consistency with the controller state.

table

The table widget that lists slide rows.

Type:

QTableWidget

generator

Reference to the main slide generator window, used for edit permission checks and coordination.

__init__(table, generator)[source]

Initialize the table manager.

Parameters:
add_row()[source]

Append a new slide row to the end of the table.

If the slide controller is currently running, the operation is aborted to prevent edits that would not be reflected in output.

Parameters:

None

Returns:

None

insert_row(row=None, above=True, connect_signal=True)[source]

Insert a new slide row at a specified position.

If no explicit row index is provided, the insertion position is determined from the current table selection. A style selection combo box and empty caption/headline cells are created for the row.

Parameters:
  • row (int | None) – Target row index. If None, uses the current selection or appends to the end of the table.

  • above (bool) – If True, insert above the reference row; otherwise insert below.

  • connect_signal (bool) – Whether to connect the style combo box change signal to the corresponding handler.

Returns:

None

handle_combo_change_by_row(row)[source]

Handle a style change in the combo box for a specific row.

This method is triggered when the style combo box in the given row changes. It is intended to synchronize the selected style with other parts of the generator UI (e.g., the right-hand detail pane).

Parameters:

row (int) – Row index whose style selection has changed.

Returns:

None

delete_selected_row()[source]

Delete the currently selected slide row from the table.

If no row is selected, this method does nothing. If the slide controller is running, deletion is aborted.

Parameters:

None

Returns:

None

duplicate_selected_row()[source]

Duplicate the currently selected slide row immediately below itself.

The duplicated row copies:

  • The selected slide style

  • The caption text

  • The headline text

If no row is selected, this method does nothing. If the slide controller is running, duplication is aborted.

Parameters:

None

Returns:

None

move_row_up()[source]

Move the selected slide row up by one position.

If the selected row is already at the top, no action is taken.

Parameters:

None

Returns:

None

move_row_down()[source]

Move the selected slide row down by one position.

If the selected row is already at the bottom, no action is taken.

Parameters:

None

Returns:

None

swap_rows(row1, row2)[source]

Swap the contents of two rows in the slide table.

This includes swapping:

  • The selected values of the style combo boxes

  • The text contents of the caption and headline cells

Parameters:
  • row1 (int) – Index of the first row.

  • row2 (int) – Index of the second row.

Returns:

None

Raises:

IndexError – If either row index is out of bounds for the table.