コード例 #1
0
void SettingsDialog::okClicked()
{
    emit okRequested(profiles);
}
コード例 #2
0
ファイル: WizardDialog.cpp プロジェクト: gqueiroz/terrama2
/*! \brief Construtor

\param riskmap  Monitored selected object
\param sellist  List of available grids
\param parent   Dialog parent Widget
\param f        Flags for build dialog
\
*/
WizardDialog::WizardDialog(const RiskMap* riskmap, const QList<WeatherGrid*>& sellist, QWidget* parent, Qt::WFlags f)
: QDialog(parent, f)
{
  setupUi(this);

  _sellist = QList<WeatherGrid*>(sellist);

  riskMapNameLbl->setText(riskmap->name());

  attributesListWidget->clear();
  cpcCmbBoxAttributes->clear();

  for(int i=0, num=riskmap->numAttributes(); i<num; i++)
  {
    wsColumnType type = riskmap->attributeType(i);
    if(type != WS_COLTYPE_REAL && type != WS_COLTYPE_INT && type != WS_COLTYPE_UNSIGNEDINT)
      continue;

    attributesListWidget->addItem(riskmap->attributeName(i));

    cpcCmbBoxAttributes->addItem(riskmap->attributeName(i));
  }

  if(cpcCmbBoxAttributes->count() == 0)
  {
    cpcCmbBoxAttributes->addItem("Nenhum", -1);
    cpcCmbBoxAttributes->setEnabled(false);
  }

  gridListWidget->clear();
  cpcCmbBoxPCD->clear();
  cpcCmbBoxGrid->clear();

  for(int i=0, num=(int)_sellist.count(); i<num; i++)
  {
    QString name = _sellist[i]->name();
    QListWidgetItem* item = new QListWidgetItem(name);
  
    QIcon icon;
    if(_sellist[i]->data().geometry == WS_WDSGEOM_POINTS) // Dados de PCDs obtidos por meio de servidores de arquivos ou servidores WFS
    {
      icon = QIcon(":/data/icons/dado_pontual.png");
      cpcCmbBoxPCD->addItem(icon, name, i);
    }
    else if(_sellist[i]->data().geometry == WS_WDSGEOM_RASTER) // Dados matriciais obtidos por meio de servidores de arquivos ou servidores WCS
    {
      icon = QIcon(":/data/icons/grid.png");
      cpcCmbBoxGrid->addItem(icon, name, i);
    }
    
    if(_sellist[i]->data().geometry == WS_WDSGEOM_RASTER)
    {
      item->setIcon(icon);
      gridListWidget->addItem(item);
    }
  }

  if(cpcCmbBoxGrid->count() == 0)
  {
    cpcCmbBoxGrid->addItem("Nenhum", -1);
    cpcCmbBoxGrid->setEnabled(false);
  }
  cpcGridChanged(0);

  if(cpcCmbBoxPCD->count() == 0)
  {
    cpcCmbBoxPCD->addItem("Nenhum", -1);
    cpcCmbBoxPCD->setEnabled(false);
  }
  cpcPCDChanged(0);

  // Fill up the zone operation for the generic assistant tab
  zoneOpCmb->clear();
  zoneOpCmb->addItem(tr("Mínimo"), "minimo");
  zoneOpCmb->addItem(tr("Máximo"), "maximo");
  zoneOpCmb->addItem(tr("Média"),  "media");  
  zoneOpCmb->addItem(tr("Número amostras"), "conta_amostras"); 
  zoneOpCmb->setCurrentIndex(0);

  // Fill up the zone operation for the generic CPC tab 
  cpcCmbBoxOperator->clear();
  cpcCmbBoxOperator->addItem(tr("Mínimo"), "minimo");
  cpcCmbBoxOperator->addItem(tr("Máximo"), "maximo");
  cpcCmbBoxOperator->addItem(tr("Média"),  "media");  
  cpcCmbBoxOperator->setCurrentIndex(0);

  // Prepare the role table
  rulesListWidget->clear();

  // Bind the window signals
  connect(okBtn,      SIGNAL(clicked()), SLOT(okRequested()));
  connect(cancelBtn,    SIGNAL(clicked()), SLOT(reject()));

  // Bind the tab signal of generic assistant
  connect(addRuleBtn,   SIGNAL(clicked()), SLOT(addRuleRequested()));
  connect(removeRuleBtn,  SIGNAL(clicked()), SLOT(removeRuleRequested()));

  // Bind the tab signal of CPC assistant
  connect(cpcCmbBoxGrid,  SIGNAL(currentIndexChanged(int)), SLOT(cpcGridChanged(int)));
  connect(cpcCmbBoxPCD,   SIGNAL(currentIndexChanged(int)), SLOT(cpcPCDChanged(int)));
}