Пример #1
0
void LoginDialog::profileChanged(int)
{
    if (m_client)
        return;
    int n = cmbProfile->currentItem();
    if (n < 0){
        clearInputs();
        buttonOk->setEnabled(false);
        btnDelete->setEnabled(false);
        return;
    }
    buttonOk->setEnabled(true);
    if (n >= (int)cmbProfile->count() - 1){
        lblPasswd->hide();
        clearInputs();
        btnDelete->setEnabled(false);
    }else{
        clearInputs();
        CorePlugin::m_plugin->setProfile(CorePlugin::m_plugin->m_profiles[n].c_str());
        ClientList clients;
        CorePlugin::m_plugin->loadClients(clients);
        unsigned nClients = 0;
        unsigned i;
        for (i = 0; i < clients.size(); i++){
            if (clients[i]->protocol()->description()->flags & PROTOCOL_NO_AUTH)
                continue;
            nClients++;
        }
        if (nClients > 1){
            lblPasswd->show();
        }else{
            lblPasswd->hide();
        }
        unsigned row = 2;
        if (nClients == 1){
            makeInputs(row, clients[0], true);
        }else{
            for (unsigned i = 0; i < clients.size(); i++){
                if (clients[i]->protocol()->description()->flags & PROTOCOL_NO_AUTH)
                    continue;
                makeInputs(row, clients[i], false);
            }
        }
        if (passwords.size())
            passwords[0]->setFocus();
        btnDelete->setEnabled(m_loginProfile == CorePlugin::m_plugin->m_profiles[n].c_str());
        buttonOk->setEnabled(false);
        pswdChanged("");
    }
    QTimer::singleShot(0, this, SLOT(adjust()));
}
Пример #2
0
Action::~Action()
{
    if (m_entryPoint)
        delete m_entryPoint;
    
    clearInputs();
}
Пример #3
0
void
FutureBucket::clear()
{
    mState = FB_CLEAR;
    clearInputs();
    clearOutput();
}
Пример #4
0
        void Bind(BindingFn binding)
        {
            clearInputs(); // resets binding!

            m_binding = std::move(binding);

            evaluate(); // captures new inputs

            evaluateOutputs();
        }
Пример #5
0
void LoginDialog::profileChanged(int)
{
    if (m_client)
        return;
    int n = cmbProfile->currentItem();
    if (n < 0){
        clearInputs();
        buttonOk->setEnabled(false);
        btnDelete->setEnabled(false);
        return;
    }
    buttonOk->setEnabled(true);
    if (n >= (int)cmbProfile->count() - 1){
        lblPasswd->hide();
        clearInputs();
        btnDelete->setEnabled(false);
    }else{
        clearInputs();
        CorePlugin::m_plugin->setProfile(CorePlugin::m_plugin->m_profiles[n].c_str());
        ClientList clients;
        CorePlugin::m_plugin->loadClients(clients);
        if (clients.size() > 1){
            lblPasswd->show();
        }else{
            lblPasswd->hide();
        }
        if (clients.size() == 1){
            QLabel *txt = new QLabel(this);
            txt->setText(i18n("Password:"));
            txt->setAlignment(AlignRight);
            QLineEdit *edt = new QLineEdit(this);
            edt->setText(clients[0]->getPassword());
            edt->setEchoMode(QLineEdit::Password);
            connect(edt, SIGNAL(textChanged(const QString&)), this, SLOT(pswdChanged(const QString&)));
            passwords.push_back(edt);
            texts.push_back(txt);
            PLayout->addWidget(txt, 2, 1);
            PLayout->addWidget(edt, 2, 2);
            edt->show();
            txt->show();
        }else{
            for (unsigned i = 0; i < clients.size(); i++){
Пример #6
0
void LoginDialog::profileChanged(int)
{
    if (m_client)
        return;
    int n = cmbProfile->currentItem();
    if (n < 0){
        clearInputs();
        buttonOk->setEnabled(false);
        btnDelete->setEnabled(false);
        return;
    }
    buttonOk->setEnabled(true);
    if (n >= (int)cmbProfile->count() - 1){
        lblPasswd->hide();
        clearInputs();
        btnDelete->setEnabled(false);
    }else{
        clearInputs();
        CorePlugin::m_plugin->setProfile(CorePlugin::m_plugin->m_profiles[n].c_str());
        ClientList clients;
        CorePlugin::m_plugin->loadClients(clients);
        if (clients.size() > 1){
            lblPasswd->show();
        }else{
            lblPasswd->hide();
        }
        unsigned row = 2;
        if (clients.size() == 1){
            makeInputs(row, clients[0], true);
        }else{
            for (unsigned i = 0; i < clients.size(); i++)
                makeInputs(row, clients[i], false);
        }
        if (passwords.size())
            passwords[0]->setFocus();
        btnDelete->setEnabled(m_loginProfile == CorePlugin::m_plugin->m_profiles[n].c_str());
        buttonOk->setEnabled(false);
        pswdChanged("");
    }
}
Пример #7
0
void LoginDialog::profileDelete()
{
    int n = cmbProfile->currentItem();
    if ((n < 0) || (n >= (int)(CorePlugin::m_plugin->m_profiles.size())))
        return;
    string curProfile = CorePlugin::m_plugin->m_profiles[n];
    CorePlugin::m_plugin->setProfile(curProfile.c_str());
    rmDir(QFile::decodeName(user_file("").c_str()));
    CorePlugin::m_plugin->setProfile(NULL);
    CorePlugin::m_plugin->changeProfile();
    CorePlugin::m_plugin->m_profiles.clear();
    CorePlugin::m_plugin->loadDir();
    clearInputs();
    btnDelete->setEnabled(false);
    fill();
}
Пример #8
0
        void Assign(T value)
        {
            // Clear inputs and binding since
            // assignment breaks bindings
            clearInputs();

            // Save new value
            m_value = std::move(value);

            // Notify
            if(m_notifier) {
                m_notifier(m_value);
            }

            evaluateOutputs();
        }
Пример #9
0
Region::~Region() {
  if (initialized_)
    uninitialize();

  // If there are any links connected to our outputs, this should fail.
  // We catch this error in the Network class and give the
  // user a good error message (regions may be removed either in
  // Network::removeRegion or Network::~Network())
  for (auto &elem : outputs_) {
    delete elem.second;
    elem.second = nullptr;
  }
  outputs_.clear();

  clearInputs(); // just in case there are some still around.

  // Note: the impl will be deleted when the region goes out of scope.
}
Пример #10
0
std::shared_ptr<Bucket>
FutureBucket::resolve()
{
    checkState();
    assert(isLive());
    clearInputs();
    std::shared_ptr<Bucket> bucket = mOutputBucket.get();
    if (mOutputBucketHash.empty())
    {
        mOutputBucketHash = binToHex(bucket->getHash());
    }
    else
    {
        checkHashEq(bucket, mOutputBucketHash);
    }
    mState = FB_LIVE_OUTPUT;
    checkState();
    return bucket;
}
Пример #11
0
void ModelData::clear()
{
  memset(this, 0, sizeof(ModelData));
  moduleData[0].channelsCount = 8;
  moduleData[1].channelsStart = 0;
  moduleData[1].channelsCount = 8;
  moduleData[0].ppmDelay = 300;
  moduleData[1].ppmDelay = 300;
  moduleData[2].ppmDelay = 300;
  int board = GetEepromInterface()->getBoard();
  if (IS_TARANIS(board)) {
    moduleData[0].protocol=PXX_XJT_X16;
    moduleData[1].protocol=OFF;
  }
  else {
    moduleData[0].protocol=PPM;
    moduleData[1].protocol=OFF;      
  }
  for (int i=0; i<C9X_MAX_FLIGHT_MODES; i++) {
    flightModeData[i].clear();
  }
  clearInputs();
  clearMixes();
  for (int i=0; i<C9X_NUM_CHNOUT; i++)
    limitData[i].clear();
  for (int i=0; i<NUM_STICKS; i++)
    expoData[i].clear();
  for (int i=0; i<C9X_NUM_CSW; i++)
    customSw[i].clear();
  for (int i=0; i<C9X_MAX_CUSTOM_FUNCTIONS; i++)
    funcSw[i].clear();
  for (int i=0; i<C9X_MAX_CURVES; i++)
    curves[i].clear(5);
  for (int i=0; i<2; i++)
    timers[i].clear();
  swashRingData.clear();
  frsky.clear();
}
Пример #12
0
 ~DynamicProperty()
 {
     clearInputs();
     clearOutputs();
 }
Пример #13
0
/*luadoc
@function model.deleteInputs()

Delete all Inputs 

@status current Introduced in 2.0.0
*/
static int luaModelDeleteInputs(lua_State *L)
{
  clearInputs();
  return 0;
}