| 324 | } |
| 325 | |
| 326 | void SetupWizardDialog::addPathToTable(const std::string& path, bool recursive) |
| 327 | { |
| 328 | const int row = m_ui.searchDirectoryList->rowCount(); |
| 329 | m_ui.searchDirectoryList->insertRow(row); |
| 330 | |
| 331 | QTableWidgetItem* item = new QTableWidgetItem(); |
| 332 | item->setText(QString::fromStdString(path)); |
| 333 | item->setFlags(item->flags() & ~(Qt::ItemIsEditable)); |
| 334 | m_ui.searchDirectoryList->setItem(row, 0, item); |
| 335 | |
| 336 | QCheckBox* cb = new QCheckBox(m_ui.searchDirectoryList); |
| 337 | m_ui.searchDirectoryList->setCellWidget(row, 1, cb); |
| 338 | cb->setChecked(recursive); |
| 339 | |
| 340 | connect(cb, &QCheckBox::checkStateChanged, this, [item](Qt::CheckState state) { |
| 341 | const std::string path(item->text().toStdString()); |
| 342 | if (state == Qt::Checked) |
| 343 | { |
| 344 | Host::RemoveBaseValueFromStringList("GameList", "Paths", path.c_str()); |
| 345 | Host::AddBaseValueToStringList("GameList", "RecursivePaths", path.c_str()); |
| 346 | } |
| 347 | else |
| 348 | { |
| 349 | Host::RemoveBaseValueFromStringList("GameList", "RecursivePaths", path.c_str()); |
| 350 | Host::AddBaseValueToStringList("GameList", "Paths", path.c_str()); |
| 351 | } |
| 352 | Host::CommitBaseSettingChanges(); |
| 353 | }); |
| 354 | } |
| 355 | |
| 356 | void SetupWizardDialog::refreshDirectoryList() |
| 357 | { |