Пример #1
0
int TraditionalKeyGenerator::validate (std::string const& key,
                                       bool isRestore) {
  int res = globalCheck(key, isRestore);

  if (res != TRI_ERROR_NO_ERROR) {
    return res;
  }

  // validate user-supplied key
  if (! validateKey(key.c_str())) {
    return TRI_ERROR_ARANGO_DOCUMENT_KEY_BAD;
  }

  return TRI_ERROR_NO_ERROR;
}
Пример #2
0
void SourceAddDialog::handleSourceFinished()
{
  updateAfterOpen();

  ui->LayersTableWidget->selectRow(0);
  ui->StatusProgressBar->setVisible(false);
  ui->BrowseButton->setEnabled(true);
  ui->ConnectButton->setEnabled(true);
  ui->URLLineEdit->setEnabled(true);
  ui->LayersTableWidget->setEnabled(true);
  ui->ButtonBox->setEnabled(true);
  setCursor(Qt::ArrowCursor);

  globalCheck();
}
Пример #3
0
int AutoIncrementKeyGenerator::validate (std::string const& key,
                                         bool isRestore) {
  int res = globalCheck(key, isRestore);

  if (res != TRI_ERROR_NO_ERROR) {
    return res;
  }

  // validate user-supplied key
  if (! validateKey(key.c_str())) {
    return TRI_ERROR_ARANGO_DOCUMENT_KEY_BAD;
  }

  uint64_t intValue = triagens::basics::StringUtils::uint64(key);

  if (intValue > _lastValue) {
    MUTEX_LOCKER(_lock);
    // update our last value
    _lastValue = intValue;
  }

  return TRI_ERROR_NO_ERROR;
}
Пример #4
0
void SourceAddDialog::handleSourceError(QString Message)
{
  if (!Message.isEmpty())
    QMessageBox::critical(this,tr("Source error"),Message);
  else
    QMessageBox::critical(this,tr("Source error"),tr("Error opening source")+"\n" +
                                                  m_CurrentSourceURI+"\n\n" +
                                                  tr("Aborting."));

  m_CurrentSourceURI.clear();

  updateAfterOpen();

  ui->StatusProgressBar->setVisible(false);
  ui->LayersTableWidget->setRowCount(0);
  ui->BrowseButton->setEnabled(true);
  ui->ConnectButton->setEnabled(true);
  ui->URLLineEdit->setEnabled(true);
  ui->LayersTableWidget->setEnabled(true);
  ui->ButtonBox->setEnabled(true);
  setCursor(Qt::ArrowCursor);

  globalCheck();
}