Project

General

Profile

Feature #366 » DNS2.patch

antonic901, 01/04/2023 09:42 PM

View differences:

language/English (US)/strings.po (working copy)
msgctxt "#34005"
msgid "Flac"
msgstr "Flac"
msgctxt "#34006"
msgid "- Primary DNS"
msgstr ""
msgctxt "#34007"
msgid "- Secondary DNS"
msgstr ""
language/English/strings.po (working copy)
msgctxt "#34005"
msgid "Flac"
msgstr ""
msgctxt "#34006"
msgid "- Primary DNS"
msgstr ""
msgctxt "#34007"
msgid "- Secondary DNS"
msgstr ""
xbmc/Application.cpp (working copy)
switch( (*it) )
{
case NETWORK_DASH:
FEH_TextOut(pFont, iLine, L"Init network using dash settings...");
m_network.Initialize(NETWORK_DASH, "","","","");
break;
FEH_TextOut(pFont, iLine, L"Init network using dash settings...");
m_network.Initialize(NETWORK_DASH, "","","","","");
break;
case NETWORK_DHCP:
FEH_TextOut(pFont, iLine, L"Init network using DHCP...");
m_network.Initialize(NETWORK_DHCP, "","","","");
break;
FEH_TextOut(pFont, iLine, L"Init network using DHCP...");
m_network.Initialize(NETWORK_DHCP, "","","","","");
break;
default:
FEH_TextOut(pFont, iLine, L"Init network using static ip...");
if( m_bXboxMediacenterLoaded )
{
m_network.Initialize(NETWORK_STATIC,
g_guiSettings.GetString("network.ipaddress").c_str(),
g_guiSettings.GetString("network.subnet").c_str(),
g_guiSettings.GetString("network.gateway").c_str(),
g_guiSettings.GetString("network.dns").c_str() );
}
else
{
m_network.Initialize(NETWORK_STATIC,
"192.168.0.42",
"255.255.255.0",
"192.168.0.1",
"192.168.0.1" );
}
break;
}
FEH_TextOut(pFont, iLine, L"Init network using static ip...");
if( m_bXboxMediacenterLoaded )
{
m_network.Initialize(NETWORK_STATIC,
g_guiSettings.GetString("network.ipaddress").c_str(),
g_guiSettings.GetString("network.subnet").c_str(),
g_guiSettings.GetString("network.gateway").c_str(),
g_guiSettings.GetString("network.dns").c_str(),
g_guiSettings.GetString("network.dns2").c_str() );
}
else
{
m_network.Initialize(NETWORK_STATIC,
"192.168.0.42",
"255.255.255.0",
"192.168.0.1",
"192.168.0.1",
"0.0.0.0" );
}
break;
}
#ifdef HAS_XBOX_NETWORK
DWORD dwState = XNET_GET_XNADDR_PENDING;
......
g_guiSettings.SetString("network.subnet", "255.255.255.0");
g_guiSettings.SetString("network.gateway", "192.168.0.1");
g_guiSettings.SetString("network.dns", "192.168.0.1");
g_guiSettings.SetString("network.dns2", "0.0.0.0");
g_guiSettings.SetBool("services.ftpserver", true);
g_guiSettings.SetBool("services.webserver", false);
g_guiSettings.SetBool("locale.timeserver", false);
xbmc/settings/GUISettings.cpp (working copy)
AddString(2, "network.ipaddress", 719, "0.0.0.0", EDIT_CONTROL_IP_INPUT);
AddString(3, "network.subnet", 720, "255.255.255.0", EDIT_CONTROL_IP_INPUT);
AddString(4, "network.gateway", 721, "0.0.0.0", EDIT_CONTROL_IP_INPUT);
AddString(5, "network.dns", 722, "0.0.0.0", EDIT_CONTROL_IP_INPUT);
AddString(6, "network.dnssuffix", 22002, "", EDIT_CONTROL_INPUT, true);
AddInt(7, "network.bandwidth", 14042, 0, 0, 512, 100*1024, SPIN_CONTROL_INT_PLUS, MASK_KBPS, TEXT_OFF);
AddString(5, "network.dns", 34006, "0.0.0.0", EDIT_CONTROL_IP_INPUT);
AddString(6, "network.dns2", 34007, "0.0.0.0", EDIT_CONTROL_IP_INPUT);
AddString(7, "network.dnssuffix", 22002, "", EDIT_CONTROL_INPUT, true);
AddInt(8, "network.bandwidth", 14042, 0, 0, 512, 100*1024, SPIN_CONTROL_INT_PLUS, MASK_KBPS, TEXT_OFF);
AddSeparator(12, "network.sep1");
AddBool(13, "network.usehttpproxy", 708, false);
xbmc/settings/GUIWindowSettingsCategory.cpp (working copy)
pControl->SetEnabled(g_guiSettings.GetBool("services.webserver"));
}
}
else if (strSetting.Equals("network.ipaddress") || strSetting.Equals("network.subnet") || strSetting.Equals("network.gateway") || strSetting.Equals("network.dns"))
else if (strSetting.Equals("network.ipaddress") || strSetting.Equals("network.subnet") || strSetting.Equals("network.gateway") || strSetting.Equals("network.dns") || strSetting.Equals("network.dns2"))
{
CGUIButtonControl *pControl = (CGUIButtonControl *)GetControl(pSettingControl->GetID());
if (pControl)
......
pControl->SetLabel2(g_application.getNetwork().m_networkinfo.gateway);
else if(strSetting.Equals("network.dns"))
pControl->SetLabel2(g_application.getNetwork().m_networkinfo.DNS1);
else if(strSetting.Equals("network.dns2"))
pControl->SetLabel2(g_application.getNetwork().m_networkinfo.DNS2);
}
pControl->SetEnabled(g_guiSettings.GetInt("network.assignment") == NETWORK_STATIC);
}
......
g_guiSettings.SetString("network.gateway",strDefault);
if (g_guiSettings.GetString("network.dns").Equals("0.0.0.0"))
g_guiSettings.SetString("network.dns",strDefault);
if (g_guiSettings.GetString("network.dns2").Equals("0.0.0.0"))
g_guiSettings.SetString("network.dns2",strDefault);
}
}
......
m_strNetworkIPAddress != g_guiSettings.GetString("network.ipaddress") ||
m_strNetworkSubnet != g_guiSettings.GetString("network.subnet") ||
m_strNetworkGateway != g_guiSettings.GetString("network.gateway") ||
m_strNetworkDNS != g_guiSettings.GetString("network.dns"))))
m_strNetworkDNS != g_guiSettings.GetString("network.dns") ||
m_strNetworkDNS2 != g_guiSettings.GetString("network.dns2"))))
{
/* // our network settings have changed - we should prompt the user to reset XBMC
if (CGUIDialogYesNo::ShowAndGetInput(14038, 14039, 14040, 0))
......
m_strNetworkSubnet = g_guiSettings.GetString("network.subnet");
m_strNetworkGateway = g_guiSettings.GetString("network.gateway");
m_strNetworkDNS = g_guiSettings.GetString("network.dns");
m_strNetworkDNS2 = g_guiSettings.GetString("network.dns2");
// replace settings
/* g_guiSettings.SetInt("network.assignment", m_iNetworkAssignment);
g_guiSettings.SetString("network.ipaddress", m_strNetworkIPAddress);
g_guiSettings.SetString("network.subnet", m_strNetworkSubnet);
g_guiSettings.SetString("network.gateway", m_strNetworkGateway);
g_guiSettings.SetString("network.dns", m_strNetworkDNS);*/
g_guiSettings.SetString("network.dns", m_strNetworkDNS);2
g_guiSettings.SetString("network.dns2", m_strNetworkDNS2);*/
}
}
......
m_strNetworkSubnet = g_guiSettings.GetString("network.subnet");
m_strNetworkGateway = g_guiSettings.GetString("network.gateway");
m_strNetworkDNS = g_guiSettings.GetString("network.dns");
m_strNetworkDNS2 = g_guiSettings.GetString("network.dns2");
m_strOldTrackFormat = g_guiSettings.GetString("musicfiles.trackformat");
m_strOldTrackFormatRight = g_guiSettings.GetString("musicfiles.trackformatright");
m_NewResolution = INVALID;
xbmc/settings/GUIWindowSettingsCategory.h (working copy)
CStdString m_strNetworkSubnet;
CStdString m_strNetworkGateway;
CStdString m_strNetworkDNS;
CStdString m_strNetworkDNS2;
// look + feel settings (for delayed loading)
CStdString m_strNewSkinFontSet;
CStdString m_strNewSkin;
xbmc/xbox/Network.cpp (working copy)
}
#endif
bool CNetwork::Initialize(int iAssignment, const char* szLocalAddress, const char* szLocalSubnet, const char* szLocalGateway, const char* szNameServer)
bool CNetwork::Initialize(int iAssignment, const char* szLocalAddress, const char* szLocalSubnet, const char* szLocalGateway, const char* szNameServer, const char* szNameServeralt)
{
#ifdef HAS_XBOX_NETWORK
XNetStartupParams xnsp = {};
......
strcpy(m_networkinfo.subnet, szLocalSubnet);
strcpy(m_networkinfo.gateway, szLocalGateway);
strcpy(m_networkinfo.DNS1, szNameServer);
strcpy(m_networkinfo.DNS2, szNameServeralt);
TranslateConfig(m_networkinfo, params);
CLog::Log(LOGNOTICE, "Network: Using static IP settings");
......
g_guiSettings.GetString("network.ipaddress").c_str(),
g_guiSettings.GetString("network.subnet").c_str(),
g_guiSettings.GetString("network.gateway").c_str(),
g_guiSettings.GetString("network.dns").c_str());
g_guiSettings.GetString("network.dns").c_str(),
g_guiSettings.GetString("network.dns2").c_str());
return true;
}
xbmc/xbox/Network.h (working copy)
~CNetwork(void);
/* initializes network settings */
bool Initialize(int iAssignment, const char* szLocalAddress, const char* szLocalSubnet, const char* szLocalGateway, const char* szNameServer);
bool Initialize(int iAssignment, const char* szLocalAddress, const char* szLocalSubnet, const char* szLocalGateway, const char* szNameServer, const char* szNameServeralt);
void Deinitialize();
/* waits for network to finish init */
(1-1/2)