From c87a15b99c328888997d6f30c9dac48abf669d7b Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 5 Dec 2019 10:27:33 +0200 Subject: [PATCH] Improve working with measurements in Tape. * Disable remove button if a table is empty. * Switch to previous measurement if remove the last in the list. --HG-- branch : develop --- src/app/tape/tmainwindow.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/tape/tmainwindow.cpp b/src/app/tape/tmainwindow.cpp index 8bfa9466c..d137930c2 100644 --- a/src/app/tape/tmainwindow.cpp +++ b/src/app/tape/tmainwindow.cpp @@ -1117,7 +1117,7 @@ void TMainWindow::Remove() if (ui->tableWidget->rowCount() > 0) { - ui->tableWidget->selectRow(row); + ui->tableWidget->selectRow(row >= ui->tableWidget->rowCount() ? ui->tableWidget->rowCount() - 1 : row); } else { @@ -2581,6 +2581,8 @@ void TMainWindow::MFields(bool enabled) ui->toolButtonFindPrevious->setEnabled(false); ui->toolButtonFindNext->setEnabled(false); } + + Controls(); } //---------------------------------------------------------------------------------------------------------------------