Simplified scope range dialog

This commit is contained in:
Chris Esposito 2021-03-29 15:34:57 +11:00
parent a098e6d7fb
commit b62f221056
1 changed files with 5 additions and 14 deletions

View File

@ -2380,18 +2380,13 @@ void MainWindow::on_actionI2C_triggered(bool checked)
}
void MainWindow::on_actionShow_Range_Dialog_on_Main_Page_triggered(bool checked)
{
qDebug() << "on_actionShow_Range_Dialog_on_Main_Page_triggered" << checked;
if (checked)
{
#ifndef PLATFORM_ANDROID
settings->setValue("ShowRangeDialog", true);
#endif
if (scopeRangeSwitch == nullptr)
{
scopeRangeSwitch = new scopeRangeEnterDialog(nullptr, false, ui->controller_iso->display.topRange, ui->controller_iso->display.botRange, ui->controller_iso->display.window, ui->controller_iso->display.delay);
scopeRangeSwitch->setWindowFlags(Qt::Widget);
#ifndef PLATFORM_ANDROID
ui->verticalLayout_5->insertWidget(2, scopeRangeSwitch);
#endif
connect(scopeRangeSwitch, SIGNAL(yTopUpdated(double)), ui->controller_iso, SLOT(setTopRange(double)));
connect(scopeRangeSwitch, SIGNAL(yBotUpdated(double)), ui->controller_iso, SLOT(setBotRange(double)));
connect(scopeRangeSwitch, SIGNAL(windowUpdated(double)), ui->controller_iso, SLOT(setTimeWindow(double)));
@ -2402,14 +2397,10 @@ void MainWindow::on_actionShow_Range_Dialog_on_Main_Page_triggered(bool checked)
connect(ui->controller_iso, SIGNAL(timeWindowUpdated(double)), scopeRangeSwitch, SLOT(windowChanged(double)));
connect(ui->controller_iso, SIGNAL(delayUpdated(double)), scopeRangeSwitch, SLOT(delayChanged(double)));
}
else
{
#ifndef PLATFORM_ANDROID
settings->setValue("ShowRangeDialog", false);
qDebug() << "on_actionShow_Range_Dialog_on_Main_Page_triggered" << checked;
settings->setValue("ShowRangeDialog", checked);
scopeRangeSwitch->setVisible(checked);
#endif
delete scopeRangeSwitch;
scopeRangeSwitch = nullptr;
}
}
void MainWindow::paused(bool enabled)