remoteiso gui settings

This commit is contained in:
Fireball Wayne
2017-03-11 00:46:49 -05:00
parent 6dd0f7a152
commit ce7a93e24c
2 changed files with 29 additions and 0 deletions
+28
View File
@@ -594,6 +594,16 @@ void GameSettingsScreen::CreateViews() {
networkingSettings->Add(new CheckBox(&g_Config.bEnableAdhocServer, n->T("Enable built-in PRO Adhoc Server", "Enable built-in PRO Adhoc Server")));
networkingSettings->Add(new ChoiceWithValueDisplay(&g_Config.sMACAddress, n->T("Change Mac Address"), nullptr))->OnClick.Handle(this, &GameSettingsScreen::OnChangeMacAddress);
networkingSettings->Add(new PopupSliderChoice(&g_Config.iPortOffset, 0, 60000, n->T("Port offset", "Port offset(0 = PSP compatibility)"), 100, screenManager()));
networkingSettings->Add(new ItemHeader(ms->T("Remote Disc Streaming")));
networkingSettings->Add(new CheckBox(&g_Config.bRemoteISOManual , n->T("Manual Mode Client", "Manual Mode Client")));
PopupTextInputChoice *remoteServer = networkingSettings->Add(new PopupTextInputChoice(&g_Config.sLastRemoteISOServer, n->T("Remote Server"), "", 255, screenManager()));
remoteServer->SetEnabledPtr(&g_Config.bRemoteISOManual);
PopupSliderChoice *remotePort = networkingSettings->Add(new PopupSliderChoice(&g_Config.iLastRemoteISOPort , 0, 65535, n->T("Remote Port", "Remote Port"), 100, screenManager()));
remotePort->SetEnabledPtr(&g_Config.bRemoteISOManual);
PopupTextInputChoice *remoteSubdir = networkingSettings->Add(new PopupTextInputChoice(&g_Config.sRemoteISOSubdir , n->T("Remote Subdirectory"), "", 255, screenManager()));
remoteSubdir->SetEnabledPtr(&g_Config.bRemoteISOManual);
remoteSubdir->OnChange.Handle(this, &GameSettingsScreen::OnChangeRemoteISOSubdir);
networkingSettings->Add(new PopupSliderChoice(&g_Config.iRemoteISOPort , 0, 65535, n->T("Local Server Port", "Local Server Port"), 100, screenManager()));
ViewGroup *toolsScroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, FILL_PARENT));
toolsScroll->SetTag("GameSettingsTools");
@@ -1077,6 +1087,24 @@ UI::EventReturn GameSettingsScreen::OnChangeMacAddress(UI::EventParams &e) {
return UI::EVENT_DONE;
}
UI::EventReturn GameSettingsScreen::OnChangeRemoteISOSubdir(UI::EventParams &e) {
//sanity checks
for (size_t i = 0; i < g_Config.sRemoteISOSubdir.length(); i++)
{
if (g_Config.sRemoteISOSubdir[i] == ' ') g_Config.sRemoteISOSubdir[i] = '+';
if (g_Config.sRemoteISOSubdir[i] == '\\') g_Config.sRemoteISOSubdir[i] = '/';
if (g_Config.sRemoteISOSubdir[i] == '?') {
g_Config.sRemoteISOSubdir.erase(i); //truncate
break;
}
}
if (g_Config.sRemoteISOSubdir[0] != '/')
g_Config.sRemoteISOSubdir = "/" + g_Config.sRemoteISOSubdir;
if (g_Config.sRemoteISOSubdir[g_Config.sRemoteISOSubdir.length() - 1] != '/')
g_Config.sRemoteISOSubdir += "/";
return UI::EVENT_DONE;
}
UI::EventReturn GameSettingsScreen::OnCombo_key(UI::EventParams &e) {
screenManager()->push(new Combo_keyScreen(&g_Config.iComboMode));
return UI::EVENT_DONE;