2013-06-04, 17:12
Hi friends,
I am trying to provide facility to set IP addess manually through xbmc GUI.
I have searched on internet and have come to conclusion that it was provided many years ago but is now removed.
And to set up IP address one must set it through underlying OS, through network manager or by directly editing the "/etc/network/interfaces"
But I have to provide this facility in xbmc GUI in settings.
So,
In file "xbmc-12.0/xbmc/settings/GUISettings.cpp"
In function "void CGUISettings::Initialize()"
I added following:
Now these are visible in desired category(new one called prefs that I have created), but they were not editable.
So then,
In function "void CGUIWindowSettingsCategory::UpdateSettings()"
I passed true for argument "enabled"
if (pControl) pControl->SetEnabled(enabled);
for the part that follows:
else if (strSetting.Equals("network.ipaddress") || strSetting.Equals("network.subnet") || strSetting.Equals("network.gateway") || strSetting.Equals("network.dns"))
and
else if (strSetting.Equals("network.assignment"))
and now they are visible + Enabled, so I can change their values, I just want to set IP address, so I set the
Assignment to Manual(Static)
and set an IP address and it got saved in "guisettings.xml" so when I restarted the xbmc those newly set values were loaded and are visible but, the IP address was never set to the operating system or computer.
Please help.
Thank You in advance.
I am trying to provide facility to set IP addess manually through xbmc GUI.
I have searched on internet and have come to conclusion that it was provided many years ago but is now removed.
And to set up IP address one must set it through underlying OS, through network manager or by directly editing the "/etc/network/interfaces"
But I have to provide this facility in xbmc GUI in settings.
So,
In file "xbmc-12.0/xbmc/settings/GUISettings.cpp"
In function "void CGUISettings::Initialize()"
I added following:
PHP Code:
CSettingsCategory* network_settings = AddCategory(SETTINGS_PREFS, "network", 798);
AddString(network_settings, "network.interface",775,"", SPIN_CONTROL_TEXT);
map<int, int> networkAssignments;
networkAssignments.insert(make_pair(716, NETWORK_DHCP));
networkAssignments.insert(make_pair(717, NETWORK_STATIC));
networkAssignments.insert(make_pair(787, NETWORK_DISABLED));
AddInt(network_settings, "network.assignment", 715, NETWORK_DHCP, networkAssignments, SPIN_CONTROL_TEXT);
AddString(network_settings, "network.ipaddress", 719, "0.0.0.0", EDIT_CONTROL_IP_INPUT, true);
AddString(NULL, "network.ipaddress", 719, "0.0.0.0", EDIT_CONTROL_IP_INPUT);
AddString(network_settings, "network.subnet", 720, "255.255.255.0", EDIT_CONTROL_IP_INPUT, true);
AddString(network_settings, "network.gateway", 721, "0.0.0.0", EDIT_CONTROL_IP_INPUT, true);
AddString(network_settings, "network.dns", 722, "0.0.0.0", EDIT_CONTROL_IP_INPUT, true);
AddString(network_settings, "network.dnssuffix", 22002, "", EDIT_CONTROL_INPUT, true);
AddString(network_settings, "network.essid", 776, "0.0.0.0", BUTTON_CONTROL_STANDARD, true);
Now these are visible in desired category(new one called prefs that I have created), but they were not editable.
So then,
In function "void CGUIWindowSettingsCategory::UpdateSettings()"
I passed true for argument "enabled"
if (pControl) pControl->SetEnabled(enabled);
for the part that follows:
else if (strSetting.Equals("network.ipaddress") || strSetting.Equals("network.subnet") || strSetting.Equals("network.gateway") || strSetting.Equals("network.dns"))
and
else if (strSetting.Equals("network.assignment"))
and now they are visible + Enabled, so I can change their values, I just want to set IP address, so I set the
Assignment to Manual(Static)
and set an IP address and it got saved in "guisettings.xml" so when I restarted the xbmc those newly set values were loaded and are visible but, the IP address was never set to the operating system or computer.
Please help.
Thank You in advance.