/**
* Slot called when the OK/Accept button is pressed
*/
void eVisDatabaseLayerFieldSelectionGui::buttonBox_accepted()
{
  //emit the signal to draw the layer
  emit eVisDatabaseLayerFieldsSelected( leLayerName->text(), cboxXCoordinate->currentText(), cboxYCoordinate->currentText() );

  //close the gui component
  close();

  //reset the layer name line edit
  leLayerName->clear();
}
Exemplo n.º 2
0
/**
* Constructor
* @param parent - Pointer the to parent QWidget for modality
* @param fl - Windown flags
*/
eVisDatabaseConnectionGui::eVisDatabaseConnectionGui( QList<QTemporaryFile*>* theTemoraryFileList, QWidget* parent, Qt::WindowFlags fl )
    : QDialog( parent, fl )
{
  setupUi( this );

  QSettings settings;
  restoreGeometry( settings.value( "/eVis/db-geometry" ).toByteArray() );

  mTempOutputFileList = theTemoraryFileList;

  //Initialize varaibles
  mQueryDefinitionMap = new QMap<int, eVisQueryDefinition>;
  mDatabaseConnection = 0;

  //Create a new instance of the file selector
  mDatabaseLayerFieldSelector = new eVisDatabaseLayerFieldSelectionGui( this, fl );
  connect( mDatabaseLayerFieldSelector, SIGNAL( eVisDatabaseLayerFieldsSelected( QString, QString, QString ) ), this, SLOT( drawNewVectorLayer( QString, QString, QString ) ) );

  //Populate gui components
#ifdef WIN32
  cboxDatabaseType->insertItem( 0, "MSAccess" );
#endif
  cboxDatabaseType->insertItem( 0, "MYSQL" );
  cboxDatabaseType->insertItem( 0, "ODBC" );
  cboxDatabaseType->insertItem( 0, "PostGreSQL" );
  cboxDatabaseType->insertItem( 0, "SQLITE" );
  cboxDatabaseType->insertItem( 0, tr( "Undefined" ) );
  cboxDatabaseType->setCurrentIndex( 0 );
  cboxPredefinedQueryList->insertItem( 0, tr( "No predefined queries loaded" ) );

  //set icons
  QString myThemePath = QgsApplication::activeThemePath();
  pbtnOpenFile->setIcon( QIcon( QPixmap( myThemePath + "/mActionFolder.png" ) ) );
  pbtnOpenFile->setToolTip( tr( "Open File" ) );
  pbtnLoadPredefinedQueries->setIcon( QIcon( QPixmap( myThemePath + "/mActionFolder.png" ) ) );
  pbtnLoadPredefinedQueries->setToolTip( tr( "Open File" ) );
}