From 97239657c7df9c9a149eb74b44c402ae3833e2c9 Mon Sep 17 00:00:00 2001 From: ispyisail Date: Thu, 1 Oct 2026 18:11:45 +1300 Subject: [PATCH] Fix the terminal strip's move button saying the wrong thing (#409) 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 --- sources/TerminalStrip/ui/freeterminaleditor.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/sources/TerminalStrip/ui/freeterminaleditor.cpp b/sources/TerminalStrip/ui/freeterminaleditor.cpp index e9863f448..fcdd2a515 100644 --- a/sources/TerminalStrip/ui/freeterminaleditor.cpp +++ b/sources/TerminalStrip/ui/freeterminaleditor.cpp @@ -278,7 +278,19 @@ void FreeTerminalEditor::selectionChanged() { const bool has_selection = !ui->m_table_view->selectionModel()->selectedIndexes().isEmpty(); const bool has_pending = !m_model->modifiedModelRealTerminalData().isEmpty(); - setDisabledMove(!has_selection || has_pending); + const bool has_strip = ui->m_move_in_cb->count() > 0; + setDisabledMove(!has_strip || !has_selection || has_pending); + + //Say why the button is disabled, the most basic reason first + if (!has_strip) { + ui->m_move_pb->setToolTip(tr("Le projet n'a aucun bornier : créez-en un avec le bouton +")); + } else if (has_pending) { + ui->m_move_pb->setToolTip(tr("Appliquez ou annulez les modifications en cours avant de déplacer")); + } else if (!has_selection) { + ui->m_move_pb->setToolTip(tr("Sélectionnez dans le tableau les bornes à déplacer")); + } else { + ui->m_move_pb->setToolTip(tr("Déplacer les bornes sélectionnées vers le bornier choisi")); + } } void FreeTerminalEditor::setDisabledMove(bool b) @@ -286,7 +298,5 @@ void FreeTerminalEditor::setDisabledMove(bool b) ui->m_move_label->setDisabled(b); ui->m_move_in_cb->setDisabled(b); ui->m_move_pb->setDisabled(b); - ui->m_move_pb->setToolTip(b ? tr("Appliquez ou annulez les modifications en cours avant de déplacer") - : tr("Déplacer les bornes sélectionnées vers le bornier choisi")); }