Beispiel #1
0
void DocumentView::initAlwaysUsedConnections()  {

    connect(buttonBox,SIGNAL(rejected()),controller,SLOT(getDocumentData()));
    connect(buttonBox, SIGNAL(accepted()), controller,SLOT(checkRequiredFields()));
    connect(buttonBox, SIGNAL(rejected()), controller, SLOT(checkChanges()));
    connect(goodsTable,SIGNAL(cellChanged(int,int)),controller,SLOT(editGood(int,int)));
    connect(buttonGoodAdd, SIGNAL(clicked()), controller, SLOT(selectGoods()));
    connect(buttonGoodDel,SIGNAL(clicked()),controller,SLOT(removeGood()));
}
Beispiel #2
0
void OfferView::initConnections() {

    connect(notConcerns,SIGNAL(toggled(bool)),controller,SLOT(setDateLikeNotConcerns(bool)));
    connect(chooseGood,SIGNAL(clicked()),controller,SLOT(selectGoods()));
    connect(buttonBox, SIGNAL(accepted()), controller,SLOT(checkRequiredFields()));
    connect(buttonBox, SIGNAL(rejected()), controller, SLOT(checkChanges()));
    connect(deleteGood, SIGNAL(clicked()), controller, SLOT(removeGoodsFromPositions()));
    connect(selectContractor, SIGNAL(clicked()), controller, SLOT(selectContractor()));
    connect(priceLevel, SIGNAL(activated(int)), controller, SLOT(initTableModel()));
}
void SourceAddDialog::proceedToImport()
{
  if (prepareToImport())
  {
    m_SrcInfos.SourceGeomType = mp_DataSource->GetLayer(ui->LayersTableWidget->currentRow())->GetGeomType();
    m_SrcInfos.LayerName = QString(mp_DataSource->GetLayer(ui->LayersTableWidget->currentRow())->GetName());

    if (checkRequiredFields())
    {
      OGRFeatureDefn* Defn = mp_DataSource->GetLayerByName(m_SrcInfos.LayerName.toStdString().c_str())->GetLayerDefn();

      for (int i=0; i< Defn->GetFieldCount();i++)
        m_SrcInfos.AvailableFields.append(Defn->GetFieldDefn(i)->GetNameRef());

      if (m_SrcInfos.AvailableFields.contains(OGRGDAL_PSORD_FIELD))
        m_SrcInfos.UnitsPcsOrdField = OGRGDAL_PSORD_FIELD;

      if (m_SrcInfos.AvailableFields.contains(OGRGDAL_TOCONN_FIELD))
        m_SrcInfos.ToConnectionsField = OGRGDAL_TOCONN_FIELD;

      if (m_SrcInfos.AvailableFields.contains(OGRGDAL_CHILDOF_FIELD))
        m_SrcInfos.ChildofConnectionsField = OGRGDAL_CHILDOF_FIELD;

      accept();
    }
    else
    {
      QMessageBox::critical(this,tr("Import error"),
                            tr("Error importing from source")+"\n"+
                            m_CurrentSourceURI+"\n\n"+
                            tr("The mandatory field \"OFLD_ID\" cannot be found.")+"\n\n"+
                            tr("Aborting."));
      reject();
    }
  }
  else
  {
    QMessageBox::critical(this,tr("Import error"),
                          tr("Error importing from source")+"\n"+
                          m_CurrentSourceURI+"\n\n"+
                          tr("Aborting."));
    reject();
  }
}