login2::login2(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : QDialog(parent, name, modal, fl) { Q_INIT_RESOURCE(xTupleCommon); setupUi(this); connect(_login, SIGNAL(clicked()), this, SLOT(sLogin())); connect(_options, SIGNAL(clicked()), this, SLOT(sOptions())); _splash = 0; _captive = false; _nonxTupleDB = false; _multipleConnections = false; _evalDatabaseURL = "pgsql://demo.xtuple.com:5434/%1"; _userid = -1; _password->setEchoMode(QLineEdit::Password); QSettings ini(QSettings::IniFormat, QSettings::UserScope, "xTuple.com", "xTuple"); QSettings settings(QSettings::UserScope, "OpenMFG.com", "OpenMFG"); _databaseURL = ini.readEntry("/xTuple/_databaseURL", settings.readEntry("/OpenMFG/_databaseURL", "pgsql://:5432/")); _enhancedAuth = ini.readBoolEntry("/xTuple/_enhancedAuthentication",settings.readBoolEntry("/OpenMFG/_enhancedAuthentication", false)); _requireSSL = ini.readBoolEntry("/xTuple/_requireSSL",settings.readBoolEntry("/OpenMFG/_requireSSL", false)); if(ini.readBoolEntry("/xTuple/_demoOption",settings.readBoolEntry("/OpenMFG/_demoOption", false))) _demoOption->setChecked(true); }
login2::login2(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : QDialog(parent, modal ? (fl | Qt::Dialog) : fl) { setObjectName(name); Q_INIT_RESOURCE(xTupleCommon); setupUi(this); connect(_login, SIGNAL(clicked()), this, SLOT(sLogin())); connect(_options, SIGNAL(clicked()), this, SLOT(sOptions())); _splash = 0; _captive = false; _nonxTupleDB = false; _multipleConnections = false; _evalDatabaseURL = "pgsql://demo.xtuple.com:5434/%1"; _password->setEchoMode(QLineEdit::Password); updateRecentOptionsActions(); _databaseURL = xtsettingsValue("/xTuple/_databaseURL", "pgsql://:5432/").toString(); _enhancedAuth = xtsettingsValue("/xTuple/_enhancedAuthentication", false).toBool(); _requireSSL = xtsettingsValue("/xTuple/_requireSSL", false).toBool(); if(xtsettingsValue("/xTuple/_demoOption", false).toBool()) _demoOption->setChecked(true); }
/* * Constructs a login as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * * The dialog will by default be modeless, unless you set 'modal' to * true to construct a modal dialog. */ login::login(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : QDialog(parent, name, modal, fl) { Q_INIT_RESOURCE(OpenRPTCommon); setupUi(this); // signals and slots connections connect(_login, SIGNAL(clicked()), this, SLOT(sLogin())); connect(_options, SIGNAL(clicked()), this, SLOT(sOptions())); init(); }
/* TODO: rename _nonxTupleDB to _isxTupleDB internally and set it based on db contents, not command line parameter input */ login2::login2(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : QDialog(parent, modal ? (fl | Qt::Dialog) : fl) { setObjectName(name); Q_INIT_RESOURCE(xTupleCommon); setupUi(this); //_options = _buttonBox->addButton(tr("Options..."), QDialogButtonBox::ActionRole); _recent = _buttonBox->addButton(tr("Recent"), QDialogButtonBox::ActionRole); //_options->setEnabled(false); _recent->setEnabled(false); _buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Login")); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sLogin())); connect(_buttonBox, SIGNAL(helpRequested()), this, SLOT(sOpenHelp())); //connect(_options, SIGNAL(clicked()), this, SLOT(sOptions())); connect(_server, SIGNAL(editingFinished()), this, SLOT(sChangeURL())); connect(_database, SIGNAL(editTextChanged(QString)), this, SLOT(sChangeURL())); connect(_port, SIGNAL(editingFinished()), this, SLOT(sChangeURL())); //connect(_otherOption, SIGNAL(toggled(bool)), _options, SLOT(setEnabled(bool))); //connect(_otherOption, SIGNAL(toggled(bool)), _recent, SLOT(setEnabled(bool))); //connect(_otherOption, SIGNAL(toggled(bool)), this, SLOT(sHandleButton())); _splash = 0; _captive = false; _nonxTupleDB = false; _multipleConnections = false; _setSearchPath = false; _cloudDatabaseURL= "pgsql://%1.xtuplecloud.com:5432/%1_%2"; _password->setEchoMode(QLineEdit::Password); //updateRecentOptionsActions(); _databaseURL = xtsettingsValue("/xTuple/_databaseURL", "pgsql://:5432/demo").toString(); /* if(xtsettingsValue("/xTuple/_demoOption", false).toBool()) _demoOption->setChecked(true); else _prodOption->setChecked(true); if(xtsettingsValue("/xTuple/_cloudOption", false).toBool()) _cloudOption->setChecked(true); else _otherOption->setChecked(true); _company->setText(xtsettingsValue("/xTuple/cloud_company", "").toString()); */ adjustSize(); }
/* * Constructs a login as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * * The dialog will by default be modeless, unless you set 'modal' to * true to construct a modal dialog. */ login::login(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl) : QDialog(parent, fl) { setModal(modal); setObjectName(name); Q_INIT_RESOURCE(OpenRPTCommon); setupUi(this); // signals and slots connections connect(_login, SIGNAL(clicked()), this, SLOT(sLogin())); connect(_options, SIGNAL(clicked()), this, SLOT(sOptions())); _splash = 0; _captive = false; _password->setEchoMode(QLineEdit::Password); }
/* TODO: rename _nonxTupleDB to _isxTupleDB internally and set it based on db contents, not command line parameter input */ login2::login2(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : QDialog(parent, modal ? (fl | Qt::Dialog) : fl) { setObjectName(name); Q_INIT_RESOURCE(xTupleCommon); setupUi(this); _company->hide(); _companyLit->hide(); _options = _buttonBox->addButton(tr("Options..."), QDialogButtonBox::ActionRole); _recent = _buttonBox->addButton(tr("Recent"), QDialogButtonBox::ActionRole); _buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Login")); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sLogin())); connect(_options, SIGNAL(clicked()), this, SLOT(sOptions())); connect(_cloudLink, SIGNAL(linkActivated(QString)), this, SLOT(cloudLink(QString))); connect(_otherOption, SIGNAL(toggled(bool)), _options, SLOT(setEnabled(bool))); connect(_otherOption, SIGNAL(toggled(bool)), _recent, SLOT(setEnabled(bool))); _splash = 0; _captive = false; _nonxTupleDB = false; _multipleConnections = false; _evalDatabaseURL = "pgsql://demo.xtuple.com:5434/%1"; _cloudDatabaseURL= "pgsql://cloud.xtuple.com:5432/%1"; _password->setEchoMode(QLineEdit::Password); updateRecentOptionsActions(); _databaseURL = xtsettingsValue("/xTuple/_databaseURL", "pgsql://:5432/").toString(); _enhancedAuth = xtsettingsValue("/xTuple/_enhancedAuthentication", false).toBool(); _requireSSL = xtsettingsValue("/xTuple/_requireSSL", false).toBool(); if(xtsettingsValue("/xTuple/_demoOption", false).toBool()) _demoOption->setChecked(true); else if(xtsettingsValue("/xTuple/_cloudOption", false).toBool()) _cloudOption->setChecked(true); _company->setText(xtsettingsValue("/xTuple/cloud_company", "").toString()); adjustSize(); }
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; }
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; }