stratified_packager.gui.dlg_layers_table

All-layers table dialog for per-layer packaging settings (SPEC §19).

Classes

LayersTableDialog(iface[, parent, ...])

Editable table of every layer's stratified_packager_* variables.

class stratified_packager.gui.dlg_layers_table.LayersTableDialog(iface, parent=None, layer_options_page_widget_factory=None)[source]

Editable table of every layer’s stratified_packager_* variables.

Parameters:
  • iface (QgisInterface)

  • parent (QWidget | None)

  • layer_options_page_widget_factory (LayerOptionsPageWidgetFactory | None)

__init__(iface, parent=None, layer_options_page_widget_factory=None)[source]

Build the dialog and fill the table from the current project’s layers.

Parameters:
  • iface (QgisInterface) – The QGIS interface (for the page deep-link buttons).

  • parent (QWidget | None) – The dialog parent.

  • layer_options_page_widget_factory (LayerOptionsPageWidgetFactory | None) – the registered LayerOptionsPageWidgetFactory instance.

_cycle_name_sort(column)[source]

Cycle the Layer column: name-ascending → name-descending → default (layer-tree) order.

Clicks on the editor columns are ignored — they hold widgets, not sortable values.

Parameters:

column (int) – The clicked header section.

Return type:

None

_fill_row(row, layer)[source]

Fill one table row for layer.

Parameters:
  • row (int) – The table row index.

  • layer (QgsMapLayer) – The layer to represent.

Return type:

None

_fit_dialog_width()[source]

Widen the dialog to show every column, capped at the available screen width.

Return type:

None

_on_accept()[source]

Apply the edits, then close the dialog.

Return type:

None

_open_layer_properties(layer_id)[source]

Open a layer’s properties dialog.

Parameters:

layer_id (str) – The id of the layer whose properties to open.

Return type:

None

_open_plugin_settings()[source]

Open the plugin Options page.

Return type:

None

_open_project_defaults()[source]

Open the plugin’s Project Properties defaults page.

Return type:

None

_populate()[source]

Create one row per (non-plugin) layer with an editor per §4 column.

Return type:

None

_size_columns()[source]

Size columns to content, then widen editor columns to fit their editors.

Return type:

None

_wire()[source]

Connect the button box and the page deep-link buttons.

Return type:

None

apply_changes()[source]

Write every edited cell back to its layer variable.

Contained at this QGIS-invoked boundary: a failed write is reported, not raised.

Return type:

None

_VECTOR_ONLY: frozenset[str] = frozenset({'excluded_fields', 'matching_method', 'materialize_virtual_layer', 'relation_path', 'spatial_predicate', 'stage', 'warm_marked'})

Field keys (bare suffixes) that only apply to vector layers (disabled otherwise); derived from the variable table’s vector_only flags.

_VIRTUAL_ONLY: frozenset[str] = frozenset({'materialize_virtual_layer'})

Field keys whose column is disabled for non-virtual layers; derived from the variable table’s virtual_only flags.

_name_sort_state

The Layer column’s sort cycle: 0 = layer-tree order, 1 = ascending, 2 = descending.

btn_plugin_settings: qgis.PyQt.QtWidgets.QPushButton
btn_project_defaults: qgis.PyQt.QtWidgets.QPushButton
button_box: qgis.PyQt.QtWidgets.QDialogButtonBox
lbl_header: qgis.PyQt.QtWidgets.QLabel
table: qgis.PyQt.QtWidgets.QTableWidget
verticalLayout: qgis.PyQt.QtWidgets.QVBoxLayout
class stratified_packager.gui.dlg_layers_table._NameItem(text, tree_rank)[source]

A layer-name cell sorted by name (accent-aware) or by layer-tree rank.

Parameters:
static _key(text)[source]

Return the (accent-free, accent-kept) casefolded sort keys: primary, then tie-breaker.

Parameters:

text (str) – The cell text.

Return type:

tuple[str, str]

Returns:

The accent-stripped key followed by the accent-keeping key.

__init__(text, tree_rank)[source]

Build the name cell.

Parameters:
  • text (str) – The layer name to show.

  • tree_rank (int) – The row’s position in the layer tree; sorted on to restore the default order (the third click of the header’s sort cycle).

sort_by_rank

When set, the next sort compares tree_rank instead of the name (restoring the default layer-tree order). Toggled by the host dialog before each sort.

tree_rank

The row’s layer-tree position, used to restore the default order.