Merge pull request #8853 from CrunchBite/feature-xlink-kai-bba

Feature XLink Kai BBA
This commit is contained in:
JMC47
2020-06-27 23:32:49 -04:00
committed by GitHub
15 changed files with 548 additions and 92 deletions

View File

@ -103,7 +103,9 @@ void GameCubePane::CreateWidgets()
for (const auto& entry :
{std::make_pair(tr("<Nothing>"), ExpansionInterface::EXIDEVICE_NONE),
std::make_pair(tr("Dummy"), ExpansionInterface::EXIDEVICE_DUMMY),
std::make_pair(tr("Broadband Adapter"), ExpansionInterface::EXIDEVICE_ETH)})
std::make_pair(tr("Broadband Adapter (TAP)"), ExpansionInterface::EXIDEVICE_ETH),
std::make_pair(tr("Broadband Adapter (XLink Kai)"),
ExpansionInterface::EXIDEVICE_ETHXLINK)})
{
m_slot_combos[2]->addItem(entry.first, entry.second);
}
@ -158,7 +160,8 @@ void GameCubePane::UpdateButton(int slot)
value == ExpansionInterface::EXIDEVICE_AGP || value == ExpansionInterface::EXIDEVICE_MIC);
break;
case SLOT_SP1_INDEX:
has_config = (value == ExpansionInterface::EXIDEVICE_ETH);
has_config = (value == ExpansionInterface::EXIDEVICE_ETH ||
value == ExpansionInterface::EXIDEVICE_ETHXLINK);
break;
}
@ -186,12 +189,26 @@ void GameCubePane::OnConfigPressed(int slot)
{
bool ok;
const auto new_mac = QInputDialog::getText(
// i18n: MAC stands for Media Access Control. A MAC address uniquely identifies a network
// interface (physical) like a serial number. "MAC" should be kept in translations.
this, tr("Broadband Adapter MAC address"), tr("Enter new Broadband Adapter MAC address:"),
QLineEdit::Normal, QString::fromStdString(SConfig::GetInstance().m_bba_mac), &ok);
if (ok)
SConfig::GetInstance().m_bba_mac = new_mac.toStdString();
return;
}
case ExpansionInterface::EXIDEVICE_ETHXLINK:
{
bool ok;
const auto new_dest = QInputDialog::getText(
this, tr("Broadband Adapter (XLink Kai) Destination Address"),
tr("Enter IP address of device running the XLink Kai Client.\nFor more information see"
" https://www.teamxlink.co.uk/wiki/Dolphin"),
QLineEdit::Normal, QString::fromStdString(SConfig::GetInstance().m_bba_xlink_ip), &ok);
if (ok)
SConfig::GetInstance().m_bba_xlink_ip = new_dest.toStdString();
return;
}
default:
qFatal("unknown settings pressed");
}