[QGIS Commit] r15300 - trunk/qgis/src/plugins/spatialquery

svn_qgis at osgeo.org svn_qgis at osgeo.org
Tue Mar 1 02:59:56 EST 2011


Author: timlinux
Date: 2011-02-28 23:59:56 -0800 (Mon, 28 Feb 2011)
New Revision: 15300

Added:
   trunk/qgis/src/plugins/spatialquery/select.png
   trunk/qgis/src/plugins/spatialquery/selectadd.png
   trunk/qgis/src/plugins/spatialquery/selectesubsetlayer.png
   trunk/qgis/src/plugins/spatialquery/selectremove.png
Modified:
   trunk/qgis/src/plugins/spatialquery/qgsspatialquery.cpp
   trunk/qgis/src/plugins/spatialquery/qgsspatialquerydialog.cpp
   trunk/qgis/src/plugins/spatialquery/qgsspatialquerydialog.h
   trunk/qgis/src/plugins/spatialquery/qgsspatialquerydialogbase.qrc
   trunk/qgis/src/plugins/spatialquery/qgsspatialquerydialogbase.ui
Log:
Updates from Luiz for spatial query plugin

Modified: trunk/qgis/src/plugins/spatialquery/qgsspatialquery.cpp
===================================================================
--- trunk/qgis/src/plugins/spatialquery/qgsspatialquery.cpp	2011-03-01 07:03:02 UTC (rev 15299)
+++ trunk/qgis/src/plugins/spatialquery/qgsspatialquery.cpp	2011-03-01 07:59:56 UTC (rev 15300)
@@ -15,7 +15,7 @@
  *   (at your option) any later version.                                   *
  *                                                                         *
  ***************************************************************************/
-/*  $Id$ */
+/*  $Id: qgsspatialquery.cpp 15141 2011-02-08 13:34:43Z jef $ */
 
 #include <QMessageBox>
 
@@ -324,7 +324,7 @@
     mLayerReference->featureAtId( *iterIdReference, featureReference );
     geomReference = featureReference.geometry();
 
-    if ( !( geomTarget->*op )( geomTarget ) )
+    if ( !( geomTarget->*op )( geomReference ) )
     {
       addIndex = false;
       break;


Property changes on: trunk/qgis/src/plugins/spatialquery/qgsspatialquery.cpp
___________________________________________________________________
Added: svn:executable
   + *

Modified: trunk/qgis/src/plugins/spatialquery/qgsspatialquerydialog.cpp
===================================================================
--- trunk/qgis/src/plugins/spatialquery/qgsspatialquerydialog.cpp	2011-03-01 07:03:02 UTC (rev 15299)
+++ trunk/qgis/src/plugins/spatialquery/qgsspatialquerydialog.cpp	2011-03-01 07:59:56 UTC (rev 15300)
@@ -15,7 +15,7 @@
  *   (at your option) any later version.                                   *
  *                                                                         *
  ***************************************************************************/
-/*  $Id$ */
+/*  $Id: qgsspatialquerydialog.cpp 15141 2011-02-08 13:34:43Z jef $ */
 
 #include <QMessageBox>
 #include <QDateTime>
@@ -68,35 +68,35 @@
 {
   QString msgLayersLessTwo = tr( "The spatial query requires at least two layers" );
   QMessageBox::warning( 0, tr( "Insufficient number of layers" ), msgLayersLessTwo, QMessageBox::Ok );
-}
+} // void QgsSpatialQueryDialog::messageLayersLessTwo()
 
 void QgsSpatialQueryDialog::disconnectQGis()
 {
   disconnectAll();
 
-} // void QgsSpatialQueryDialog::unload()
+} // void QgsSpatialQueryDialog::disconnectQGis()
 
 void QgsSpatialQueryDialog::initGui()
 {
   showLogProcessing( false );
   setLayoutResultInvalid( false );
 
-  buttonBoxMain->button( QDialogButtonBox::Close )->hide();
+  bbMain->button( QDialogButtonBox::Close )->hide();
 
-  populateTargetLayerComboBox();
-  if ( targetLayerComboBox->count() > 1 )
+  populateCbTargetLayer();
+  if ( cbTargetLayer->count() > 1 )
   {
     setLayer( true, 0 );
     evaluateCheckBox( true );
-    populateReferenceLayerComboBox();
+    populateCbReferenceLayer();
     setLayer( false, 0 );
     evaluateCheckBox( false );
-    populateOperationComboBox();
+    populateCbOperation();
   }
   else
   {
-    buttonBoxMain->setEnabled( false );
-    textEditStatus->append( mMsgLayersLessTwo );
+    bbMain->setEnabled( false );
+    teStatus->append( mMsgLayersLessTwo );
   }
 
 } // QgsSpatialQueryDialog::initGui()
@@ -142,12 +142,12 @@
   if ( isTarget )
   {
     layer = mLayerTarget;
-    checkbox = usingSelectedTargetCheckBox;
+    checkbox = ckbUsingSelectedTarget;
   }
   else
   {
     layer = mLayerReference;
-    checkbox = usingSelectedReferenceCheckBox;
+    checkbox = ckbUsingSelectedReference;
   }
   int selectedCount = layer->selectedFeatureCount();
   bool isCheckBoxValid = ( layer != NULL &&  selectedCount > 0 );
@@ -160,38 +160,58 @@
 
 } // void QgsSpatialQueryDialog::evaluateCheckBox(bool isTarget)
 
+void QgsSpatialQueryDialog::evaluateButtonSelected()
+{
+  QSet < int > selectedTarget = mLayerTarget->selectedFeaturesIds();
+  // pbSelectResultTargetAdd and pbSelectResultTargetRemove => disable
+  if( selectedTarget.isEmpty() )
+  {
+    pbSelectResultTargetAdd->setEnabled( false );
+    pbSelectResultTargetRemove->setEnabled( false );
+    return;
+  }
+  // pbSelectResultTargetAdd
+  selectedTarget.contains( mFeatureResult ) || mFeatureResult.contains( selectedTarget )
+      ? pbSelectResultTargetAdd->setEnabled( false )
+      : pbSelectResultTargetAdd->setEnabled( true );
+  // pbSelectResultTargetRemove
+  selectedTarget.intersect( mFeatureResult ).isEmpty()
+      ? pbSelectResultTargetRemove->setEnabled( false )
+      : pbSelectResultTargetRemove->setEnabled( true );
+} // void QgsSpatialQueryDialog::evaluateButtonSelected()
+
 void QgsSpatialQueryDialog::runQuery()
 {
-  buttonBoxMain->setEnabled( false );
-  MngProgressBar* pb = new MngProgressBar( progressBarStatus );
+  bbMain->setEnabled( false );
+  MngProgressBar* pb = new MngProgressBar( pgbStatus );
   QgsSpatialQuery* spatialQuery = new QgsSpatialQuery( pb );
-  if ( usingSelectedTargetCheckBox->isChecked() )
+  if ( ckbUsingSelectedTarget->isChecked() )
   {
     spatialQuery->setSelectedFeaturesTarget( true );
   }
-  if ( usingSelectedReferenceCheckBox->isChecked() )
+  if ( ckbUsingSelectedReference->isChecked() )
   {
     spatialQuery->setSelectedFeaturesReference( true );
   }
-  progressBarStatus->setTextVisible( true );
+  pgbStatus->setTextVisible( true );
   mFeatureResult.clear();
   mFeatureInvalidTarget.clear();
   mFeatureInvalidReference.clear();
 
-  int currentItem = operantionComboBox->currentIndex();
+  int currentItem = cbOperantion->currentIndex();
   bool isOk;
-  int operation = operantionComboBox->itemData( currentItem ).toInt( &isOk );
+  int operation = cbOperantion->itemData( currentItem ).toInt( &isOk );
   spatialQuery->runQuery( mFeatureResult, mFeatureInvalidTarget, mFeatureInvalidReference, operation, mLayerTarget, mLayerReference );
   delete spatialQuery;
   delete pb;
 
-  progressBarStatus->setTextVisible( false );
-  buttonBoxMain->setEnabled( true );
+  pgbStatus->setTextVisible( false );
+  bbMain->setEnabled( true );
   setLayoutOperationVisible( false );
-  progressBarStatus->hide();
-  buttonBoxMain->button( QDialogButtonBox::Close )->show();
-  buttonBoxMain->button( QDialogButtonBox::Cancel )->hide();
-  buttonBoxMain->button( QDialogButtonBox::Ok )->hide();
+  pgbStatus->hide();
+  bbMain->button( QDialogButtonBox::Close )->show();
+  bbMain->button( QDialogButtonBox::Cancel )->hide();
+  bbMain->button( QDialogButtonBox::Ok )->hide();
 } // void QgsSpatialQueryDialog::runQuery()
 
 void QgsSpatialQueryDialog::setLayoutOperationVisible( bool show )
@@ -203,17 +223,17 @@
 
 void QgsSpatialQueryDialog::setLayoutResultInvalid( bool show )
 {
-  grpResult->setVisible( show );
-  grpInvalid->setVisible( show );
-  ckboxLogProcessing->setVisible( show );
-  labelInfo->setVisible( show );
+  twResultInvalid->setVisible( show );
+  ckbZoomItem->setVisible( show );
+  ckbLogProcessing->setVisible( show );
+  teStatus->setVisible( false ); // Never show
 } // void QgsSpatialQueryDialog::setLayoutResultInvalid( bool show )
 
 void QgsSpatialQueryDialog::showLogProcessing( bool hasShow )
 {
   static int heightDialogNoStatus = 0;
 
-  hasShow ? textEditStatus->show() : textEditStatus->hide();
+  teStatus->setVisible( hasShow );
   adjustSize();
 
   if ( ! hasShow )
@@ -234,69 +254,117 @@
 void QgsSpatialQueryDialog::showResultQuery( QDateTime *datetimeStart, QDateTime *datetimeEnd )
 {
   // Report processing
-  QString msg = tr( "<<-- Begin at [%L1] --" ).arg( datetimeStart->toString() );
-  textEditStatus->append( msg );
-  msg = tr( "Query:" );
-  textEditStatus->append( msg );
-  msg = QString( "- %1" ).arg( getDescriptionLayerShow( true ) );
-  textEditStatus->append( msg );
-  msg = tr( "< %1 >" ).arg( operantionComboBox->currentText() );
-  textEditStatus->append( msg );
-  msg = QString( "- %1" ).arg( getDescriptionLayerShow( false ) );
-  textEditStatus->append( msg );
-  msg = tr( "Result: %1 features" ).arg( mFeatureResult.size() );
-  textEditStatus->append( msg );
+  QString msg = tr( "Begin at [%L1]" ).arg( datetimeStart->toString() );
+  teStatus->append( msg );
+  teStatus->append( "" );
+  msg = QString( "%1" ).arg( getDescriptionLayerShow( true ) );
+  teStatus->append( msg );
+  msg = tr( "< %1 >" ).arg( cbOperantion->currentText() );
+  teStatus->append( msg );
+  msg = QString( "%1" ).arg( getDescriptionLayerShow( false ) );
+  teStatus->append( msg );
+  msg = tr( "Total of features =  %1" ).arg( mFeatureResult.size() );
+  teStatus->append( msg );
+  teStatus->append( "" );
+  teStatus->append( tr("Total of invalid features:") );
+  teStatus->append( getDescriptionInvalidFeaturesShow( true ) );
+  teStatus->append( getDescriptionInvalidFeaturesShow( false ) );
+  teStatus->append( "" );
   double timeProcess = ( double )datetimeStart->secsTo( *datetimeEnd ) / 60.0;
-  msg = tr( "-- Finish at [%L1] (processing time %L2 minutes) -->>" ).arg( datetimeEnd->toString() ).arg( timeProcess, 0, 'f', 2 );
-  textEditStatus->append( msg );
+  msg = tr( "Finish at [%L1] (processing time %L2 minutes)" ).arg( datetimeEnd->toString() ).arg( timeProcess, 0, 'f', 2 );
+  teStatus->append( msg );
 
 
   mRubberSelectId->reset();
+  ckbLogProcessing->setChecked( false );
 
-  QString formatLabel( "%1(%2)" );
-  resultTargetLabel->setText( formatLabel.arg( mLayerTarget->name() ).arg( mFeatureResult.size() ) );
-  invalidTargetLabel->setText( formatLabel.arg( mLayerTarget->name() ).arg( mFeatureInvalidTarget.size() ) );
-  invalidReferenceLabel->setText( formatLabel.arg( mLayerReference->name() ).arg( mFeatureInvalidReference.size() ) );
+  lbResultTarget->setText( mLayerTarget->name() );
+  lbInvalidTarget->setText( mLayerTarget->name() );
+  lbInvalidReference->setText( mLayerReference->name() );
 
+  QString formatLabel( tr("Feature IDs(%1):"));
+  lbFIDresultTarget->setText( formatLabel.arg( mFeatureResult.size() ) );
+  lbFIDinvalidTarget->setText( formatLabel.arg( mFeatureInvalidTarget.size() ) );
+  lbFIDinvalidReference->setText( formatLabel.arg( mFeatureInvalidReference.size() ) );
+
+  setLabelButtonSelected(lbSelected, mLayerTarget, pbSelectedSubsetLayer);
+
   // Result target
   if ( mFeatureResult.size() > 0 )
   {
-    pushButtonSelectResultTarget->setEnabled( true );
-    populateFeatureListWidget( resultFeatureTargetListWidget, mFeatureResult );
+    populateLwFeature( lwResultFeatureTarget, mFeatureResult );
     evaluateCheckBox( true );
-    on_resultFeatureTargetListWidget_currentItemChanged( resultFeatureTargetListWidget->currentItem() );
+    on_lwResultFeatureTarget_currentItemChanged( lwResultFeatureTarget->currentItem() );
+    lwResultFeatureTarget->setEnabled( true );
+    // Button
+    pbSelectResultTarget->setEnabled( true );
+    evaluateButtonSelected();
   }
   else
   {
-    pushButtonSelectResultTarget->setEnabled( false );
-    clearFeatureListWidget( resultFeatureTargetListWidget );
+    pbSelectResultTarget->setEnabled( false );
+    pbSelectResultTargetAdd->setEnabled( false );
+    pbSelectResultTargetRemove->setEnabled( false );
+    clearLwFeature( lwResultFeatureTarget );
+    lwResultFeatureTarget->setEnabled( false );
   }
   // Invalid target
   if ( mFeatureInvalidTarget.size() > 0 )
   {
-    pushButtonSelectInvalidTarget->setEnabled( true );
-    populateFeatureListWidget( invalidFeatureTargetListWidget, mFeatureInvalidTarget, false );
+    pbSelectInvalidTarget->setEnabled( true );
+    populateLwFeature( lwInvalidFeatureTarget, mFeatureInvalidTarget );
+    lwInvalidFeatureTarget->setEnabled( true );
   }
   else
   {
-    pushButtonSelectInvalidTarget->setEnabled( false );
-    clearFeatureListWidget( invalidFeatureTargetListWidget );
+    pbSelectInvalidTarget->setEnabled( false );
+    clearLwFeature( lwInvalidFeatureTarget );
+    lwInvalidFeatureTarget->setEnabled( false );
   }
   // Invalid reference
   if ( mFeatureInvalidReference.size() > 0 )
   {
-    pushButtonSelectInvalidReference->setEnabled( true );
-    populateFeatureListWidget( invalidFeatureReferenceListWidget, mFeatureInvalidReference, false );
+    pbSelectInvalidReference->setEnabled( true );
+    populateLwFeature( lwInvalidFeatureReference, mFeatureInvalidReference );
+    lwInvalidFeatureReference->setEnabled( true );
   }
   else
   {
-    pushButtonSelectInvalidReference->setEnabled( false );
-    clearFeatureListWidget( invalidFeatureReferenceListWidget );
+    pbSelectInvalidReference->setEnabled( false );
+    clearLwFeature( lwInvalidFeatureReference );
+    lwInvalidFeatureReference->setEnabled( false );
   }
   setLayoutResultInvalid( true );
   adjustSize();
 } // void QgsSpatialQueryDialog::showResultQuery(QDateTime *datetimeStart, QDateTime *datetimeEnd)
 
+void QgsSpatialQueryDialog::setLabelButtonSelected( QLabel *lb,  QgsVectorLayer* layer, QPushButton *pb)
+{
+  QString formatLabel("%1 of %2 selected items");
+  int numSelected = layer->selectedFeatureCount();
+  lb->setText( formatLabel.arg( numSelected ).arg( layer->featureCount() ) );
+  numSelected > 0 ? pb->setEnabled( true ) : pb->setEnabled( false );
+}
+
+QString QgsSpatialQueryDialog::getSubsetSelected( QgsVectorLayer* layer )
+{
+  QSet< int > selected = layer->selectedFeaturesIds();
+  if( selected.size() == 0 )
+  {
+    return QString("");
+  }
+  QSetIterator <int>item( selected );
+  QStringList lstFID;
+  while ( item.hasNext() )
+  {
+    lstFID.append( QString::number( item.next() ) );
+  }
+  QString qFormat("FID in (%1)");
+  QString qReturn  = qFormat.arg( lstFID.join(",") );
+  lstFID.clear();
+  return qReturn;
+} // QString QgsSpatialQueryDialog::getSubsetSelected( QgsVectorLayer* layer )
+
 QString QgsSpatialQueryDialog::getDescriptionLayerShow( bool isTarget )
 {
   QgsVectorLayer* layer = NULL;
@@ -304,12 +372,12 @@
   if ( isTarget )
   {
     layer = mLayerTarget;
-    checkBox = usingSelectedTargetCheckBox;
+    checkBox = ckbUsingSelectedTarget;
   }
   else
   {
     layer = mLayerReference;
-    checkBox = usingSelectedReferenceCheckBox;
+    checkBox = ckbUsingSelectedReference;
   }
 
   QString sDescFeatures = checkBox->isChecked()
@@ -320,14 +388,42 @@
 
 } // QString QgsSpatialQueryDialog::getDescriptionLayerShow(bool isTarget)
 
+QString QgsSpatialQueryDialog::getDescriptionInvalidFeaturesShow( bool isTarget )
+{
+
+  QgsVectorLayer* layer = NULL;
+  QCheckBox* checkBox = NULL;
+  int totalInvalid = 0;
+  if ( isTarget )
+  {
+    layer = mLayerTarget;
+    checkBox = ckbUsingSelectedTarget;
+    totalInvalid = mFeatureInvalidTarget.size();
+  }
+  else
+  {
+    layer = mLayerReference;
+    checkBox = ckbUsingSelectedReference;
+    totalInvalid = mFeatureInvalidReference.size();
+  }
+
+
+  QString sDescFeatures = checkBox->isChecked()
+                          ? tr( "%1 of %2(selected features)" ).arg( totalInvalid ).arg( layer->selectedFeatureCount() )
+                          : tr( "%1 of %2" ).arg( totalInvalid ).arg( layer->featureCount() );
+
+  return QString( "%1: %2" ).arg( layer->name() ).arg( sDescFeatures );
+
+} // QString QgsSpatialQueryDialog::getDescriptionInvalidFeatures(bool isTarget)
+
 void QgsSpatialQueryDialog::connectAll()
 {
   connect( QgsMapLayerRegistry::instance(), SIGNAL( layerWasAdded( QgsMapLayer* ) ),
            this, SLOT( signal_qgis_layerWasAdded( QgsMapLayer* ) ) ) ;
   connect( QgsMapLayerRegistry::instance(), SIGNAL( layerWillBeRemoved( QString ) ),
            this, SLOT( signal_qgis_layerWillBeRemoved( QString ) ) );
-  connect( ckboxLogProcessing, SIGNAL( clicked( bool ) ),
-           this, SLOT( on_ckboxLogProcessing_clicked( bool ) ) );
+  connect( ckbLogProcessing, SIGNAL( clicked( bool ) ),
+           this, SLOT( on_ckbLogProcessing_clicked( bool ) ) );
 
 } // QgsSpatialQueryDialog::connectAll()
 
@@ -370,8 +466,8 @@
 QgsVectorLayer * QgsSpatialQueryDialog::getLayerFromCombobox( bool isTarget, int index )
 {
   QVariant data = isTarget
-                  ? targetLayerComboBox->itemData( index )
-                  : referenceLayerComboBox->itemData( index );
+                  ? cbTargetLayer->itemData( index )
+                  : cbReferenceLayer->itemData( index );
   QgsVectorLayer* lyr = static_cast<QgsVectorLayer*>( data.value<void *>() );
   return lyr;
 
@@ -412,10 +508,10 @@
 
 } // QIcon QgsSpatialQueryDialog::getIconTypeGeometry(int typeGeometry)
 
-void QgsSpatialQueryDialog::addLayerCombobox( bool isTarget, QgsVectorLayer* vectorLayer )
+void QgsSpatialQueryDialog::addCbLayer( bool isTarget, QgsVectorLayer* vectorLayer )
 {
   QVariant item = QVariant::fromValue(( void * )vectorLayer );
-  QComboBox * cmb = isTarget ? targetLayerComboBox : referenceLayerComboBox;
+  QComboBox * cmb = isTarget ? cbTargetLayer : cbReferenceLayer;
   int idNew = cmb->count();
   QIcon icon = getIconTypeGeometry( vectorLayer->geometryType() );
   cmb->addItem( icon, vectorLayer->name(), item );
@@ -423,20 +519,20 @@
 
 } // void QgsSpatialQueryDialog::removeLayerCombobox(bool isTarget, QgsVectorLayer* vectorLayer)
 
-int QgsSpatialQueryDialog::getIndexLayerCombobox( bool isTarget, QgsVectorLayer* vectorLayer )
+int QgsSpatialQueryDialog::getCbIndexLayer( bool isTarget, QgsVectorLayer* vectorLayer )
 {
   QVariant item = QVariant::fromValue(( void * )vectorLayer );
-  QComboBox * cmb = isTarget ? targetLayerComboBox : referenceLayerComboBox;
+  QComboBox * cmb = isTarget ? cbTargetLayer : cbReferenceLayer;
   return cmb->findData( item );
 
 } //
 
 void QgsSpatialQueryDialog::removeLayer( bool isTarget, QgsVectorLayer* lyrRemove )
 {
-  QComboBox * cmb = isTarget ? targetLayerComboBox : referenceLayerComboBox;
+  QComboBox * cmb = isTarget ? cbTargetLayer : cbReferenceLayer;
   cmb->blockSignals( true );
   // Remove Combobox
-  int index = getIndexLayerCombobox( isTarget, lyrRemove );
+  int index = getCbIndexLayer( isTarget, lyrRemove );
   if ( index > -1 )
   {
     cmb->removeItem( index );
@@ -459,21 +555,36 @@
       cmb->setCurrentIndex( 0 );
       setLayer( isTarget, 0 );
       evaluateCheckBox( isTarget );
+      mRubberSelectId->reset();
+      QString lbFID("Feature IDs(0):");
       if ( isTarget )
       {
-        clearFeatureListWidget( resultFeatureTargetListWidget );
-        resultTargetLabel->setText( tr( "Total" ) + ": 0" );
-        mRubberSelectId->reset();
+        // Result
+        clearLwFeature( lwResultFeatureTarget );
+        lbFIDresultTarget->setText( lbFID );
+        pbSelectResultTarget->setEnabled( false );
+        pbSelectResultTargetAdd->setEnabled( false );
+        pbSelectResultTargetRemove->setEnabled( false );
+        // Invalid
+        clearLwFeature( lwInvalidFeatureTarget );
+        lbFIDinvalidTarget->setText( lbFID );
+        pbSelectInvalidTarget->setEnabled( false );
       }
+      else
+      {
+        clearLwFeature( lwInvalidFeatureReference );
+        lbFIDinvalidReference->setText( lbFID );
+        pbSelectInvalidReference->setEnabled( false );
+      }
     }
   }
   cmb->blockSignals( false );
 
 } // void QgsSpatialQueryDialog::removeLayer(bool isTarget, QgsVectorLayer* lyrRemove)
 
-void QgsSpatialQueryDialog::populateTargetLayerComboBox()
+void QgsSpatialQueryDialog::populateCbTargetLayer()
 {
-  targetLayerComboBox->blockSignals( true );
+  cbTargetLayer->blockSignals( true );
 
   QMap <QString, QgsMapLayer*> map = QgsMapLayerRegistry::instance()->mapLayers();
   QMapIterator <QString, QgsMapLayer*> item( map );
@@ -494,18 +605,18 @@
       continue;
     }
 
-    addLayerCombobox( true, vectorLayer );
-    mMapIdVectorLayers.insert( vectorLayer->id(), vectorLayer );
+    addCbLayer( true, vectorLayer );
+    mMapIdVectorLayers.insert( vectorLayer->getLayerID(), vectorLayer );
   }
-  targetLayerComboBox->setCurrentIndex( 0 );
-  targetLayerComboBox->blockSignals( false );
+  cbTargetLayer->setCurrentIndex( 0 );
+  cbTargetLayer->blockSignals( false );
 
-} // void QgsSpatialQueryDialog::populateTargetLayerComboBox()
+} // void QgsSpatialQueryDialog::populateCbTargetLayer()
 
-void QgsSpatialQueryDialog::populateReferenceLayerComboBox()
+void QgsSpatialQueryDialog::populateCbReferenceLayer()
 {
-  referenceLayerComboBox->blockSignals( true );
-  referenceLayerComboBox->clear();
+  cbReferenceLayer->blockSignals( true );
+  cbReferenceLayer->clear();
 
   // Populate new values and Set current item keeping the previous value
   QString itemText;
@@ -513,59 +624,59 @@
   QIcon itemIcon;
   QgsVectorLayer * itemLayer = NULL;
   int idNew = 0;
-  for ( int id = 0; id < targetLayerComboBox->count(); id++ )
+  for ( int id = 0; id < cbTargetLayer->count(); id++ )
   {
-    itemText = targetLayerComboBox->itemText( id );
-    itemData = targetLayerComboBox->itemData( id );
-    itemIcon = targetLayerComboBox->itemIcon( id );
+    itemText = cbTargetLayer->itemText( id );
+    itemData = cbTargetLayer->itemData( id );
+    itemIcon = cbTargetLayer->itemIcon( id );
     itemLayer = static_cast<QgsVectorLayer *>( itemData.value<void *>() );
     if ( itemLayer == mLayerTarget )
     {
       continue;
     }
-    referenceLayerComboBox->addItem( itemIcon, itemText, itemData );
-    referenceLayerComboBox->setItemData( idNew, QVariant( itemLayer->source() ), Qt::ToolTipRole );
+    cbReferenceLayer->addItem( itemIcon, itemText, itemData );
+    cbReferenceLayer->setItemData( idNew, QVariant( itemLayer->source() ), Qt::ToolTipRole );
     idNew++;
   }
-  int idCurrent = getIndexLayerCombobox( false, mLayerReference );
+  int idCurrent = getCbIndexLayer( false, mLayerReference );
   if ( idCurrent == -1 )
   {
     idCurrent = 0;
   }
-  referenceLayerComboBox->setCurrentIndex( idCurrent );
-  referenceLayerComboBox->blockSignals( false );
+  cbReferenceLayer->setCurrentIndex( idCurrent );
+  cbReferenceLayer->blockSignals( false );
 
-} // QgsSpatialQueryDialog::populateReferenceLayerComboBox()
+} // QgsSpatialQueryDialog::populateCbReferenceLayer()
 
-void QgsSpatialQueryDialog::populateOperationComboBox()
+void QgsSpatialQueryDialog::populateCbOperation()
 {
-  operantionComboBox->blockSignals( true );
+  cbOperantion->blockSignals( true );
 
   if ( mLayerTarget == NULL || mLayerReference == NULL )
   {
-    operantionComboBox->clear();
-    operantionComboBox->blockSignals( true );
+    cbOperantion->clear();
+    cbOperantion->blockSignals( true );
   }
 
   QVariant currentValueItem;
   bool isStartEmpty = false;
-  if ( operantionComboBox->count() == 0 )
+  if ( cbOperantion->count() == 0 )
   {
     isStartEmpty = true;
   }
   else
   {
-    currentValueItem = operantionComboBox->itemData( operantionComboBox->currentIndex() );
+    currentValueItem = cbOperantion->itemData( cbOperantion->currentIndex() );
   }
 
   // Populate new values
   QMap<QString, int> * map = QgsSpatialQuery::getTypesOperations( mLayerTarget, mLayerReference );
   QMapIterator <QString, int> item( *map );
-  operantionComboBox->clear();
+  cbOperantion->clear();
   while ( item.hasNext() )
   {
     item.next();
-    operantionComboBox->addItem( item.key(), QVariant( item.value() ) );
+    cbOperantion->addItem( item.key(), QVariant( item.value() ) );
   }
   delete map;
 
@@ -573,54 +684,78 @@
   int idCurrent = 0;
   if ( !isStartEmpty )
   {
-    idCurrent = operantionComboBox->findData( currentValueItem );
+    idCurrent = cbOperantion->findData( currentValueItem );
     if ( idCurrent == -1 )
     {
       idCurrent = 0;
     }
   }
-  operantionComboBox->setCurrentIndex( idCurrent );
-  operantionComboBox->blockSignals( false );
+  cbOperantion->setCurrentIndex( idCurrent );
+  cbOperantion->blockSignals( false );
 
-} // QgsSpatialQueryDialog::populateOperantionComboBox()
+} // QgsSpatialQueryDialog::populatecbOperantion()
 
-void QgsSpatialQueryDialog::populateFeatureListWidget( QListWidget *listWidget, QSet<int> & setFeatures, bool hasSetRow )
+void QgsSpatialQueryDialog::populateLwFeature( QListWidget *lw, QSet<int> & setFeatures )
 {
-  listWidget->blockSignals( true );
-  listWidget->clear();
-  listWidget->setEnabled( false );
-
+  lw->blockSignals( true );
+  lw->clear();
   QSetIterator <int>item( setFeatures );
+  QListWidgetItem *lwItem = NULL;
   while ( item.hasNext() )
   {
-    listWidget->addItem( QString::number( item.next() ) );
+    lwItem = new QListWidgetItem(lw);
+    QVariant fid  = QVariant( item.next() );
+    lwItem->setData( Qt::UserRole, fid ); // Data
+    lwItem->setData( Qt::DisplayRole, fid ); // Label
+    lw->addItem( lwItem );
   }
-  listWidget->setEnabled( true );
-  if ( hasSetRow )
-  {
-    listWidget->setCurrentRow( 0 );
-  }
-  listWidget->blockSignals( false );
+  lw->sortItems();
+  lw->setCurrentRow(0);
+  lw->blockSignals( false );
+} // void populateLwFeature( QListWidget *lw, QSet<int> & setFeatures )
 
-} // void populateFeatureListWidget( QListWidget *listWidget, QSet<int> & setFeatures )
-
-void QgsSpatialQueryDialog::clearFeatureListWidget( QListWidget *listWidget )
+void QgsSpatialQueryDialog::clearLwFeature( QListWidget *listWidget )
 {
   listWidget->blockSignals( true );
   listWidget->clear();
   listWidget->blockSignals( false );
-} // void QgsSpatialQueryDialog::clearFeatureListWidget( QListWidget *listWidget )
+} // void QgsSpatialQueryDialog::clearLwFeature( QListWidget *listWidget )
 
-void QgsSpatialQueryDialog::changeFeatureListWidget( QListWidget *listWidget, QgsVectorLayer* vectorLayer, const QString& currentText )
+void QgsSpatialQueryDialog::changeLwFeature( QListWidget *listWidget, QgsVectorLayer* vectorLayer, int fid )
 {
-  listWidget->setEnabled( false );
-  bool ok;
-  int id = currentText.toInt( &ok );
-  showRubberFeature( vectorLayer, id );
+  listWidget->setEnabled( false ); // The showRubberFeature can be slow
+  showRubberFeature( vectorLayer, fid );
+  // Zoom
+  if( ckbZoomItem->isChecked() )
+  {
+    zoomFeatureTarget(vectorLayer, fid);
+  }
   listWidget->setEnabled( true );
   listWidget->setFocus();
-} // void QgsSpatialQueryDialog::changeFeatureListWidget( QListWidget *listWidget, QgsVectorLayer* layer, const QString& currentText )
+} // void QgsSpatialQueryDialog::changeLwFeature( QListWidget *listWidget, QgsVectorLayer* layer, int fid )
 
+void QgsSpatialQueryDialog::zoomFeatureTarget(QgsVectorLayer* vectorLayer, int fid)
+{
+  QgsFeature feat;
+  if ( !vectorLayer->featureAtId( fid, feat, true, false ) )
+  {
+    return;
+  }
+  if ( !feat.geometry() )
+  {
+    return;
+  }
+  // Set system reference
+  QgsCoordinateReferenceSystem srsSource = vectorLayer->srs();
+  QgsCoordinateReferenceSystem srcMapcanvas = mIface->mapCanvas()->mapRenderer()->destinationSrs();
+  QgsCoordinateTransform * coordTransform =  new QgsCoordinateTransform( srsSource, srcMapcanvas );
+  QgsRectangle rectExtent = coordTransform->transform( feat.geometry()->boundingBox() );
+  delete coordTransform;
+
+  mIface->mapCanvas()->setExtent( rectExtent );
+  mIface->mapCanvas()->refresh();
+} // void QgsSpatialQueryDialog::zoomFeatureTarget(QgsVectorLayer* vectorLayer, int fid)
+
 void QgsSpatialQueryDialog::showRubberFeature( QgsVectorLayer* vectorLayer, int id )
 {
   mRubberSelectId->reset();
@@ -638,9 +773,8 @@
   setCursor( c );
 } // void QgsSpatialQueryDialog::showRubberFeature( QgsVectorLayer* vectorLayer, int id )
 
-
 //! Slots for signs of Dialog
-void QgsSpatialQueryDialog::on_buttonBoxMain_accepted()
+void QgsSpatialQueryDialog::on_bbMain_accepted()
 {
   if ( ! mLayerReference )
   {
@@ -658,30 +792,31 @@
   QDateTime datetimeEnd = QDateTime::currentDateTime();
   showResultQuery( &datetimeStart, &datetimeEnd );
   adjustSize();
-} // QgsSpatialQueryDialog::on_buttonBoxMain_accepted()
+} // QgsSpatialQueryDialog::on_bbMain_accepted()
 
-void QgsSpatialQueryDialog::on_buttonBoxMain_rejected()
+void QgsSpatialQueryDialog::on_bbMain_rejected()
 {
-  if ( grpResult->isHidden() )
+  if ( twResultInvalid->isHidden() )
   {
     reject();
   }
   else
   {
+    mRubberSelectId->reset();
     setLayoutResultInvalid( false );
     setLayoutOperationVisible( true );
-    progressBarStatus->show();
-    buttonBoxMain->button( QDialogButtonBox::Close )->hide();
-    buttonBoxMain->button( QDialogButtonBox::Cancel )->show();
-    buttonBoxMain->button( QDialogButtonBox::Ok )->show();
+    pgbStatus->show();
+    bbMain->button( QDialogButtonBox::Close )->hide();
+    bbMain->button( QDialogButtonBox::Cancel )->show();
+    bbMain->button( QDialogButtonBox::Ok )->show();
   }
   adjustSize();
-} // void QgsSpatialQueryDialog::on_buttonBoxMain_rejected()
+} // void QgsSpatialQueryDialog::on_bbMain_rejected()
 
-void QgsSpatialQueryDialog::on_targetLayerComboBox_currentIndexChanged( int index )
+void QgsSpatialQueryDialog::on_cbTargetLayer_currentIndexChanged( int index )
 {
   // Add old target layer in reference combobox
-  addLayerCombobox( false, mLayerTarget );
+  addCbLayer( false, mLayerTarget );
 
   // Set target layer
   setLayer( true, index );
@@ -690,97 +825,141 @@
   // Remove new target layer in reference combobox
   removeLayer( false, mLayerTarget );
 
-  populateOperationComboBox();
+  populateCbOperation();
 
-} // QgsSpatialQueryDialog::on_targetLayerComboBox_currentIndexChanged(int index)
+} // QgsSpatialQueryDialog::on_cbTargetLayer_currentIndexChanged(int index)
 
-void QgsSpatialQueryDialog::on_referenceLayerComboBox_currentIndexChanged( int index )
+void QgsSpatialQueryDialog::on_cbReferenceLayer_currentIndexChanged( int index )
 {
   setLayer( false, index );
   evaluateCheckBox( false );
 
-  populateOperationComboBox();
+  populateCbOperation();
 
-} // QgsSpatialQueryDialog::on_referenceLayerComboBox_currentIndexChanged(int index);
+} // QgsSpatialQueryDialog::on_cbReferenceLayer_currentIndexChanged(int index);
 
-void QgsSpatialQueryDialog::on_resultFeatureTargetListWidget_itemClicked( QListWidgetItem * item )
+void QgsSpatialQueryDialog::on_lwResultFeatureTarget_currentItemChanged( QListWidgetItem * item )
 {
-  if ( mCurrentFeatureWidget != FW_Result )
-  {
-    mCurrentFeatureWidget = FW_Result;
-    on_resultFeatureTargetListWidget_currentItemChanged( item );
-  }
-} // void QgsSpatialQueryDialog::on_resultFeatureTargetListWidget_itemClicked( QListWidgetItem * item )
+  mRubberSelectId->setColor( mRGBRubberSelect[0], mRGBRubberSelect[1], mRGBRubberSelect[2], 0.5, 2 );
+  int fid = item->data(Qt::UserRole).asInt();
+  changeLwFeature( lwResultFeatureTarget, mLayerTarget, fid );
+} // void QgsSpatialQueryDialog::on_lwResultFeatureTarget_currentItemChanged( QListWidgetItem * item )
 
-void  QgsSpatialQueryDialog::on_resultFeatureTargetListWidget_currentItemChanged( QListWidgetItem * item )
+void QgsSpatialQueryDialog::on_twResultInvalid_currentChanged ( int index )
 {
-  if ( mCurrentFeatureWidget != FW_Result )
+  if ( index  == 0 ) // Result target
   {
-    mCurrentFeatureWidget = FW_Result;
+    if ( lwResultFeatureTarget->count() > 0)
+    {
+      on_lwResultFeatureTarget_currentItemChanged( lwResultFeatureTarget->currentItem() );
+    }
   }
-  mRubberSelectId->setColor( mRGBRubberSelect[0], mRGBRubberSelect[1], mRGBRubberSelect[2], 0.5, 2 );
-  changeFeatureListWidget( resultFeatureTargetListWidget, mLayerTarget, item->text() );
-} // void  QgsSpatialQueryDialog::on_resultFeatureTargetListWidget_currentItemChanged( QListWidgetItem * item )
-
-void QgsSpatialQueryDialog::on_invalidFeatureTargetListWidget_itemClicked( QListWidgetItem * item )
-{
-  if ( mCurrentFeatureWidget != FW_InvalidTarget )
+  else // Invalid target
   {
-    mCurrentFeatureWidget = FW_InvalidTarget;
-    on_invalidFeatureTargetListWidget_currentItemChanged( item );
+    if ( lwInvalidFeatureTarget->count() > 0)
+    {
+      on_lwInvalidFeatureTarget_currentItemChanged( lwInvalidFeatureTarget->currentItem() );
+    }
   }
-} // void QgsSpatialQueryDialog::on_invalidFeatureTargetListWidget_itemClicked( QListWidgetItem * item )
+} // void QgsSpatialQueryDialog::on_twResultInvalid_currentChanged ( int index )
 
-void  QgsSpatialQueryDialog::on_invalidFeatureTargetListWidget_currentItemChanged( QListWidgetItem * item )
+void QgsSpatialQueryDialog::on_twInvalid_currentChanged ( int index )
 {
-  if ( mCurrentFeatureWidget != FW_InvalidTarget )
+  if (index  == 0 ) // Target
   {
-    mCurrentFeatureWidget = FW_InvalidTarget;
+    if ( lwInvalidFeatureTarget->count() > 0)
+    {
+      on_lwInvalidFeatureTarget_currentItemChanged( lwInvalidFeatureTarget->currentItem() );
+    }
   }
-  mRubberSelectId->setColor( 255, 0, 0, 0.5, 2 ); // RED
-  changeFeatureListWidget( invalidFeatureTargetListWidget, mLayerTarget, item->text() );
-} // void  QgsSpatialQueryDialog::on_invalidFeatureTargetListWidget_currentItemChanged( QListWidgetItem * item )
-
-void QgsSpatialQueryDialog::on_invalidFeatureReferenceListWidget_itemClicked( QListWidgetItem * item )
-{
-  if ( mCurrentFeatureWidget != FW_InvalidRefence )
+  else // Reference
   {
-    mCurrentFeatureWidget = FW_InvalidRefence;
-    on_invalidFeatureReferenceListWidget_currentItemChanged( item );
+    if ( lwInvalidFeatureReference->count() > 0)
+    {
+      on_lwInvalidFeatureReference_currentItemChanged( lwInvalidFeatureReference->currentItem() );
+    }
   }
-} // void QgsSpatialQueryDialog::on_invalidFeatureReferenceListWidget_itemClicked( QListWidgetItem * item )
 
-void  QgsSpatialQueryDialog::on_invalidFeatureReferenceListWidget_currentItemChanged( QListWidgetItem * item )
+} // void QgsSpatialQueryDialog::on_twInvalid_currentChanged ( int index );
+
+void QgsSpatialQueryDialog::on_lwInvalidFeatureTarget_currentItemChanged( QListWidgetItem * item )
 {
-  if ( mCurrentFeatureWidget != FW_InvalidRefence )
-  {
-    mCurrentFeatureWidget = FW_InvalidRefence;
-  }
   mRubberSelectId->setColor( 255, 0, 0, 0.5, 2 ); // RED
-  changeFeatureListWidget( invalidFeatureReferenceListWidget, mLayerReference, item->text() );
-} // void  QgsSpatialQueryDialog::on_invalidFeatureReferenceListWidget_currentItemChanged( QListWidgetItem * item )
+  int fid = item->data(Qt::UserRole).asInt();
+  changeLwFeature( lwInvalidFeatureTarget, mLayerTarget, fid );
+} // void QgsSpatialQueryDialog::on_lwInvalidFeatureTarget_currentItemChanged( QListWidgetItem * item )
 
-void QgsSpatialQueryDialog::on_ckboxLogProcessing_clicked( bool checked )
+void QgsSpatialQueryDialog::on_lwInvalidFeatureReference_currentItemChanged( QListWidgetItem * item )
 {
+  mRubberSelectId->setColor( 255, 0, 0, 0.5, 2 ); // RED
+  int fid = item->data(Qt::UserRole).asInt();
+  changeLwFeature( lwInvalidFeatureReference, mLayerReference, fid );
+} // void QgsSpatialQueryDialog::on_lwInvalidFeatureReference_currentItemChanged( QListWidgetItem * item )
+
+void QgsSpatialQueryDialog::on_ckbLogProcessing_clicked( bool checked )
+{
   showLogProcessing( checked );
   adjustSize();
 
-} // void QgsSpatialQueryDialog::on_ckboxLogProcessing_clicked(bool checked)
+} // void QgsSpatialQueryDialog::on_ckbLogProcessing_clicked(bool checked)
 
-void QgsSpatialQueryDialog::on_pushButtonSelectResultTarget_clicked()
+void QgsSpatialQueryDialog::on_ckbZoomItem_clicked( bool checked )
 {
+  if( checked )
+  {
+    QListWidget    *lw  = lwResultFeatureTarget;
+    QgsVectorLayer *lyr = mLayerTarget;
+    // Get current list feature (Result Target, Invalid Target and Invalid Reference)
+    if( twResultInvalid->currentIndex() != 0 ) // Invalid
+    {
+      // 0 -> Invalid Target
+      if( twInvalid->currentIndex()  == 0 ) // Target
+      {
+        lw = lwInvalidFeatureTarget;
+      }
+      else // Reference
+      {
+        lw = lwInvalidFeatureReference;
+        lyr = mLayerReference;
+      }
+    }
+    bool ok;
+    int fid = lw->currentItem()->text().toInt( &ok );
+    zoomFeatureTarget(lyr, fid);
+  }
+} // QgsSpatialQueryDialog::on_ckbZoomItem_clicked( bool checked )
+
+void QgsSpatialQueryDialog::on_pbSelectResultTarget_clicked()
+{
   mLayerTarget->setSelectedFeatures( mFeatureResult );
-} // void QgsSpatialQueryDialog::on_pushButtonSelectResultTarget_clicked()
+} // void QgsSpatialQueryDialog::on_pbSelectResultTarget_clicked()
 
-void QgsSpatialQueryDialog::on_pushButtonSelectInvalidTarget_clicked()
+void QgsSpatialQueryDialog::on_pbSelectResultTargetAdd_clicked()
 {
+  mLayerTarget->setSelectedFeatures( mLayerTarget->selectedFeaturesIds() + mFeatureResult );
+} // void QgsSpatialQueryDialog::on_pbSelectResultTargetAdd_clicked()
+
+void QgsSpatialQueryDialog::on_pbSelectResultTargetRemove_clicked()
+{
+  mLayerTarget->setSelectedFeatures( mLayerTarget->selectedFeaturesIds() - mFeatureResult );
+} // void QgsSpatialQueryDialog::on_pbSelectResultTargetRemove_clicked()
+
+void QgsSpatialQueryDialog::on_pbSelectedSubsetLayer_clicked()
+{
+  mLayerTarget->setSubsetString( getSubsetSelected( mLayerTarget ) );
+  mLayerTarget->removeSelection();
+  mIface->mapCanvas()->refresh();
+} // void QgsSpatialQueryDialog::on_pbSelectedSubsetLayer_clicked()
+
+void QgsSpatialQueryDialog::on_pbSelectInvalidTarget_clicked()
+{
   mLayerTarget->setSelectedFeatures( mFeatureInvalidTarget );
-} // void QgsSpatialQueryDialog::on_pushButtonSelectInvalidTarget_clicked()
+} // void QgsSpatialQueryDialog::on_pbSelectInvalidTarget_clicked()
 
-void QgsSpatialQueryDialog::on_pushButtonSelectInvalidReference_clicked()
+void QgsSpatialQueryDialog::on_pbSelectInvalidReference_clicked()
 {
   mLayerReference->setSelectedFeatures( mFeatureInvalidReference );
-} // void QgsSpatialQueryDialog::on_pushButtonSelectInvalidReference_clicked()
+} // void QgsSpatialQueryDialog::on_pbSelectInvalidReference_clicked()
 
 
 //! Slots for signs of QGIS
@@ -795,14 +974,13 @@
   {
     return;
   }
-  addLayerCombobox( true, vectorLayer );
-  addLayerCombobox( false, vectorLayer );
-  mMapIdVectorLayers.insert( vectorLayer->id(), vectorLayer );
-
+  addCbLayer( true, vectorLayer );
+  addCbLayer( false, vectorLayer );
+  mMapIdVectorLayers.insert( vectorLayer->getLayerID(), vectorLayer );
   // Verify is can enable buttonBox
-  if ( !buttonBoxMain->button( QDialogButtonBox::Ok )->isEnabled() && targetLayerComboBox->count() > 1 )
+  if ( !bbMain->button( QDialogButtonBox::Ok )->isEnabled() && cbTargetLayer->count() > 1 )
   {
-    buttonBoxMain->button( QDialogButtonBox::Ok )->setEnabled( true );
+    bbMain->button( QDialogButtonBox::Ok )->setEnabled( true );
   }
 
 } // QgsSpatialQueryDialog::signal_qgis_layerWasAdded(QgsMapLayer* mapLayer)
@@ -825,17 +1003,17 @@
   QgsVectorLayer *vectorLayer = i.value();
   removeLayer( true, vectorLayer ); // set new target if need
   removeLayer( false, vectorLayer ); // set new reference if need
-  if ( mLayerTarget && getIndexLayerCombobox( referenceLayerComboBox, mLayerTarget ) > -1 )
+  if ( mLayerTarget && getCbIndexLayer( cbReferenceLayer, mLayerTarget ) > -1 )
   {
     removeLayer( false, mLayerTarget );
   }
 
-  populateOperationComboBox();
+  populateCbOperation();
 
-  if ( targetLayerComboBox->count() < 2 )
+  if ( cbTargetLayer->count() < 2 )
   {
-    buttonBoxMain->button( QDialogButtonBox::Ok )->setEnabled( false );
-    textEditStatus->append( mMsgLayersLessTwo );
+    bbMain->button( QDialogButtonBox::Ok )->setEnabled( false );
+    teStatus->append( mMsgLayersLessTwo );
   }
 
 } // QgsSpatialQueryDialog::signal_qgis_layerWillBeRemoved(QString idLayer)
@@ -844,7 +1022,8 @@
 void QgsSpatialQueryDialog::signal_layerTarget_selectionFeaturesChanged()
 {
   evaluateCheckBox( true );
-
+  evaluateButtonSelected();
+  setLabelButtonSelected(lbSelected, mLayerTarget, pbSelectedSubsetLayer);
 } // void QgsSpatialQueryDialog::signal_layerTarget_selectionFeaturesChanged()
 
 void QgsSpatialQueryDialog::signal_layerReference_selectionFeaturesChanged()


Property changes on: trunk/qgis/src/plugins/spatialquery/qgsspatialquerydialog.cpp
___________________________________________________________________
Added: svn:executable
   + *

Modified: trunk/qgis/src/plugins/spatialquery/qgsspatialquerydialog.h
===================================================================
--- trunk/qgis/src/plugins/spatialquery/qgsspatialquerydialog.h	2011-03-01 07:03:02 UTC (rev 15299)
+++ trunk/qgis/src/plugins/spatialquery/qgsspatialquerydialog.h	2011-03-01 07:59:56 UTC (rev 15300)
@@ -15,7 +15,7 @@
  *   (at your option) any later version.                                   *
  *                                                                         *
  ***************************************************************************/
-/*  $Id$ */
+/*  $Id: qgsspatialquerydialog.h 15141 2011-02-08 13:34:43Z jef $ */
 
 #ifndef SPATIALQUERYDIALOG_H
 #define SPATIALQUERYDIALOG_H
@@ -27,19 +27,6 @@
 #include "qgsvectorlayer.h"
 
 /**
-* \brief Enum with feature listwidget
-* \enum Feature_Widget
-*
-*/
-enum Feature_Widget
-{
-  FW_Result,
-  FW_InvalidTarget,
-  FW_InvalidRefence
-};
-
-
-/**
 * \class QgsSpatialQueryDialog
 * \brief Spatial Query dialog
 *
@@ -68,20 +55,23 @@
 
   private slots:
     //! Slots for signs of Dialog
-    void on_buttonBoxMain_accepted();
-    void on_buttonBoxMain_rejected();
-    void on_targetLayerComboBox_currentIndexChanged( int index );
-    void on_referenceLayerComboBox_currentIndexChanged( int index );
-    void on_resultFeatureTargetListWidget_itemClicked( QListWidgetItem * item );
-    void on_resultFeatureTargetListWidget_currentItemChanged( QListWidgetItem * item );
-    void on_invalidFeatureTargetListWidget_itemClicked( QListWidgetItem * item );
-    void on_invalidFeatureTargetListWidget_currentItemChanged( QListWidgetItem * item );
-    void on_invalidFeatureReferenceListWidget_itemClicked( QListWidgetItem * item );
-    void on_invalidFeatureReferenceListWidget_currentItemChanged( QListWidgetItem * item );
-    void on_ckboxLogProcessing_clicked( bool checked );
-    void on_pushButtonSelectResultTarget_clicked();
-    void on_pushButtonSelectInvalidTarget_clicked();
-    void on_pushButtonSelectInvalidReference_clicked();
+    void on_bbMain_accepted();
+    void on_bbMain_rejected();
+    void on_cbTargetLayer_currentIndexChanged( int index );
+    void on_cbReferenceLayer_currentIndexChanged( int index );
+    void on_lwResultFeatureTarget_currentItemChanged( QListWidgetItem * item );
+    void on_twResultInvalid_currentChanged ( int index );
+    void on_twInvalid_currentChanged ( int index );
+    void on_lwInvalidFeatureTarget_currentItemChanged( QListWidgetItem * item );
+    void on_lwInvalidFeatureReference_currentItemChanged( QListWidgetItem * item );
+    void on_ckbLogProcessing_clicked( bool checked );
+    void on_ckbZoomItem_clicked( bool checked );
+    void on_pbSelectResultTarget_clicked();
+    void on_pbSelectResultTargetAdd_clicked();
+    void on_pbSelectResultTargetRemove_clicked();
+    void on_pbSelectedSubsetLayer_clicked();
+    void on_pbSelectInvalidTarget_clicked();
+    void on_pbSelectInvalidReference_clicked();
 
     //! Slots for signs of QGIS
     void signal_qgis_layerWasAdded( QgsMapLayer* mapLayer );
@@ -101,13 +91,21 @@
     //! Evaluate status of selected features from layer (Target or Reference)
     void evaluateCheckBox( bool isTarget );
     //! Run Query
+    //! Evaluate button selected add and remove
+    void evaluateButtonSelected();
     void runQuery();
     //! Show Log Processing
     void showLogProcessing( bool hasShow );
     //! Show result of query
     void showResultQuery( QDateTime *datetimeStart, QDateTime *datetimeEnd );
+    //! Set label with number's selected features of layer
+    void setLabelButtonSelected( QLabel *lb,  QgsVectorLayer* layer, QPushButton *pb);
+    //! Get string subset with selected FID
+    QString getSubsetSelected( QgsVectorLayer* layer );
     //! Get Description Layer to show result
     QString getDescriptionLayerShow( bool isTarget );
+    //! Get Description Layer to show result
+    QString getDescriptionInvalidFeaturesShow( bool isTarget );
     //! Connect all slots
     void connectAll();
     //! Disconnect all slots
@@ -119,23 +117,25 @@
     //! Get Icon for vector layer
     QIcon getIconTypeGeometry( QGis::GeometryType geomType );
     //! Add layer in combobox (text, data and  tooltips)
-    void addLayerCombobox( bool isTarget, QgsVectorLayer* vectorLayer );
+    void addCbLayer( bool isTarget, QgsVectorLayer* vectorLayer );
     //! Find Layer in combobox
-    int getIndexLayerCombobox( bool isTarget, QgsVectorLayer* vectorLayer );
+    int getCbIndexLayer( bool isTarget, QgsVectorLayer* vectorLayer );
     //! Remove layer in combobox and setting GUI
     void removeLayer( bool isTarget, QgsVectorLayer* lyrRemove );
-    //! Populates targetLayerComboBox with all layers
-    void populateTargetLayerComboBox();
-    //! Populates referenceLayerComboBox with all layers except the current target layer
-    void populateReferenceLayerComboBox();
+    //! Populates cbTargetLayer with all layers
+    void populateCbTargetLayer();
+    //! Populates cbReferenceLayer with all layers except the current target layer
+    void populateCbReferenceLayer();
     //! Populates operationComboBox with the topological operations
-    void populateOperationComboBox();
+    void populateCbOperation();
     //! Populates the features in QListWidget (use by result, invalid target and reference)
-    void populateFeatureListWidget( QListWidget *listWidget, QSet<int> & setFeatures, bool hasSetRow = true );
+    void populateLwFeature( QListWidget *lw, QSet<int> & setFeatures );
     //! Clear the features of QListWidget (use by result, invalid target and reference)
-    void clearFeatureListWidget( QListWidget *listWidget );
+    void clearLwFeature( QListWidget *listWidget );
     //! Make action when change item in ListWidget
-    void changeFeatureListWidget( QListWidget *listWidget, QgsVectorLayer* vectorLayer, const QString& currentText );
+    void changeLwFeature( QListWidget *listWidget, QgsVectorLayer* vectorLayer, int fid );
+    //! Zoom mapcanvas to current feature in listbox target
+    void zoomFeatureTarget(QgsVectorLayer* vectorLayer, int fid);
     //! Show rubber from feature
     void showRubberFeature( QgsVectorLayer* vectorLayer, int id );
 
@@ -157,8 +157,6 @@
     QgsRubberSelectId* mRubberSelectId;
     //! RGB select feature result
     int mRGBRubberSelect[3];
-    //! Current Feature Widget
-    Feature_Widget mCurrentFeatureWidget;
 
     // Message
     QString mMsgLayersLessTwo;


Property changes on: trunk/qgis/src/plugins/spatialquery/qgsspatialquerydialog.h
___________________________________________________________________
Added: svn:executable
   + *

Modified: trunk/qgis/src/plugins/spatialquery/qgsspatialquerydialogbase.qrc
===================================================================
--- trunk/qgis/src/plugins/spatialquery/qgsspatialquerydialogbase.qrc	2011-03-01 07:03:02 UTC (rev 15299)
+++ trunk/qgis/src/plugins/spatialquery/qgsspatialquerydialogbase.qrc	2011-03-01 07:59:56 UTC (rev 15300)
@@ -1,6 +1,9 @@
 <RCC>
     <qresource prefix="/icons">
         <file>spatialquery.png</file>
-        <file>selectall.png</file>
+        <file>select.png</file>
+        <file>selectadd.png</file>
+        <file>selectremove.png</file>
+        <file>selectesubsetlayer.png</file>
     </qresource>
 </RCC>


Property changes on: trunk/qgis/src/plugins/spatialquery/qgsspatialquerydialogbase.qrc
___________________________________________________________________
Added: svn:executable
   + *

Modified: trunk/qgis/src/plugins/spatialquery/qgsspatialquerydialogbase.ui
===================================================================
--- trunk/qgis/src/plugins/spatialquery/qgsspatialquerydialogbase.ui	2011-03-01 07:03:02 UTC (rev 15299)
+++ trunk/qgis/src/plugins/spatialquery/qgsspatialquerydialogbase.ui	2011-03-01 07:59:56 UTC (rev 15300)
@@ -9,8 +9,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>940</width>
-    <height>355</height>
+    <width>520</width>
+    <height>495</height>
    </rect>
   </property>
   <property name="minimumSize">
@@ -34,9 +34,12 @@
   <property name="locale">
    <locale language="English" country="UnitedKingdom"/>
   </property>
-  <layout class="QVBoxLayout" name="verticalLayout">
+  <layout class="QVBoxLayout" name="verticalLayout_8">
    <item>
     <layout class="QHBoxLayout" name="lytOperatorResultInvalid">
+     <property name="sizeConstraint">
+      <enum>QLayout::SetMinimumSize</enum>
+     </property>
      <item>
       <layout class="QVBoxLayout" name="lytOperator">
        <item>
@@ -52,7 +55,7 @@
            <enum>QLayout::SetMinimumSize</enum>
           </property>
           <item>
-           <widget class="QComboBox" name="targetLayerComboBox">
+           <widget class="QComboBox" name="cbTargetLayer">
             <property name="maximumSize">
              <size>
               <width>16777215</width>
@@ -65,7 +68,7 @@
            </widget>
           </item>
           <item>
-           <widget class="QCheckBox" name="usingSelectedTargetCheckBox">
+           <widget class="QCheckBox" name="ckbUsingSelectedTarget">
             <property name="toolTip">
              <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
 &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
@@ -79,8 +82,8 @@
            </widget>
           </item>
          </layout>
-         <zorder>usingSelectedTargetCheckBox</zorder>
-         <zorder>targetLayerComboBox</zorder>
+         <zorder>ckbUsingSelectedTarget</zorder>
+         <zorder>cbTargetLayer</zorder>
         </widget>
        </item>
        <item>
@@ -96,7 +99,7 @@
            <enum>QLayout::SetMinimumSize</enum>
           </property>
           <item>
-           <widget class="QComboBox" name="referenceLayerComboBox">
+           <widget class="QComboBox" name="cbReferenceLayer">
             <property name="maximumSize">
              <size>
               <width>16777215</width>
@@ -109,7 +112,7 @@
            </widget>
           </item>
           <item>
-           <widget class="QCheckBox" name="usingSelectedReferenceCheckBox">
+           <widget class="QCheckBox" name="ckbUsingSelectedReference">
             <property name="maximumSize">
              <size>
               <width>16777215</width>
@@ -144,7 +147,7 @@
            <enum>QLayout::SetMinimumSize</enum>
           </property>
           <item>
-           <widget class="QComboBox" name="operantionComboBox">
+           <widget class="QComboBox" name="cbOperantion">
             <property name="maximumSize">
              <size>
               <width>16777215</width>
@@ -162,238 +165,296 @@
       </layout>
      </item>
      <item>
-      <layout class="QVBoxLayout" name="lytResultInvalidMessage">
+      <layout class="QVBoxLayout" name="lytResultInvalid">
        <item>
-        <layout class="QHBoxLayout" name="lytResultInvalid">
-         <item>
-          <widget class="QGroupBox" name="grpResult">
-           <property name="enabled">
-            <bool>true</bool>
-           </property>
-           <property name="title">
-            <string>Results</string>
-           </property>
-           <layout class="QVBoxLayout" name="verticalLayout_7">
-            <item>
-             <layout class="QHBoxLayout" name="lytTargetResult">
-              <item>
-               <widget class="QPushButton" name="pushButtonSelectResultTarget">
-                <property name="toolTip">
-                 <string>Select all features of result</string>
-                </property>
-                <property name="text">
-                 <string/>
-                </property>
-                <property name="icon">
-                 <iconset resource="qgsspatialquerydialogbase.qrc">
-                  <normaloff>:/icons/selectall.png</normaloff>:/icons/selectall.png</iconset>
-                </property>
-               </widget>
-              </item>
-              <item>
-               <widget class="QLabel" name="resultTargetLabel">
-                <property name="minimumSize">
-                 <size>
-                  <width>18</width>
-                  <height>20</height>
-                 </size>
-                </property>
-                <property name="maximumSize">
-                 <size>
-                  <width>16777215</width>
-                  <height>30</height>
-                 </size>
-                </property>
-                <property name="toolTip">
-                 <string>Total of features from query</string>
-                </property>
-                <property name="text">
-                 <string>Target layer</string>
-                </property>
-               </widget>
-              </item>
-              <item>
-               <spacer name="horizontalSpacer">
-                <property name="orientation">
-                 <enum>Qt::Horizontal</enum>
-                </property>
-                <property name="sizeHint" stdset="0">
-                 <size>
-                  <width>40</width>
-                  <height>20</height>
-                 </size>
-                </property>
-               </spacer>
-              </item>
-             </layout>
-            </item>
-            <item>
-             <widget class="QListWidget" name="resultFeatureTargetListWidget">
-              <property name="maximumSize">
-               <size>
-                <width>16777215</width>
-                <height>16777215</height>
-               </size>
-              </property>
-              <property name="toolTip">
-               <string>Select item to identify geometry of feature</string>
-              </property>
-             </widget>
-            </item>
-           </layout>
-          </widget>
-         </item>
-         <item>
-          <widget class="QGroupBox" name="grpInvalid">
-           <property name="title">
-            <string>Invalid features</string>
-           </property>
-           <layout class="QHBoxLayout" name="horizontalLayout_2">
-            <item>
-             <layout class="QVBoxLayout" name="verticalLayout_2">
-              <item>
-               <layout class="QHBoxLayout" name="lytTargetInvalid">
-                <item>
-                 <widget class="QPushButton" name="pushButtonSelectInvalidTarget">
-                  <property name="toolTip">
-                   <string>select all features invalid target</string>
-                  </property>
-                  <property name="text">
-                   <string/>
-                  </property>
-                  <property name="icon">
-                   <iconset resource="qgsspatialquerydialogbase.qrc">
-                    <normaloff>:/icons/selectall.png</normaloff>:/icons/selectall.png</iconset>
-                  </property>
-                 </widget>
-                </item>
-                <item>
-                 <widget class="QLabel" name="invalidTargetLabel">
-                  <property name="text">
-                   <string>Target layer</string>
-                  </property>
-                 </widget>
-                </item>
-                <item>
-                 <spacer name="horizontalSpacer_2">
-                  <property name="orientation">
-                   <enum>Qt::Horizontal</enum>
-                  </property>
-                  <property name="sizeHint" stdset="0">
-                   <size>
-                    <width>40</width>
-                    <height>20</height>
-                   </size>
-                  </property>
-                 </spacer>
-                </item>
-               </layout>
-              </item>
-              <item>
-               <widget class="QListWidget" name="invalidFeatureTargetListWidget">
-                <property name="toolTip">
-                 <string>Select item to identify geometry of feature</string>
-                </property>
-               </widget>
-              </item>
-             </layout>
-            </item>
-            <item>
-             <layout class="QVBoxLayout" name="verticalLayout_6">
-              <item>
-               <layout class="QHBoxLayout" name="lytReferenceInvalid">
-                <item>
-                 <widget class="QPushButton" name="pushButtonSelectInvalidReference">
-                  <property name="toolTip">
-                   <string>select all features invalid reference</string>
-                  </property>
-                  <property name="text">
-                   <string/>
-                  </property>
-                  <property name="icon">
-                   <iconset resource="qgsspatialquerydialogbase.qrc">
-                    <normaloff>:/icons/selectall.png</normaloff>:/icons/selectall.png</iconset>
-                  </property>
-                 </widget>
-                </item>
-                <item>
-                 <widget class="QLabel" name="invalidReferenceLabel">
-                  <property name="text">
-                   <string>Reference layer</string>
-                  </property>
-                 </widget>
-                </item>
-                <item>
-                 <spacer name="horizontalSpacer_3">
-                  <property name="orientation">
-                   <enum>Qt::Horizontal</enum>
-                  </property>
-                  <property name="sizeHint" stdset="0">
-                   <size>
-                    <width>40</width>
-                    <height>20</height>
-                   </size>
-                  </property>
-                 </spacer>
-                </item>
-               </layout>
-              </item>
-              <item>
-               <widget class="QListWidget" name="invalidFeatureReferenceListWidget">
-                <property name="toolTip">
-                 <string>Select item to identify geometry of feature</string>
-                </property>
-               </widget>
-              </item>
-             </layout>
-            </item>
-           </layout>
-          </widget>
-         </item>
-        </layout>
-       </item>
-       <item>
-        <layout class="QHBoxLayout" name="lytShowInfo">
-         <item>
-          <widget class="QCheckBox" name="ckboxLogProcessing">
-           <property name="toolTip">
-            <string>Check to show log processing of query</string>
-           </property>
-           <property name="text">
-            <string>Show log messages</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <spacer name="spaceShowInfo">
-           <property name="orientation">
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeHint" stdset="0">
-            <size>
-             <width>40</width>
-             <height>20</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
-          <widget class="QLabel" name="labelInfo">
-           <property name="text">
-            <string>* Select item to highlight on map</string>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </item>
-       <item>
-        <widget class="QTextEdit" name="textEditStatus">
-         <property name="enabled">
-          <bool>true</bool>
+        <widget class="QTabWidget" name="twResultInvalid">
+         <property name="tabPosition">
+          <enum>QTabWidget::North</enum>
          </property>
-         <property name="textInteractionFlags">
-          <set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
+         <property name="currentIndex">
+          <number>0</number>
          </property>
+         <widget class="QWidget" name="tabResult">
+          <attribute name="title">
+           <string>Result</string>
+          </attribute>
+          <layout class="QVBoxLayout" name="verticalLayout_7">
+           <item>
+            <layout class="QHBoxLayout" name="lytTargetResult">
+             <item>
+              <widget class="QLabel" name="lbResultTarget">
+               <property name="minimumSize">
+                <size>
+                 <width>18</width>
+                 <height>20</height>
+                </size>
+               </property>
+               <property name="maximumSize">
+                <size>
+                 <width>16777215</width>
+                 <height>30</height>
+                </size>
+               </property>
+               <property name="toolTip">
+                <string>Total of features from query</string>
+               </property>
+               <property name="text">
+                <string>Layer</string>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <spacer name="horizontalSpacer">
+               <property name="orientation">
+                <enum>Qt::Horizontal</enum>
+               </property>
+               <property name="sizeHint" stdset="0">
+                <size>
+                 <width>40</width>
+                 <height>20</height>
+                </size>
+               </property>
+              </spacer>
+             </item>
+             <item>
+              <widget class="QPushButton" name="pbSelectResultTarget">
+               <property name="toolTip">
+                <string>New selection with features of result</string>
+               </property>
+               <property name="text">
+                <string/>
+               </property>
+               <property name="icon">
+                <iconset resource="qgsspatialquerydialogbase.qrc">
+                 <normaloff>:/icons/select.png</normaloff>:/icons/select.png</iconset>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QPushButton" name="pbSelectResultTargetAdd">
+               <property name="toolTip">
+                <string>Add selection with features of result</string>
+               </property>
+               <property name="text">
+                <string/>
+               </property>
+               <property name="icon">
+                <iconset resource="qgsspatialquerydialogbase.qrc">
+                 <normaloff>:/icons/selectadd.png</normaloff>:/icons/selectadd.png</iconset>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QPushButton" name="pbSelectResultTargetRemove">
+               <property name="toolTip">
+                <string>Remove selection with features of result</string>
+               </property>
+               <property name="text">
+                <string/>
+               </property>
+               <property name="icon">
+                <iconset resource="qgsspatialquerydialogbase.qrc">
+                 <normaloff>:/icons/selectremove.png</normaloff>:/icons/selectremove.png</iconset>
+               </property>
+              </widget>
+             </item>
+            </layout>
+           </item>
+           <item>
+            <widget class="QLabel" name="lbFIDresultTarget">
+             <property name="text">
+              <string>Feature IDs:</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QListWidget" name="lwResultFeatureTarget">
+             <property name="maximumSize">
+              <size>
+               <width>16777215</width>
+               <height>16777215</height>
+              </size>
+             </property>
+             <property name="toolTip">
+              <string>Select item to identify geometry of feature</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <layout class="QHBoxLayout" name="lytSelected">
+             <item>
+              <widget class="QLabel" name="lbSelected">
+               <property name="locale">
+                <locale language="English" country="UnitedStates"/>
+               </property>
+               <property name="text">
+                <string notr="true">selected items</string>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <spacer name="horizontalSpacer_4">
+               <property name="orientation">
+                <enum>Qt::Horizontal</enum>
+               </property>
+               <property name="sizeHint" stdset="0">
+                <size>
+                 <width>40</width>
+                 <height>20</height>
+                </size>
+               </property>
+              </spacer>
+             </item>
+             <item>
+              <widget class="QPushButton" name="pbSelectedSubsetLayer">
+               <property name="toolTip">
+                <string>Set  subset in layer with selected items</string>
+               </property>
+               <property name="text">
+                <string/>
+               </property>
+               <property name="icon">
+                <iconset resource="qgsspatialquerydialogbase.qrc">
+                 <normaloff>:/icons/selectesubsetlayer.png</normaloff>:/icons/selectesubsetlayer.png</iconset>
+               </property>
+              </widget>
+             </item>
+            </layout>
+           </item>
+          </layout>
+         </widget>
+         <widget class="QWidget" name="tabInvalid">
+          <attribute name="title">
+           <string>Invalid features</string>
+          </attribute>
+          <layout class="QVBoxLayout" name="verticalLayout_6">
+           <item>
+            <widget class="QTabWidget" name="twInvalid">
+             <property name="currentIndex">
+              <number>0</number>
+             </property>
+             <widget class="QWidget" name="tabTarget">
+              <attribute name="title">
+               <string>Target</string>
+              </attribute>
+              <layout class="QVBoxLayout" name="verticalLayout">
+               <item>
+                <layout class="QHBoxLayout" name="lytTargetInvalid">
+                 <item>
+                  <widget class="QLabel" name="lbInvalidTarget">
+                   <property name="text">
+                    <string>Layer</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <spacer name="horizontalSpacer_2">
+                   <property name="orientation">
+                    <enum>Qt::Horizontal</enum>
+                   </property>
+                   <property name="sizeHint" stdset="0">
+                    <size>
+                     <width>40</width>
+                     <height>20</height>
+                    </size>
+                   </property>
+                  </spacer>
+                 </item>
+                 <item>
+                  <widget class="QPushButton" name="pbSelectInvalidTarget">
+                   <property name="toolTip">
+                    <string>select all features invalid target</string>
+                   </property>
+                   <property name="text">
+                    <string/>
+                   </property>
+                   <property name="icon">
+                    <iconset resource="qgsspatialquerydialogbase.qrc">
+                     <normaloff>:/icons/select.png</normaloff>:/icons/select.png</iconset>
+                   </property>
+                  </widget>
+                 </item>
+                </layout>
+               </item>
+               <item>
+                <widget class="QLabel" name="lbFIDinvalidTarget">
+                 <property name="text">
+                  <string>Feature IDs:</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QListWidget" name="lwInvalidFeatureTarget">
+                 <property name="toolTip">
+                  <string>Select item to identify geometry of feature</string>
+                 </property>
+                </widget>
+               </item>
+              </layout>
+             </widget>
+             <widget class="QWidget" name="tabReference">
+              <attribute name="title">
+               <string>Reference</string>
+              </attribute>
+              <layout class="QVBoxLayout" name="verticalLayout_2">
+               <item>
+                <layout class="QHBoxLayout" name="lytReferenceInvalid">
+                 <item>
+                  <widget class="QLabel" name="lbInvalidReference">
+                   <property name="text">
+                    <string>Layer</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <spacer name="horizontalSpacer_3">
+                   <property name="orientation">
+                    <enum>Qt::Horizontal</enum>
+                   </property>
+                   <property name="sizeHint" stdset="0">
+                    <size>
+                     <width>40</width>
+                     <height>20</height>
+                    </size>
+                   </property>
+                  </spacer>
+                 </item>
+                 <item>
+                  <widget class="QPushButton" name="pbSelectInvalidReference">
+                   <property name="toolTip">
+                    <string>select all features invalid reference</string>
+                   </property>
+                   <property name="text">
+                    <string/>
+                   </property>
+                   <property name="icon">
+                    <iconset resource="qgsspatialquerydialogbase.qrc">
+                     <normaloff>:/icons/select.png</normaloff>:/icons/select.png</iconset>
+                   </property>
+                  </widget>
+                 </item>
+                </layout>
+               </item>
+               <item>
+                <widget class="QLabel" name="lbFIDinvalidReference">
+                 <property name="text">
+                  <string>Feature IDs:</string>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <widget class="QListWidget" name="lwInvalidFeatureReference">
+                 <property name="toolTip">
+                  <string>Select item to identify geometry of feature</string>
+                 </property>
+                </widget>
+               </item>
+              </layout>
+             </widget>
+            </widget>
+           </item>
+          </layout>
+         </widget>
         </widget>
        </item>
       </layout>
@@ -401,9 +462,39 @@
     </layout>
    </item>
    <item>
+    <widget class="QCheckBox" name="ckbZoomItem">
+     <property name="text">
+      <string>Zoom to selected item</string>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QCheckBox" name="ckbLogProcessing">
+     <property name="toolTip">
+      <string>Check to show log processing of query</string>
+     </property>
+     <property name="text">
+      <string>Show log messages</string>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QTextEdit" name="teStatus">
+     <property name="enabled">
+      <bool>true</bool>
+     </property>
+     <property name="textInteractionFlags">
+      <set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
+     </property>
+    </widget>
+   </item>
+   <item>
     <layout class="QVBoxLayout" name="lytProgressBarButtonsMain">
+     <property name="sizeConstraint">
+      <enum>QLayout::SetMinimumSize</enum>
+     </property>
      <item>
-      <widget class="QProgressBar" name="progressBarStatus">
+      <widget class="QProgressBar" name="pgbStatus">
        <property name="value">
         <number>0</number>
        </property>
@@ -416,7 +507,7 @@
       </widget>
      </item>
      <item>
-      <widget class="QDialogButtonBox" name="buttonBoxMain">
+      <widget class="QDialogButtonBox" name="bbMain">
        <property name="maximumSize">
         <size>
          <width>16777215</width>
@@ -437,28 +528,14 @@
     </layout>
    </item>
   </layout>
-  <zorder>grpTargetGroupBox</zorder>
-  <zorder>grpReferenceGroupBox</zorder>
-  <zorder>grpOperationGroupBox</zorder>
-  <zorder>progressBarStatus</zorder>
-  <zorder>buttonBoxMain</zorder>
-  <zorder>grpResult</zorder>
-  <zorder>grpInvalid</zorder>
-  <zorder>grpInvalid</zorder>
-  <zorder>textEditStatus</zorder>
-  <zorder>ckboxLogProcessing</zorder>
-  <zorder>labelInfo</zorder>
  </widget>
  <tabstops>
-  <tabstop>targetLayerComboBox</tabstop>
-  <tabstop>usingSelectedTargetCheckBox</tabstop>
-  <tabstop>referenceLayerComboBox</tabstop>
-  <tabstop>usingSelectedReferenceCheckBox</tabstop>
-  <tabstop>operantionComboBox</tabstop>
-  <tabstop>resultFeatureTargetListWidget</tabstop>
-  <tabstop>invalidFeatureTargetListWidget</tabstop>
-  <tabstop>invalidFeatureReferenceListWidget</tabstop>
-  <tabstop>buttonBoxMain</tabstop>
+  <tabstop>cbTargetLayer</tabstop>
+  <tabstop>ckbUsingSelectedTarget</tabstop>
+  <tabstop>cbReferenceLayer</tabstop>
+  <tabstop>ckbUsingSelectedReference</tabstop>
+  <tabstop>cbOperantion</tabstop>
+  <tabstop>bbMain</tabstop>
  </tabstops>
  <resources>
   <include location="qgsspatialquerydialogbase.qrc"/>


Property changes on: trunk/qgis/src/plugins/spatialquery/qgsspatialquerydialogbase.ui
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/qgis/src/plugins/spatialquery/select.png
===================================================================
--- trunk/qgis/src/plugins/spatialquery/select.png	                        (rev 0)
+++ trunk/qgis/src/plugins/spatialquery/select.png	2011-03-01 07:59:56 UTC (rev 15300)
@@ -0,0 +1,7 @@
+‰PNG
+
+   
+IHDR          Ëžn‡   gAMA  ±üa   tEXtSoftware www.inkscape.org›î<  åIDATHKÅ—±JA†õ„4¢(‚Ö‚Ø(‚Mš4ž…VZkek¥…–"(‚ "¨`ckK{_ÅÛ¹K.ãìq»îÞîíÝi6	,	—ÉþßÌÎLfGÛí6ŽÔ|-¯µJñùñVj“p€ª‹áþe¹ö/(êÍ!t7â-„h¡ÓD–ÌาB(M#Ð Á}Œ¾Ÿh½˜+¼¥ï	n•l'˜<H€FêtWÈÛmŒÂ»°æ:яN… ª÷ÐiaÄNH쮺˜
+ {p„¬7¥EC@¤ šxw½/¢Æñ„W1k@è ɉ?øàÑ/bZB¤-@ Ä»þÄåqkQÈÞ¢ðÞÐÙ À¥ é ¢ƒb –,ù î)ªÎHBž¡Öîæ¨ñzöÏT“ jµõ6´´b,;w÷¯âŒ fÃ-Ÿ:.ÿlé„ýnD¯ZN	 Þq%€úGä;~À«8û˜½Ó<±c怠ò	 pFCÍ¢}ð
+À²„“ïÙ`+’A¨‰§d¶A´_ÇÁ½ÂÖñß>’qUÃrõAÏþ7–Û6%Àcìks&Õ}% a”÷ʶiÑB
+µZ÷µ ò |Ó¼`Õë\™ÝÇeÛ„œû\    IEND®B`‚
\ No newline at end of file


Property changes on: trunk/qgis/src/plugins/spatialquery/select.png
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/qgis/src/plugins/spatialquery/selectadd.png
===================================================================
--- trunk/qgis/src/plugins/spatialquery/selectadd.png	                        (rev 0)
+++ trunk/qgis/src/plugins/spatialquery/selectadd.png	2011-03-01 07:59:56 UTC (rev 15300)
@@ -0,0 +1,5 @@
+‰PNG
+
+   
+IHDR          Ëžn‡   gAMA  ±üa   tEXtSoftware www.inkscape.org›î<  ÙIDATHKÝ—½JÄ@Çã(×)‚`/ˆ"Ø\sjc¥½•­•O`£‚؈¥OÁÆ2Ù|܍³kfÙ¯l²INÁÀ@î²Éÿ·ÿٝLâ8†(ðØÞ›4ÞñùþÖ8Fà m#…Eè¾ç×4
+Íց•Àòc`Ù9°bét—œu@£¨p`„‚}½`¼Ú‘<âõK„ÛűËŒ	Ò`$fÆÊœí)dɃ[Ø	s_è©S!$€:{VL KoP쩽˜ ú±+Hg+š! 4ñrQ+=ÉB¬Y:ÀtÅŸçÀÝHnbUBˆ :Àò³ù‰Ët\û Næ ¦Ûv 8úk€qo€è0_Pá"'ŒE¸Õ IؼîÀê¬nž=ÎÇ[âèü\„âw‚CXu  	Õ ÀâNT at rC­¡ šõÆìÀ!Þ@kB¯„a…H:Ð@­L]S —{à‰˜ „ŠËí§l·@ýŸmÙ€?dˆtvàß t]Œ¾`•âºBdµeyûí8€	¡µèتñßæ:‘o4*«ïِ˜½ºù}À[5ß7C—·!¿§€€H”aJ4 ÞbSTŸk|LHO@ß®­s»8ðS>    IEND®B`‚
\ No newline at end of file


Property changes on: trunk/qgis/src/plugins/spatialquery/selectadd.png
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/qgis/src/plugins/spatialquery/selectesubsetlayer.png
===================================================================
--- trunk/qgis/src/plugins/spatialquery/selectesubsetlayer.png	                        (rev 0)
+++ trunk/qgis/src/plugins/spatialquery/selectesubsetlayer.png	2011-03-01 07:59:56 UTC (rev 15300)
@@ -0,0 +1,11 @@
+‰PNG
+
+   
+IHDR         ®9   gAMA  ±üa   tEXtSoftware www.inkscape.org›î<  ÛIDATXG½—]nÂ0Ç›¤MIÉ
+B|h€ÐT4¶—½íuÏ;ÕŽÆ…v/	´k MâRd!‘6?ûoÇ1ät:A‚üÇ¨7ÔÞþç4cj7íl´ùöNzƒ Ñ2mìbDíhàÆ©‹BÃÁcÁõs¢"¯£æ‹Ü+µ+
+òðdäwE‚ûrì[c%s:ð8_)ÅÑÇÉ:^Ø|_žïÜÒÇÃuáô„—ûɝ‘ßé†cºUßÈù¼#ç,㐎
+Ó…Õ2ÇËŒW/ Ÿ÷ ׯ ·oÿëXùÙ¹_7Ýøa²©@5Ë 5*aà­{À	§,
+‚µsXxYͼýÝDžæ"
+Žv ÔÛÏјUxZ’n¿÷°ü\ÃS5µj'x¥jX–GÃ-Zˆ÷/ \töò›œ×?0>BÁ»
+4[V at R5 4ŽP6¼­JhPià¦ð„|¨œ"óê
+$óç߆§Ù`‘×ò댣´ô¼œê [ é(@ëJÕp:pôZ""¯TÚóÈý‚¿X“ltsþo†‰º‡Š©ÏzrU€…›"äE£€sŒ¢y1hѵU2ʪ4ßÎyñ_5	Õû—˧NTÕ'„ÆYÛYªÞQ­Ú˜/ˆ\‹¢.Z…^    IEND®B`‚
\ No newline at end of file


Property changes on: trunk/qgis/src/plugins/spatialquery/selectesubsetlayer.png
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/qgis/src/plugins/spatialquery/selectremove.png
===================================================================
--- trunk/qgis/src/plugins/spatialquery/selectremove.png	                        (rev 0)
+++ trunk/qgis/src/plugins/spatialquery/selectremove.png	2011-03-01 07:59:56 UTC (rev 15300)
@@ -0,0 +1,10 @@
+‰PNG
+
+   
+IHDR          Ëžn‡   gAMA  ±üa   tEXtSoftware www.inkscape.org›î<  ÅIDATHKí—½JÄ@Çã(×)‚`/ˆ"Ø\s…ÚXioe«O`£‚؈¥OKÈdóq7Î.™°_Éf7‰6¦H2Éÿ·3™ÉìRÇy»3ç_ŸNáÀºZ
+Ëbmïop
+-6•GÀò`Ù°b
+é|W¬M
+€STD`‚‚—}¿¡½›–<ãý+„ÛGßUFé 0+cå®ö²äÉ.l…y¬@ÔÔÉ5€¼zVÌ KïP쥻˜
+ ºÆØ5¤‹5%! ñòpQ#=ÉBl*À|Å_ÇàÑHîb½†-@Ž ËÏǯÓqÓp::€œn3Åñ_L{ÜF´5.Š„öõûv üB­Ý­¥Æ¹¿þrü»Íd?	aô> MÂúu1 ~Cœ`B‰€/€Ò®«ÀW\†Ð:¡_#¢ô;Sh
+ ðàˆÀW\.¿@}Q¾Ã 4Ô½+5ÿ JB?ÆÐJP‘1–åÝËq0 BÑqTãçz¥/ù׉>«ëû>ªµíBþ†ü™F "Q†)Q øˆMVm׸ÏL@?fmªœï¸ê    IEND®B`‚
\ No newline at end of file


Property changes on: trunk/qgis/src/plugins/spatialquery/selectremove.png
___________________________________________________________________
Added: svn:executable
   + *



More information about the QGIS-commit mailing list