void IPCPView::Reload() { fIsEnabled->SetValue(Addon()->IsEnabled() || Addon()->IsNew()); // enable TCP/IP by default fIPAddress->SetText(Addon()->IPAddress()); fPrimaryDNS->SetText(Addon()->PrimaryDNS()); fSecondaryDNS->SetText(Addon()->SecondaryDNS()); UpdateControls(); }
void ConnectionOptionsView::Reload() { fDialOnDemand->SetValue(Addon()->DoesDialOnDemand() || Addon()->IsNew()); // this is enabled by default fAskBeforeDialing->SetValue(Addon()->AskBeforeDialing()); fAutoRedial->SetValue(Addon()->DoesAutoRedial()); if(!Addon()->Settings()) return; UpdateControls(); }
void PPPoEView::ReloadInterfaces() { // delete all items and request a new bunch from the pppoe kernel module BMenu *menu = fInterface->Menu(); while(menu->CountItems() > 2) delete menu->RemoveItem((int32) 0); fOtherInterface->SetLabel(kLabelOtherInterface); PPPManager manager; char *interfaces = new char[8192]; // reserve enough space for approximately 512 entries int32 count = manager.ControlModule("pppoe", PPPoE_GET_INTERFACES, interfaces, 8192); BMenuItem *item; char *name = interfaces; int32 insertAt; for(int32 index = 0; index < count; index++) { item = new BMenuItem(name, new BMessage(kMsgSelectInterface)); insertAt = FindNextMenuInsertionIndex(menu, name); if(insertAt > menu->CountItems() - 2) insertAt = menu->CountItems() - 2; item->SetTarget(this); menu->AddItem(item, insertAt); name += strlen(name) + 1; } // set interface or some default value if nothing was found if(Addon()->InterfaceName() && strlen(Addon()->InterfaceName()) > 0) fInterfaceName = Addon()->InterfaceName(); else if(count > 0) fInterfaceName = interfaces; else fInterfaceName = ""; delete interfaces; item = menu->FindItem(fInterfaceName.String()); if(item && menu->IndexOf(item) <= menu->CountItems() - 2) item->SetMarked(true); else if(Addon()->InterfaceName()) { BString label(kLabelOtherInterface); label << " " << fInterfaceName; fOtherInterface->SetLabel(label.String()); fOtherInterface->SetMarked(true); } }
//--------------------------------------------------------------------------- SubMeshEx::Addon& SubMeshEx::getAddon() { UserObjectBindings& uob = this->getUserObjectBindings(); Addon* addon = uob.getUserAny().getPtr<Addon>(); if(!addon) { uob.setUserAny( (AnyLite) Addon() ); addon = uob.getUserAny().getPtr<Addon>(); } return *addon; }
int main() { auto infra = Infrastructure(); auto plat = Platform(); // auto prov = Provision(); auto soft = "gitlab"; auto config = Configure(); auto addon = Addon(); auto valid = Validate(); auto role = CodeRepository(infra, plat, soft, config, addon, valid); CodeRepository.delegator(); return 0; };
void PPPoEView::Reload() { ReloadInterfaces(); fServiceName->SetText(Addon()->ServiceName()); }
PPPoEView::~PPPoEView() { Addon()->UnregisterView(); }