stratified_packager.gui.dlg_layers_table
All-layers table dialog for per-layer packaging settings (SPEC §19).
Classes
|
Editable table of every layer's |
- 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
LayerOptionsPageWidgetFactoryinstance.
- _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.
- _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:
- _fit_dialog_width()[source]
Widen the dialog to show every column, capped at the available screen width.
- Return type:
- _populate()[source]
Create one row per (non-plugin) layer with an editor per §4 column.
- Return type:
- _size_columns()[source]
Size columns to content, then widen editor columns to fit their editors.
- Return type:
- 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:
- _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_onlyflags.
- _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_onlyflags.
- _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
- 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.
- static _key(text)[source]
Return the
(accent-free, accent-kept)casefolded sort keys: primary, then tie-breaker.
- sort_by_rank
When set, the next sort compares
tree_rankinstead 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.