Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
improve image format selecting in wms selection dialog
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13495 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed May 15, 2010
1 parent f67a049 commit 56f1c5f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/app/qgswmssourceselect.cpp
Expand Up @@ -96,6 +96,9 @@ QgsWMSSourceSelect::QgsWMSSourceSelect( QWidget * parent, Qt::WFlags fl )
mFormats << "image/png8"; // used by geoserver
mLabels << "PNG8";

mFormats << "png"; // used by french IGN geoportail
mLabels << "PNG";

mFormats << "pngt"; // used by french IGN geoportail
mLabels << "PNGT";
}
Expand Down Expand Up @@ -128,12 +131,14 @@ QgsWMSSourceSelect::QgsWMSSourceSelect( QWidget * parent, Qt::WFlags fl )

QRadioButton *btn = new QRadioButton( mLabels[i] );
btn->setToolTip( mFormats[i] );
btn->setHidden( true );
mImageFormatGroup->addButton( btn, i );
layout->addWidget( btn );
}

// default to first encoding
mImageFormatGroup->button( 0 )->setChecked( true );
btnGrpImageEncoding->setDisabled( true );

layout->addStretch();
btnGrpImageEncoding->setLayout( layout );
Expand Down Expand Up @@ -291,7 +296,7 @@ bool QgsWMSSourceSelect::populateLayerList( QgsWmsProvider *wmsProvider )

foreach( QAbstractButton *b, mImageFormatGroup->buttons() )
{
b->setEnabled( false );
b->setHidden( true );
}

foreach( QString encoding, wmsProvider->supportedImageEncodings() )
Expand All @@ -303,9 +308,11 @@ bool QgsWMSSourceSelect::populateLayerList( QgsWmsProvider *wmsProvider )
continue;
}

mImageFormatGroup->button( id )->setEnabled( true );
mImageFormatGroup->button( id )->setVisible( true );
}

btnGrpImageEncoding->setEnabled( true );

QMap<int, QgsNumericSortTreeWidgetItem *> items;
QMap<int, int> layerParents;
QMap<int, QStringList> layerParentNames;
Expand Down

0 comments on commit 56f1c5f

Please sign in to comment.