In the terminal strip manager, free terminals could only be moved into a
strip with the "move to" list and its button. Dragging one onto a strip,
which is what users try first (#409), did nothing.
Free terminals can now be dragged onto a strip in the tree on the left,
from either place they are listed:
- the free terminal table: every selected row is moved;
- the tree itself: the dragged free terminal is moved.
Dropping on a strip, or on a terminal already in that strip, moves them
with the same undo command as the button, so one undo puts them back.
The strip is then selected, showing the terminals just added. A drop
anywhere else is refused.
A drop is also refused while the free terminal table has edits that are
not applied yet: moving reloads that table and would lose them. The
button is disabled in the same case.
The drag carries the uuids of the terminal elements under its own mime
type, and the tree only moves terminals that are still free in the
project when the drop happens.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The button that moves free terminals into a strip is disabled when there
is nothing it can do, but its tooltip always gave the same reason: apply
or cancel the pending edits. With no row selected, which is what the
screenshot on #409 shows, that sends the user looking for edits they
never made.
It also stayed enabled when the project had no terminal strip at all.
The "move to" list is then empty and a click did nothing.
The button is now disabled in all three cases and the tooltip names the
one that applies, the most basic first: no strip yet (create one with
the + button), edits pending, or nothing selected.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Three bugs stacked to produce the symptom in issue #409 (move button does
nothing):
1. selectionChanged() was declared in freeterminaleditor.h but had no body
and was never connected to the selection model, so the move button had no
awareness of whether a terminal was selected. The button could appear
enabled with nothing selected, then silently return early in
on_m_move_pb_clicked() at the real_t_vector.isEmpty() guard.
2. The dataChanged→setDisabledMove(true) connection was a one-way trap: any
cell edit (including accidentally opening and closing a type/function
combo, or toggling LED back to its current value) permanently disabled the
move button until reload() was called. There was no tooltip explaining why
the button was greyed out, so the user had no way to recover.
3. FreeTerminalModel::setData() for LED_CELL had no change guard, unlike
LABEL_CELL which checks label != value. Clicking the LED combo while it
was already at the same value still emitted dataChanged and triggered the
disable.
Fix:
- Implement selectionChanged() to enable the move controls only when at
least one row is selected AND there are no pending (yellow) edits.
- Connect it to both selectionModel::selectionChanged and model::dataChanged
so the button state is always consistent with actual UI state.
- Route reload()'s re-enable through selectionChanged() instead of calling
setDisabledMove(false) directly, so the selection state is respected
immediately after a move.
- Add a tooltip to m_move_pb explaining the disabled state.
- Add the missing change guard to LED_CELL in setData().
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Before this this commit the terminal strip editor couldn't only work on
the first project opened into this editor, all other project opened
after couldn't be edited.
This is now past, terminal strip editor can now edit every project open
in QElectroTech.