Esempio n. 1
0
void login2::sOptions()
{
  ParameterList params;
  params.append("databaseURL", _databaseURL);

  if (_multipleConnections)
    params.append("dontSaveSettings");

  if(_enhancedAuth)
    params.append("useEnhancedAuthentication");

  if(_requireSSL)
    params.append("requireSSL");

  login2Options newdlg(this, "", TRUE);
  newdlg.set(params);
  if (newdlg.exec() != QDialog::Rejected)
  {
    updateRecentOptions();
    _databaseURL = newdlg._databaseURL;
    _enhancedAuth = newdlg._enhancedAuth->isChecked();
    _requireSSL = newdlg._requireSSL->isChecked();
    populateDatabaseInfo();
    updateRecentOptions();
    updateRecentOptionsActions();
    _username->setFocus();
  }
}
Esempio n. 2
0
void login2::sChangeURL()
{
  buildDatabaseURL(_databaseURL, "psql", _server->text(), _database->lineEdit()->text(), _port->text());

  _databaseURL.replace("https://", "");
  _databaseURL.replace("http://", "");
  populateDatabaseInfo();
}
Esempio n. 3
0
void login2::selectRecentOptions()
{
  if (const QAction *action = qobject_cast<const QAction *>(sender())) 
  {
    _databaseURL = action->iconText().prepend("psql://");
    populateDatabaseInfo();
    updateRecentOptions();
    updateRecentOptionsActions();
  }
}
Esempio n. 4
0
int login::set(ParameterList &pParams, QSplashScreen *pSplash)
{
  _splash = pSplash;
  
  QVariant param;
  bool     valid;

  param = pParams.value("username", &valid);
  if (valid)
  {
    _username->setText(param.toString());
    _password->setFocus();
    _captive = TRUE;
  }
  else
  {
    _username->setFocus();
    _captive = FALSE;
  }

  param = pParams.value("copyright", &valid);
  if (valid)
    _copyrightLit->setText(param.toString());

  param = pParams.value("version", &valid);
  if (valid)
    _versionLit->setText(tr("Version ") + param.toString());

  param = pParams.value("build", &valid);
  if (valid)
    _build->setText(param.toString());

  param = pParams.value("name", &valid);
  if (valid)
  {
    _nameLit->setText(param.toString());
  }

  param = pParams.value("databaseURL", &valid);
  if (valid)
    _databaseURL = param.toString();
  else
  {
    QSettings settings;
    settings.setPath("OpenMFG.com", "OpenRPT", QSettings::UserScope);
    _databaseURL = settings.readEntry("/OpenRPT/_databaseURL", "pgsql://127.0.0.1/mfg:5432");
  }

  populateDatabaseInfo();

  return 0;
}
Esempio n. 5
0
void login::sOptions()
{
  ParameterList params;
  params.append("databaseURL", _databaseURL);

  loginOptions newdlg(this, "", TRUE);
  newdlg.set(params);
  if (newdlg.exec() != QDialog::Rejected)
  {
    _databaseURL = newdlg._databaseURL;
    populateDatabaseInfo();
  }
}
Esempio n. 6
0
void login2::sOptions()
{
  ParameterList params;
  params.append("databaseURL", _databaseURL);

  if (_multipleConnections)
    params.append("dontSaveSettings");

  login2Options newdlg(this, "", TRUE);
  newdlg.set(params);
  if (newdlg.exec() != QDialog::Rejected)
  {
    updateRecentOptions();
    _databaseURL = newdlg._databaseURL;
    populateDatabaseInfo();
    updateRecentOptions();
    updateRecentOptionsActions();
    _username->setFocus();
  }
}
Esempio n. 7
0
int login2::set(ParameterList &pParams, QSplashScreen *pSplash)
{
  _splash = pSplash;
  
  QVariant param;
  bool     valid;

  param = pParams.value("username", &valid);
  if (valid)
  {
    _username->setText(param.toString());
    _password->setFocus();
    _captive = TRUE;
  }
  else
  {
    _username->setFocus();
    _captive = FALSE;
  }

  param = pParams.value("password", &valid);
  if (valid)
  {
    _password->setText(param.toString());
    _captive = TRUE;
  }

  param = pParams.value("copyright", &valid);
  if (valid)
    _copyrightLit->setText(param.toString());

  param = pParams.value("version", &valid);
  if (valid)
    _versionLit->setText(tr("Version ") + param.toString());

  param = pParams.value("build", &valid);
  if (valid)
    _build->setText(param.toString());

  param = pParams.value("evaluation", &valid);
  if (valid)
    _demoOption->setChecked(TRUE);

  param = pParams.value("name", &valid);
  if (valid)
    _nameLit->setText(param.toString());

  param = pParams.value("databaseURL", &valid);
  if (valid)
    _databaseURL = param.toString();

  populateDatabaseInfo();

  param = pParams.value("nonxTupleDB", &valid);
  if (valid)
    _nonxTupleDB = true;

  param = pParams.value("multipleConnections", &valid);
  if (valid)
    _multipleConnections = true;

  param = pParams.value("enhancedAuth", &valid);
  if (valid)
    _enhancedAuth = param.toBool();

  param = pParams.value("requireSSL", &valid);
  if (valid)
    _requireSSL = param.toBool();

  if(pParams.inList("login"))
    sLogin();

  return 0;
}
Esempio n. 8
0
int login2::set(ParameterList &pParams, QSplashScreen *pSplash)
{
    _splash = pSplash;

    QVariant param;
    bool     valid;

    param = pParams.value("username", &valid);
    if (valid)
    {
        _username->setText(param.toString());
        _password->setFocus();
        _captive = TRUE;
    }
    else
    {
        _username->setFocus();
        _captive = FALSE;
    }

    param = pParams.value("copyright", &valid);
    if (valid)
        _copyrightLit->setText(param.toString());

    param = pParams.value("version", &valid);
    if (valid)
        _versionLit->setText(tr("Version ") + param.toString());

    param = pParams.value("build", &valid);
    if (valid)
        _build->setText(param.toString());

    param = pParams.value("evaluation", &valid);
    if (valid)
    {
        /*
            _serverLit->hide();
            _server->hide();
            _databaseLit->hide();
            _database->hide();
            _options->setEnabled(false);
        */
        _demoOption->setChecked(TRUE);
    }

    param = pParams.value("name", &valid);
    if (valid)
        _nameLit->setText(param.toString());

    param = pParams.value("databaseURL", &valid);
    if (valid)
        _databaseURL = param.toString();

    populateDatabaseInfo();

    param = pParams.value("nonxTupleDB", &valid);
    if (valid)
        _nonxTupleDB = true;

    param = pParams.value("multipleConnections", &valid);
    if (valid)
        _multipleConnections = true;

    return 0;
}
Esempio n. 9
0
int login2::set(const ParameterList &pParams, QSplashScreen *pSplash)
{
  _splash = pSplash;
  
  QVariant param;
  bool     valid;

  param = pParams.value("username", &valid);
  if (valid)
  {
    _username->setText(param.toString());
    _password->setFocus();
    _captive = TRUE;
  }
  else
  {
    _username->setFocus();
    _captive = FALSE;
  }

  param = pParams.value("password", &valid);
  if (valid)
  {
    _password->setText(param.toString());
    _captive = TRUE;
  }

  param = pParams.value("copyright", &valid);
  if (valid)
    _copyrightLit->setText(param.toString());

  param = pParams.value("version", &valid);
  if (valid)
    _versionLit->setText(tr("Version ") + param.toString());

  param = pParams.value("build", &valid);
  if (valid)
    _build->setText(param.toString());

  /*
  param = pParams.value("cloud", &valid);
  if (valid)
    _cloudOption->setChecked(true);
  */

  /*
  param = pParams.value("company", &valid);
  if (valid)
    _company->setText(param.toString());
  */

  param = pParams.value("name", &valid);
  if (valid)
    _nameLit->setText(param.toString());

  param = pParams.value("databaseURL", &valid);
  if (valid)
    _databaseURL = param.toString();

  populateDatabaseInfo();

  param = pParams.value("nonxTupleDB", &valid);
  if (valid)
    _nonxTupleDB = true;

  param = pParams.value("multipleConnections", &valid);
  if (valid)
    _multipleConnections = true;

  param = pParams.value("setSearchPath", &valid);
  if (valid)
    _setSearchPath = true;

  if(pParams.inList("login"))
    sLogin();

  sChangeURL();
  updateRecentOptions();
  updateRecentOptionsActions();

  return 0;
}