Example #1
0
InterfaceListItem*
InterfacesListView::FindItem(const char* name)
{
	for (int32 i = CountItems(); i-- > 0;) {
		InterfaceListItem* item = dynamic_cast<InterfaceListItem*>(ItemAt(i));
		if (item == NULL)
			continue;

		if (strcmp(item->Name(), name) == 0)
			return item;
	}

	return NULL;
}
Example #2
0
status_t
InterfacesListView::SaveItems()
{
	// Grab each fSettings instance and write it's settings
	for (int32 i = CountItems(); i-- > 0;) {
		InterfaceListItem* item = dynamic_cast<InterfaceListItem*>(ItemAt(i));
		if (item == NULL)
			continue;

		if (strcmp(item->Name(), "loop") == 0)
			continue;

		NetworkSettings* ns = item->GetSettings();
		// TODO : SetConfiguration doesn't use the interface settings file
		ns->SetConfiguration();
	}

	return B_OK;
}
Example #3
0
void
NetworkWindow::_SelectItem(BListItem* listItem)
{
	while (fAddOnShellView->CountChildren() > 0)
		fAddOnShellView->ChildAt(0)->RemoveSelf();

	BView* nextView = NULL;

	BNetworkSettingsItem* item = _SettingsItemFor(listItem);
	if (item != NULL) {
		nextView = item->View();
	} else {
		InterfaceListItem* item = dynamic_cast<InterfaceListItem*>(
			listItem);
		if (item != NULL) {
			fInterfaceView->SetTo(item->Name());
			nextView = fInterfaceView;
		}
	}

	if (nextView != NULL)
		fAddOnShellView->AddChild(nextView);
}