Skip to content

Commit

Permalink
Merge pull request #15738 from hrydgard/confirm-mac-address
Browse files Browse the repository at this point in the history
Add confirmation dialog when generating a new Mac address
  • Loading branch information
hrydgard authored Jul 27, 2022
2 parents 52fd811 + c1a96a5 commit ad59fe0
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion UI/GameSettingsScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1637,7 +1637,17 @@ UI::EventReturn GameSettingsScreen::OnChangeproAdhocServerAddress(UI::EventParam
}

UI::EventReturn GameSettingsScreen::OnChangeMacAddress(UI::EventParams &e) {
g_Config.sMACAddress = CreateRandMAC();
auto n = GetI18NCategory("Networking");
auto di = GetI18NCategory("Dialog");

auto confirmScreen = new PromptScreen(
n->T("Change Mac Address"), di->T("Yes"), di->T("No"),
[&](bool success) {
if (success) {
g_Config.sMACAddress = CreateRandMAC();
}}
);
screenManager()->push(confirmScreen);

return UI::EVENT_DONE;
}
Expand Down

0 comments on commit ad59fe0

Please sign in to comment.