Skip to content

Commit

Permalink
Disable/enable speed test chunk size edit boxes when testing starts/e…
Browse files Browse the repository at this point in the history
…nds and delete if feature is not enabled
  • Loading branch information
thedjnK committed Nov 9, 2024
1 parent efc65ba commit 8baf58a
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions AuTerm/AutMainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@ AutMainWindow::AutMainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::
ui->btn_SpeedClose->deleteLater();
ui->btn_SpeedCopy->deleteLater();
ui->btn_SpeedStartStop->deleteLater();
ui->edit_speed_test_minimum_buffer_size->deleteLater();
ui->edit_speed_test_chunk_append_size->deleteLater();
ui->tab_SpeedTest->deleteLater();
#endif

Expand Down Expand Up @@ -1301,6 +1303,8 @@ void AutMainWindow::on_btn_TermClose_clicked(bool from_plugin)
ui->btn_SpeedStartStop->setEnabled(false);
ui->check_SpeedSyncReceive->setEnabled(true);
ui->combo_SpeedDataType->setEnabled(true);
ui->edit_speed_test_minimum_buffer_size->setEnabled(true);
ui->edit_speed_test_chunk_append_size->setEnabled(true);
if (ui->combo_SpeedDataType->currentIndex() == 1)
{
//Enable string options
Expand Down Expand Up @@ -2585,6 +2589,8 @@ void AutMainWindow::SerialError(QSerialPort::SerialPortError speErrorCode)
ui->btn_SpeedStartStop->setEnabled(false);
ui->check_SpeedSyncReceive->setEnabled(true);
ui->combo_SpeedDataType->setEnabled(true);
ui->edit_speed_test_minimum_buffer_size->setEnabled(true);
ui->edit_speed_test_chunk_append_size->setEnabled(true);
if (ui->combo_SpeedDataType->currentIndex() == 1)
{
//Enable string options
Expand Down Expand Up @@ -3840,6 +3846,8 @@ void AutMainWindow::on_btn_SpeedStartStop_clicked()
ui->btn_SpeedStartStop->setText(tr("&Start Test"));
ui->check_SpeedSyncReceive->setEnabled(true);
ui->combo_SpeedDataType->setEnabled(true);
ui->edit_speed_test_minimum_buffer_size->setEnabled(true);
ui->edit_speed_test_chunk_append_size->setEnabled(true);
if (ui->combo_SpeedDataType->currentIndex() == 1)
{
//Enable string options
Expand Down Expand Up @@ -3921,6 +3929,8 @@ void AutMainWindow::SpeedMenuSelected(QAction *qaAction)
ui->combo_SpeedDataType->setEnabled(false);
ui->edit_SpeedTestData->setEnabled(false);
ui->check_SpeedStringUnescape->setEnabled(false);
ui->edit_speed_test_minimum_buffer_size->setEnabled(false);
ui->edit_speed_test_chunk_append_size->setEnabled(false);

if (gtmrSpeedTimer.isValid())
{
Expand Down Expand Up @@ -4112,6 +4122,8 @@ void AutMainWindow::on_combo_SpeedDataType_currentIndexChanged(int)
ui->edit_SpeedPacketsGood->setEnabled(false);
ui->edit_SpeedPacketsBad->setEnabled(false);
ui->edit_SpeedPacketsErrorRate->setEnabled(false);
ui->edit_speed_test_minimum_buffer_size->setEnabled(false);
ui->edit_speed_test_chunk_append_size->setEnabled(false);

//Disable sending modes
while (i < gpSpeedMenu->actions().length())
Expand All @@ -4133,6 +4145,8 @@ void AutMainWindow::on_combo_SpeedDataType_currentIndexChanged(int)
ui->edit_SpeedPacketsGood->setEnabled(true);
ui->edit_SpeedPacketsBad->setEnabled(true);
ui->edit_SpeedPacketsErrorRate->setEnabled(true);
ui->edit_speed_test_minimum_buffer_size->setEnabled(true);
ui->edit_speed_test_chunk_append_size->setEnabled(true);

//Enable sending modes
while (i < gpSpeedMenu->actions().length())
Expand Down Expand Up @@ -4664,6 +4678,8 @@ void AutMainWindow::SpeedTestStopTimer()
ui->btn_SpeedStartStop->setText(tr("&Start Test"));
ui->check_SpeedSyncReceive->setEnabled(true);
ui->combo_SpeedDataType->setEnabled(true);
ui->edit_speed_test_minimum_buffer_size->setEnabled(true);
ui->edit_speed_test_chunk_append_size->setEnabled(true);
if (ui->combo_SpeedDataType->currentIndex() == 1)
{
//Enable string options
Expand Down Expand Up @@ -5731,6 +5747,8 @@ void AutMainWindow::plugin_transport_error(int error)
ui->btn_SpeedStartStop->setEnabled(false);
ui->check_SpeedSyncReceive->setEnabled(true);
ui->combo_SpeedDataType->setEnabled(true);
ui->edit_speed_test_minimum_buffer_size->setEnabled(true);
ui->edit_speed_test_chunk_append_size->setEnabled(true);
if (ui->combo_SpeedDataType->currentIndex() == 1)
{
//Enable string options
Expand Down

0 comments on commit 8baf58a

Please sign in to comment.