summaryrefslogtreecommitdiff
path: root/gui/gui.cc
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-04-18 19:31:17 -0400
committerbd <bdunahu@operationnull.com>2025-04-18 19:31:17 -0400
commit5e96476ae29a104df1c4526ba1037dc830207d56 (patch)
treed265a50df61bda586a819dc0305e5dccb2611f98 /gui/gui.cc
parent80063914f09975f24451ce1acb9875cea0d2d384 (diff)
Use a slider for step amount
Diffstat (limited to 'gui/gui.cc')
-rw-r--r--gui/gui.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/gui/gui.cc b/gui/gui.cc
index e2e7beb..7e3ddfe 100644
--- a/gui/gui.cc
+++ b/gui/gui.cc
@@ -54,8 +54,14 @@ GUI::GUI(QWidget *parent)
// Refresh Registers from worker thread
connect(this, &GUI::sendRefreshRegisters, worker, &Worker::refreshRegisters, Qt::QueuedConnection);
- // Advance controller by 1 step
- connect(this, &GUI::sendRunStep, worker, &Worker::runStep, Qt::QueuedConnection);
+ // Advance controller by somes steps
+ connect(this, &GUI::sendRunSteps, worker, &Worker::runSteps, Qt::QueuedConnection);
+
+ // Update the step button with step amount
+ connect(ui->step_slider, &QSlider::valueChanged, this, [=](int index){
+ int value = step_values[index];
+ ui->step_btn->setText(QString("Step %1").arg(value));
+ });
// Proper cleanup when worker finishes
connect(worker, &Worker::finished, this, &GUI::onWorkerFinished);
@@ -330,7 +336,8 @@ void GUI::on_enabl_cache_checkbox_checkStateChanged(const Qt::CheckState &arg1)
void GUI::on_step_btn_clicked()
{
qDebug() << "Run step button clicked.";
- emit sendRunStep();
+ int steps = step_values[ui->step_slider->value()];
+ emit sendRunSteps(steps);
}
void GUI::on_save_program_state_btn_clicked()