dynamicFunctionObjectListProxy::dynamicFunctionObjectListProxy
(
    const word& name,
    const Time& t,
    const dictionary& dict,
    const char *providerNameStr
)
:
    functionObjectListProxy(
        name,
        t,
        dict,
        false
    )
{
    word providerName(providerNameStr);
    if(providerName.size()==0) {
        providerName=word(dict.lookup("dictionaryProvider"));
    }
    provider_=dynamicDictionaryProvider::New(
        providerName,
        dict,
        (*this)
    );

    if(
        readBool(dict.lookup("readDuringConstruction"))
    ) {
        if(writeDebug()) {
            Info << this->name() << " list initialized during construction" << endl;
        }
        read(dict);
    }
}
void AdapterSettings::validateAdapterSettings()
{

    // validating for P2P use only in anticipation of INTEGRATION MODE being moved to a different adapter

    if (accountName().length() > 0 && providerName().length() > 0 && p2pModeApproverName().length() > 0 && p2pModeApproverEmail().length() > 0 && p2pClientUserId().length() > 0) {
        qDebug() << "EEEE adapter has values for all required settings";
        setConfigured(true);
    } else {
        qDebug() << "EEEE adapter does not have values for all required settings";
        setConfigured(false);
    }

}
Пример #3
0
void SettingsPage::createContent()
{
    Q_D(SettingsPage);

    setStyleName("AccountsUiPage");

    //% "%1 settings"
    setTitle(qtTrId("qtn_acc_ser_prof_set_title").arg(d->context->service().name()));

    MWidget *upperWidget = new MWidget(this);
    MLayout *upperLayout = new MLayout(upperWidget);
    MLinearLayoutPolicy *upperLayoutPolicy = new MLinearLayoutPolicy(upperLayout, Qt::Vertical);
    upperLayoutPolicy->setSpacing(0);

    MLayout *horizontalLayout = new MLayout();
    MLinearLayoutPolicy *horizontalLayoutPolicy = new MLinearLayoutPolicy(horizontalLayout, Qt::Horizontal);

    QString providerName(d->context->account()->providerName());
    QString providerIconId;
    // xml file that describes the ui elements for the provider
    Accounts::Provider provider = AccountsManager::instance()->provider(providerName);
    if (provider.isValid()) {
        QDomElement root = provider.domDocument().documentElement();
        QDomElement providerIcon = root.firstChildElement("icon");
        providerIconId = providerIcon.text();
    }

    ServiceHelper *serviceHepler =
        new ServiceHelper(d->context->service(), this);
    BasicHeaderWidget *usernameAndStatus = 0;

    if (d->context->account()->id() == 0) {
        usernameAndStatus = new BasicHeaderWidget(BasicHeaderWidget::IconWithTitle, this);
        usernameAndStatus->createLayout();
    } else {
        usernameAndStatus = new BasicHeaderWidget(BasicHeaderWidget::IconWithTitleAndSubTitle, this);
        usernameAndStatus->createLayout();
        usernameAndStatus->setSubtitle(qtTrId(d->context->account()->displayName().toLatin1()));
    }

    usernameAndStatus->setImage(providerIconId);
    usernameAndStatus->setTitle(serviceHepler->prettyName());

    MSeparator *separatorTop = new MSeparator(this);
    separatorTop->setStyleName("CommonHeaderDividerInverted");
    separatorTop->setOrientation(Qt::Horizontal);

    d->context->account()->selectService(d->context->service());

    horizontalLayoutPolicy->addItem(usernameAndStatus, Qt::AlignLeft | Qt::AlignVCenter);
    upperLayoutPolicy->addItem(horizontalLayout);
    upperLayoutPolicy->addItem(separatorTop);

    MWidget *widget = d->context->widget(this);

    MWidget *centralWidget = new MWidget(this);
    MLayout *layout = new MLayout(centralWidget);
    MLinearLayoutPolicy *layoutPolicy = new MLinearLayoutPolicy(layout, Qt::Vertical);
    layoutPolicy->addItem(upperWidget);

    layoutPolicy->addItem(widget);
    layoutPolicy->addStretch();

    setCentralWidget(centralWidget);
}