DolphinQt: Only show raw memory card path if it's not the default.

This commit is contained in:
Admiral H. Curtiss
2022-07-11 22:33:57 +02:00
parent d11839fd64
commit 650f172637
3 changed files with 12 additions and 2 deletions

View File

@ -644,4 +644,9 @@ std::string GetMemcardPath(std::string configured_filename, ExpansionInterface::
Config::GetDirectoryForRegion(Config::ToGameCubeRegion(used_region)), Config::GetDirectoryForRegion(Config::ToGameCubeRegion(used_region)),
blocks_string, ext); blocks_string, ext);
} }
bool IsDefaultMemcardPathConfigured(ExpansionInterface::Slot slot)
{
return Config::Get(GetInfoForMemcardPath(slot)).empty();
}
} // namespace Config } // namespace Config

View File

@ -350,4 +350,5 @@ std::string GetMemcardPath(ExpansionInterface::Slot slot, std::optional<DiscIO::
u16 size_mb = 0x80); u16 size_mb = 0x80);
std::string GetMemcardPath(std::string configured_filename, ExpansionInterface::Slot slot, std::string GetMemcardPath(std::string configured_filename, ExpansionInterface::Slot slot,
std::optional<DiscIO::Region> region, u16 size_mb = 0x80); std::optional<DiscIO::Region> region, u16 size_mb = 0x80);
bool IsDefaultMemcardPathConfigured(ExpansionInterface::Slot slot);
} // namespace Config } // namespace Config

View File

@ -300,14 +300,18 @@ void GameCubePane::UpdateButton(ExpansionInterface::Slot slot)
{ {
case ExpansionInterface::Slot::A: case ExpansionInterface::Slot::A:
case ExpansionInterface::Slot::B: case ExpansionInterface::Slot::B:
{
has_config = (device == ExpansionInterface::EXIDeviceType::MemoryCard || has_config = (device == ExpansionInterface::EXIDeviceType::MemoryCard ||
device == ExpansionInterface::EXIDeviceType::AGP || device == ExpansionInterface::EXIDeviceType::AGP ||
device == ExpansionInterface::EXIDeviceType::Microphone); device == ExpansionInterface::EXIDeviceType::Microphone);
m_memcard_path_labels[slot]->setHidden(device != ExpansionInterface::EXIDeviceType::MemoryCard); const bool hide_memory_card = device != ExpansionInterface::EXIDeviceType::MemoryCard ||
m_memcard_paths[slot]->setHidden(device != ExpansionInterface::EXIDeviceType::MemoryCard); Config::IsDefaultMemcardPathConfigured(slot);
m_memcard_path_labels[slot]->setHidden(hide_memory_card);
m_memcard_paths[slot]->setHidden(hide_memory_card);
m_agp_path_labels[slot]->setHidden(device != ExpansionInterface::EXIDeviceType::AGP); m_agp_path_labels[slot]->setHidden(device != ExpansionInterface::EXIDeviceType::AGP);
m_agp_paths[slot]->setHidden(device != ExpansionInterface::EXIDeviceType::AGP); m_agp_paths[slot]->setHidden(device != ExpansionInterface::EXIDeviceType::AGP);
break; break;
}
case ExpansionInterface::Slot::SP1: case ExpansionInterface::Slot::SP1:
has_config = (device == ExpansionInterface::EXIDeviceType::Ethernet || has_config = (device == ExpansionInterface::EXIDeviceType::Ethernet ||
device == ExpansionInterface::EXIDeviceType::EthernetXLink || device == ExpansionInterface::EXIDeviceType::EthernetXLink ||