diff options
author | pommicket <pommicket@gmail.com> | 2025-08-21 14:32:29 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2025-08-21 14:32:29 -0400 |
commit | 4702e6bb96ed5f943039956224b8a5e28d862c75 (patch) | |
tree | 1d4542d55cc6114c54f3c9b94a7b3166785c2162 | |
parent | fe37762ef767818eb7edfb8de4e64bc638b3db5b (diff) |
Fix bug with Macondo simulate
-rw-r--r-- | quacker/macondo.cpp | 11 | ||||
-rw-r--r-- | quacker/macondo.h | 1 | ||||
-rw-r--r-- | quacker/quacker.cpp | 5 |
3 files changed, 14 insertions, 3 deletions
diff --git a/quacker/macondo.cpp b/quacker/macondo.cpp index 831e94d..3b301c4 100644 --- a/quacker/macondo.cpp +++ b/quacker/macondo.cpp @@ -15,9 +15,13 @@ TODO: #include <QGridLayout> #include <QPushButton> #include <QCheckBox> +#include <QLabel> +#include <QGroupBox> Macondo::Macondo(Quackle::Game *game) : View() { m_game = game; + QFont boldFont; + boldFont.setWeight(QFont::Bold); m_useMacondo = new QCheckBox(tr("Use Macondo for 'Simulate'")); const char *home = getenv("HOME"); std::string execPath = home ? home : "/"; @@ -27,10 +31,17 @@ Macondo::Macondo(Quackle::Game *game) : View() { connectBackendSignals(); m_solve = new QPushButton(tr("Solve")); m_solve->setDisabled(true); + QGroupBox *pegBox = new QGroupBox(tr("Pre-endgame options")); + QVBoxLayout *pegLayout = new QVBoxLayout; + m_generatedMovesOnly = new QCheckBox(tr("Generated moves only")); + m_generatedMovesOnly->setToolTip("Only analyze the moves that have been generated in the 'Choices' box."); + pegLayout->addWidget(m_generatedMovesOnly); QGridLayout *layout = new QGridLayout(this); + pegBox->setLayout(pegLayout); layout->setAlignment(Qt::AlignTop); layout->addWidget(m_useMacondo, 0, 0); layout->addWidget(m_solve, 1, 0); + layout->addWidget(pegBox, 2, 0); connect(m_solve, SIGNAL(clicked()), this, SLOT(solve())); } diff --git a/quacker/macondo.h b/quacker/macondo.h index 27d3fb7..a8916c9 100644 --- a/quacker/macondo.h +++ b/quacker/macondo.h @@ -43,6 +43,7 @@ private: void connectBackendSignals(); void updateSolveButton(); QCheckBox *m_useMacondo; + QCheckBox *m_generatedMovesOnly; QPushButton *m_solve; Quackle::Game *m_game; MacondoBackend *m_backend; diff --git a/quacker/quacker.cpp b/quacker/quacker.cpp index cf1b4c7..c15b826 100644 --- a/quacker/quacker.cpp +++ b/quacker/quacker.cpp @@ -1063,11 +1063,10 @@ void TopLevel::simulate(bool startSimulation) // it's not so useful to have sim control show/hide // like this //m_simulatorWidget->setVisible(startSimulation); - if (m_macondo->useForSimulation()) { - m_macondo->simulate(); - } if (startSimulation) { + if (m_macondo->useForSimulation()) + m_macondo->simulate(); logfileChanged(); incrementSimulation(); } |