Skip to content

Commit

Permalink
qt: Show dialog when click use perfect database and enable it
Browse files Browse the repository at this point in the history
Change-Id: I7a3e31c22b88818805c07370b1f0bcf2d15822ff
  • Loading branch information
calcitem committed Oct 2, 2023
1 parent b2b93a9 commit 16d16bf
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/ui/qt/game_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,24 @@ void Game::setAlgorithm(int val) const

void Game::setUsePerfectDatabase(bool arg) noexcept
{
// TODO: If it is checked,
// the box will still pop up once when opening the program.
if (gameOptions.getUsePerfectDatabase() == false && arg == true) {
QMessageBox msgBox;
msgBox.setText(tr("Please visit the following link for detailed "
"operating "
"instructions:"));

QString url = "<a "
"href='https://github.com/calcitem/Sanmill/blob/dev/src/"
"perfect/README.md'>https://github.com/calcitem/Sanmill/"
"blob/dev/src/perfect/README.md</a>";
msgBox.setInformativeText(url);
msgBox.setTextFormat(Qt::RichText);
msgBox.setTextInteractionFlags(Qt::TextBrowserInteraction);
msgBox.exec();
}

gameOptions.setUsePerfectDatabase(arg);
settings->setValue("Options/UsePerfectDatabase", arg);
}
Expand All @@ -231,6 +249,7 @@ void Game::setPerfectDatabasePath(string val) const
QString::fromStdString(val));
}

// TODO: When call this? Same as setUsePerfectDatabase above?
void Game::setUsePerfectDatabase(bool enabled) const
{
#if 0
Expand Down

0 comments on commit 16d16bf

Please sign in to comment.