void RegisterDialog::on_button_Ok_clicked()
{
    bool accept(true);
    newLogin = ui->lineEdit_login->text();
    if (newLogin == "")   //is login blank?
    {
        ui->label_er1->setVisible(true);
        accept = false;
    } else
        ui->label_er1->setVisible(false);

    if (ui->lineEdit_password->text() == "") //is password blank?
    {
        ui->label_er2->setVisible(true);
        accept = false;
    } else
        ui->label_er2->setVisible(false);

    if (ui->lineEdit_password->text() != ui->lineEdit_re_password->text())  //do passwords match?
    {
        ui->label_er3->setVisible(true);
        accept = false;
    } else
    {
        ui->label_er3->setVisible(false);
    }

    if (ui->lineEdit_Email->text() == "") //is email blank?
    {
        ui->label_erEmail->setVisible(true);
        accept = false;
    } else
    {
        ui->label_erEmail->setVisible(false);
        newEmail = ui->lineEdit_Email->text();
    }

    if (ui->lineEdit_Phone->text() == "") //is phone blank
    {
        ui->label_erPhone->setVisible(true);
        accept = false;
    } else
    {
        ui->label_erPhone->setVisible(false);
        newPhone = ui->lineEdit_Phone->text();
    }

    if (alreadyExists())  //does the customer with the same name exist?
    {
        ui->label_taken->setVisible(true);
        accept = false;
    } else
        ui->label_taken->setVisible(false);

    newPassword = ui->lineEdit_password->text();
    if (accept)
        this->accept();
}
Ejemplo n.º 2
0
void SharedConnectionsDialog::checkDbConnectionDuplicate(const QString &shortDbiUrl, const QString &userName,
    const QString &allowedDuplicateName)
{
    QString existingConnectionName;
    if (alreadyExists(shortDbiUrl, userName, existingConnectionName)
        && (allowedDuplicateName.isEmpty() || existingConnectionName != allowedDuplicateName))
    {
        QMessageBox::information(this, tr(CONNECTION_DUPLICATE_TITLE), tr(CONNECTION_DUPLICATE_TEXT).arg(existingConnectionName));
    }
}
Ejemplo n.º 3
0
std::string Ini::operator[](const std::string& identifier)
{
    return alreadyExists(identifier) ? entries[identifier] : "";
}