| 336 | } |
| 337 | |
| 338 | void MemoryCardSettingsWidget::refresh() |
| 339 | { |
| 340 | const bool perGame = dialog()->isPerGameSettings(); |
| 341 | |
| 342 | for (u32 slot = 0; slot < static_cast<u32>(m_slots.size()); slot++) |
| 343 | { |
| 344 | const bool enabled = m_slots[slot].enable->isChecked(); |
| 345 | const std::string slotKey = getSlotFilenameKey(slot); |
| 346 | const std::optional<std::string> name( |
| 347 | dialog()->getEffectiveStringValue(CONFIG_SECTION, slotKey.c_str(), FileMcd_GetDefaultName(slot).c_str())); |
| 348 | const bool inherited = perGame ? !dialog()->containsSettingValue(CONFIG_SECTION, slotKey.c_str()) : false; |
| 349 | |
| 350 | m_slots[slot].slot->setCard(name, inherited); |
| 351 | m_slots[slot].slot->setEnabled(enabled); |
| 352 | m_slots[slot].eject->setEnabled(enabled); |
| 353 | } |
| 354 | |
| 355 | m_ui.cardList->refresh(dialog()); |
| 356 | updateCardActions(); |
| 357 | } |
| 358 | |
| 359 | void MemoryCardSettingsWidget::swapCards() |
| 360 | { |
nothing calls this directly
no test coverage detected