fix(bec_widgets): drop the redundant row-number gutter in the queue table
Qt's own vertical header (1-based) sat to the left of the dialog's own 0-based "#" column (which matches the CLI's indices -- tomo_queue_show(), tomo_queue_delete(), tomo_queue_move()) -- two differently-based indices next to each other read as confusing/wrong. Hides Qt's gutter, keeping only the one that actually means something. Also shows a tomo job's active at_each_angle_hook in the Details column (e.g. "hook: name" or "hook: name (not registered)", checked against the published tomo_at_each_angle_hooks list) -- previously Details was always blank for tomo jobs, so a hook-driven queued job looked identical to a plain one without expanding the row tooltip. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1168,6 +1168,12 @@ class TomoQueueDialog(QDialog):
|
||||
header.setSectionResizeMode(col, QHeaderView.ResizeMode.ResizeToContents)
|
||||
header.setSectionResizeMode(1, QHeaderView.ResizeMode.Stretch)
|
||||
header.setSectionResizeMode(7, QHeaderView.ResizeMode.Stretch)
|
||||
# Qt's own row-number gutter is 1-based and sits to the left of our
|
||||
# own 0-based "#" column (which matches CLI indices -- tomo_queue_show(),
|
||||
# tomo_queue_delete(), tomo_queue_move()) -- two different-based
|
||||
# indices side by side was confusing. Keep only the one that means
|
||||
# something.
|
||||
self._table.verticalHeader().setVisible(False)
|
||||
self._table.setSelectionBehavior(QTableWidget.SelectionBehavior.SelectRows)
|
||||
self._table.setEditTriggers(QTableWidget.EditTrigger.NoEditTriggers)
|
||||
self._table.itemSelectionChanged.connect(self._update_sort_buttons)
|
||||
@@ -1212,6 +1218,7 @@ class TomoQueueDialog(QDialog):
|
||||
|
||||
def _refresh(self) -> None:
|
||||
jobs = self._load_queue()
|
||||
registered_hooks = self._gv_get("tomo_at_each_angle_hooks") or []
|
||||
self._table.setRowCount(len(jobs))
|
||||
for row, job in enumerate(jobs):
|
||||
status = job.get("status", "pending")
|
||||
@@ -1237,7 +1244,7 @@ class TomoQueueDialog(QDialog):
|
||||
_format_projections(params),
|
||||
_fmt_num(params.get("tomo_countingtime")),
|
||||
_fmt_num(params.get("tomo_shellstep")),
|
||||
"",
|
||||
_format_hook_detail(params, registered_hooks),
|
||||
]
|
||||
tooltip = _job_tooltip(job)
|
||||
for col, text in enumerate(cells):
|
||||
@@ -1749,6 +1756,19 @@ def _format_command_summary(job: dict) -> str:
|
||||
return " > ".join(parts) + f" [{idem}]"
|
||||
|
||||
|
||||
def _format_hook_detail(params: dict, registered_hooks: list) -> str:
|
||||
"""Details-column text for a tomo job's at_each_angle_hook, or "" if
|
||||
none is set -- mirrors flomni.py's _describe_active_hook() flagging an
|
||||
unregistered name, using the published tomo_at_each_angle_hooks list
|
||||
since the GUI process has no registry of its own to check against."""
|
||||
hook_name = params.get("at_each_angle_hook")
|
||||
if not hook_name:
|
||||
return ""
|
||||
if hook_name in registered_hooks:
|
||||
return f"hook: {hook_name}"
|
||||
return f"hook: {hook_name} (not registered)"
|
||||
|
||||
|
||||
def _job_tooltip(job: dict) -> str:
|
||||
"""Full-detail multi-line description of a queue job, applied to every
|
||||
cell in its row so hovering anywhere on the row shows what the Label
|
||||
|
||||
Reference in New Issue
Block a user