@@ -52,14 +52,25 @@ QgsProjectionSelector::QgsProjectionSelector( QWidget* parent, const char *name,
5252 lstCoordinateSystems->header ()->setResizeMode ( AUTHID_COLUMN, QHeaderView::Stretch );
5353 lstCoordinateSystems->header ()->resizeSection ( QGIS_CRS_ID_COLUMN, 0 );
5454 lstCoordinateSystems->header ()->setResizeMode ( QGIS_CRS_ID_COLUMN, QHeaderView::Fixed );
55+ // Hide (internal) ID column
56+ lstCoordinateSystems->setColumnHidden (QGIS_CRS_ID_COLUMN, true );
5557
5658 lstRecent->header ()->setResizeMode ( AUTHID_COLUMN, QHeaderView::Stretch );
5759 lstRecent->header ()->resizeSection ( QGIS_CRS_ID_COLUMN, 0 );
5860 lstRecent->header ()->setResizeMode ( QGIS_CRS_ID_COLUMN, QHeaderView::Fixed );
61+ // Hide (internal) ID column
62+ lstRecent->setColumnHidden (QGIS_CRS_ID_COLUMN, true );
5963
6064 cbxAuthority->addItem ( tr ( " All" ) );
6165 cbxAuthority->addItems ( authorities () );
6266
67+ // TEMP? hide buttons, we now implemented filter
68+ cbxAuthority->hide ();
69+ cbxMode->hide ();
70+ label->hide ();
71+ label_2->hide ();
72+ pbnFind->hide ();
73+
6374 // Read settings from persistent storage
6475 QSettings settings;
6576 mRecentProjections = settings.value ( " /UI/recentProjections" ).toStringList ();
@@ -189,7 +200,6 @@ QString QgsProjectionSelector::ogcWmsCrsFilterAsSqlExpression( QSet<QString> * c
189200 {
190201 return sqlExpression;
191202 }
192-
193203 /*
194204 Ref: WMS 1.3.0, section 6.7.3 "Layer CRS":
195205
@@ -794,7 +804,8 @@ void QgsProjectionSelector::loadCrsList( QSet<QString> *crsFilter )
794804 newItem->setText ( AUTHID_COLUMN, QString::fromUtf8 (( char * )sqlite3_column_text ( ppStmt, 2 ) ) );
795805 // display the qgis srs_id (field 1) in the third column of the list view
796806 newItem->setText ( QGIS_CRS_ID_COLUMN, QString::fromUtf8 (( char * )sqlite3_column_text ( ppStmt, 1 ) ) );
797-
807+ // expand also parent node
808+ newItem->parent ()->setExpanded (true );
798809 }
799810
800811 // display the qgis deprecated in the user data of the item
@@ -982,6 +993,65 @@ void QgsProjectionSelector::on_pbnFind_clicked()
982993 teProjection->setText ( " " );
983994}
984995
996+ void QgsProjectionSelector::on_leSearch_textChanged ( const QString & theFilterTxt)
997+ {
998+ // filter recent crs's
999+ QTreeWidgetItemIterator itr (lstRecent);
1000+ while (*itr) {
1001+ if ( (*itr)->childCount () == 0 ) // it's an end node aka a projection
1002+ {
1003+ if ( (*itr)->text ( NAME_COLUMN ).contains ( theFilterTxt, Qt::CaseInsensitive )
1004+ || (*itr)->text ( AUTHID_COLUMN ).contains ( theFilterTxt, Qt::CaseInsensitive )
1005+ )
1006+ {
1007+ (*itr)->setHidden (false );
1008+ QTreeWidgetItem * parent = (*itr)->parent ();
1009+ while (parent != NULL )
1010+ {
1011+ parent->setExpanded (true );
1012+ parent->setHidden (false );
1013+ parent = parent->parent ();
1014+ }
1015+ }
1016+ else {
1017+ (*itr)->setHidden (true );
1018+ }
1019+ }
1020+ else {
1021+ (*itr)->setHidden (true );
1022+ }
1023+ ++itr;
1024+ }
1025+ // filter crs's
1026+ QTreeWidgetItemIterator it (lstCoordinateSystems);
1027+ while (*it) {
1028+ if ( (*it)->childCount () == 0 ) // it's an end node aka a projection
1029+ {
1030+ if ( (*it)->text ( NAME_COLUMN ).contains ( theFilterTxt, Qt::CaseInsensitive )
1031+ || (*it)->text ( AUTHID_COLUMN ).contains ( theFilterTxt, Qt::CaseInsensitive )
1032+ )
1033+ {
1034+ (*it)->setHidden (false );
1035+ QTreeWidgetItem * parent = (*it)->parent ();
1036+ while (parent != NULL )
1037+ {
1038+ parent->setExpanded (true );
1039+ parent->setHidden (false );
1040+ parent = parent->parent ();
1041+ }
1042+ }
1043+ else {
1044+ (*it)->setHidden (true );
1045+ }
1046+ }
1047+ else {
1048+ (*it)->setHidden (true );
1049+ }
1050+ ++it;
1051+ }
1052+ }
1053+
1054+
9851055long QgsProjectionSelector::getLargestCRSIDMatch ( QString theSql )
9861056{
9871057 long mySrsId = 0 ;
@@ -1094,7 +1164,7 @@ QStringList QgsProjectionSelector::authorities()
10941164 return authorities;
10951165}
10961166
1097- /* !
1167+ /* !linfinity qtcreator qgis
10981168* \brief Make the string safe for use in SQL statements.
10991169* This involves escaping single quotes, double quotes, backslashes,
11001170* and optionally, percentage symbols. Percentage symbols are used
0 commit comments