QGIS API Documentation  master-59fd5e0
QgsOWSSourceSelect Class Reference

Dialog to create connections and add layers from WMS, WFS, WCS etc. More...

#include <qgsowssourceselect.h>

+ Collaboration diagram for QgsOWSSourceSelect:

List of all members.

Classes

struct  SupportedFormat
 Formats supported by provider. More...

Public Slots

virtual void addClicked ()
 Determines the layers the user selected.
void on_mAddDefaultButton_clicked ()
 Add some default wms servers to the list.
void on_mChangeCRSButton_clicked ()
 Opens the Spatial Reference System dialog.
void on_mConnectButton_clicked ()
void on_mConnectionsComboBox_activated (int)
 Stores the selected datasource whenerver it is changed.
void on_mDeleteButton_clicked ()
 Deletes the selected connection.
void on_mDialogButtonBox_helpRequested ()
void on_mEditButton_clicked ()
 Opens a dialog to edit an existing connection.
virtual void on_mLayersTreeWidget_itemSelectionChanged ()
 Signaled when a layer selection is changed.
void on_mLoadButton_clicked ()
 Loads connections from the file.
void on_mNewButton_clicked ()
 Opens the create connection dialog to build a new connection.
void on_mSaveButton_clicked ()
 Saves connections to the file.
void searchFinished ()
void showError (const QString &theTitle, const QString &theFormat, const QString &theError)
 show whatever error is exposed.
void showStatusMessage (const QString &theMessage)
 Set status message to theMessage.

Signals

void addRasterLayer (const QString &rasterLayerPath, const QString &baseName, const QString &providerKey)
void connectionsChanged ()

Public Member Functions

 QgsOWSSourceSelect (QString service, QWidget *parent=0, Qt::WFlags fl=QgisGui::ModalDialogFlags, bool managerMode=false, bool embeddedMode=false)
 Constructor.
 ~QgsOWSSourceSelect ()
 Destructor.

Protected Member Functions

void addDefaultServers ()
 Add a few example servers to the list.
void addWMSListItem (const QDomElement &el, int row, int column)
void addWMSListRow (const QDomElement &item, int row)
void clearCRS ()
 Clear CRSs.
void clearFormats ()
 Clear previously set formats.
void clearTimes ()
 Clear times.
QString connectionInfo ()
 Connection info (uri)
QString connName ()
 Connection name.
QgsNumericSortTreeWidgetItemcreateItem (int id, const QStringList &names, QMap< int, QgsNumericSortTreeWidgetItem * > &items, int &layerAndStyleCount, const QMap< int, int > &layerParents, const QMap< int, QStringList > &layerParentNames)
 create an item including possible parents
QString descriptionForAuthId (QString authId)
 Returns a textual description for the authority id.
virtual void enableLayersForCrs (QTreeWidgetItem *item)
void populateConnectionList ()
 Populate the connection list combo box.
void populateCRS ()
 Set supported CRSs.
void populateFormats ()
 Populate supported formats.
virtual void populateLayerList ()
 Populate the layer list.
void populateTimes ()
 Populate times.
virtual QList< SupportedFormatproviderFormats ()
 List of image formats (encodings) supported by provider.
QNetworkRequest::CacheLoadControl selectedCacheLoadControl ()
 Returns currently selected cache load control.
QString selectedCRS ()
 Returns currently selected Crs.
QString selectedFormat ()
 Returns currently selected format.
virtual QStringList selectedLayersCRSs ()
 Server CRS supported for currently selected layer item(s)
virtual QStringList selectedLayersFormats ()
 List of formats supported for currently selected layer item(s)
virtual QStringList selectedLayersTimes ()
 List of times (temporalDomain timePosition/timePeriod for currently selected layer item(s)
QString selectedTime ()
 Returns currently selected time.
void setConnectionListPosition ()
 Set the server connection combo box to that stored in the config file.

Protected Attributes

QPushButton * mAddButton
QString mConnectionInfo
 Connection info for selected connection.
QString mConnName
 Name for selected connection.
QMap< QString, QString > mCrsNames
QList< QTreeWidgetItem * > mCurrentSelection
QTableWidgetItem * mCurrentTileset
bool mEmbeddedMode
 Embedded mode, without 'Close'.
QString mLastLayerName
 layer name derived from latest layer selection (updated as long it's not edited manually)
bool mManagerMode
 Connections manager mode.
QString mService
 Service name.
QgsDataSourceURI mUri
 URI for selected connection.

Private Slots

void on_mAddWMSButton_clicked ()
void on_mLayerDownButton_clicked ()
void on_mLayerUpButton_clicked ()
void on_mSearchButton_clicked ()
void on_mSearchTableWidget_itemSelectionChanged ()
void on_mTilesetsTableWidget_itemClicked (QTableWidgetItem *item)
virtual void updateButtons ()

Private Attributes

QMap< QString, QString > mMimeLabelMap
 Map mime type labels to supported formats.
QList< SupportedFormatmProviderFormats
 Supported formats.
QString mSelectedCRS
 Selected CRS.
QSet< QString > mSelectedLayersCRSs
 Common CRSs for selected layers.

Detailed Description

Dialog to create connections and add layers from WMS, WFS, WCS etc.

This dialog allows the user to define and save connection information for WMS servers, etc.

The user can then connect and add layers from the WMS server to the map canvas.

Definition at line 50 of file qgsowssourceselect.h.


Constructor & Destructor Documentation

Destructor.

Definition at line 121 of file qgsowssourceselect.cpp.

References QgsDebugMsg.


Member Function Documentation

void QgsOWSSourceSelect::addClicked ( ) [virtual, slot]

Determines the layers the user selected.

Definition at line 379 of file qgsowssourceselect.cpp.

References QgsDebugMsg.

Referenced by QgsOWSSourceSelect().

Add a few example servers to the list.

Definition at line 597 of file qgsowssourceselect.cpp.

References mService, populateConnectionList(), and tr.

Referenced by on_mAddDefaultButton_clicked().

void QgsOWSSourceSelect::addRasterLayer ( const QString &  rasterLayerPath,
const QString &  baseName,
const QString &  providerKey 
) [signal]
void QgsOWSSourceSelect::addWMSListItem ( const QDomElement &  el,
int  row,
int  column 
) [protected]

Definition at line 637 of file qgsowssourceselect.cpp.

Referenced by addWMSListRow().

void QgsOWSSourceSelect::addWMSListRow ( const QDomElement &  item,
int  row 
) [protected]

Definition at line 627 of file qgsowssourceselect.cpp.

References addWMSListItem().

Referenced by searchFinished().

void QgsOWSSourceSelect::clearCRS ( ) [protected]

Clear CRSs.

Definition at line 469 of file qgsowssourceselect.cpp.

References mSelectedCRS, and tr.

Referenced by on_mConnectButton_clicked(), populateCRS(), and QgsOWSSourceSelect().

void QgsOWSSourceSelect::clearFormats ( ) [protected]

Clear previously set formats.

Definition at line 128 of file qgsowssourceselect.cpp.

Referenced by on_mConnectButton_clicked(), and populateFormats().

void QgsOWSSourceSelect::clearTimes ( ) [protected]

Clear times.

Definition at line 228 of file qgsowssourceselect.cpp.

Referenced by on_mConnectButton_clicked().

QString QgsOWSSourceSelect::connectionInfo ( ) [protected]

Connection info (uri)

Definition at line 508 of file qgsowssourceselect.cpp.

References mConnectionInfo.

QString QgsOWSSourceSelect::connName ( ) [protected]

Connection name.

Definition at line 503 of file qgsowssourceselect.cpp.

References mConnName.

QgsNumericSortTreeWidgetItem * QgsOWSSourceSelect::createItem ( int  id,
const QStringList &  names,
QMap< int, QgsNumericSortTreeWidgetItem * > &  items,
int &  layerAndStyleCount,
const QMap< int, int > &  layerParents,
const QMap< int, QStringList > &  layerParentNames 
) [protected]

create an item including possible parents

Note:
not available in python bindings

Definition at line 317 of file qgsowssourceselect.cpp.

References QgsDebugMsg.

QString QgsOWSSourceSelect::descriptionForAuthId ( QString  authId) [protected]

Returns a textual description for the authority id.

Definition at line 586 of file qgsowssourceselect.cpp.

References QgsCoordinateReferenceSystem::createFromOgcWmsCrs(), QgsCoordinateReferenceSystem::description(), and mCrsNames.

Referenced by on_mChangeCRSButton_clicked(), and populateCRS().

void QgsOWSSourceSelect::enableLayersForCrs ( QTreeWidgetItem *  item) [protected, virtual]

Definition at line 384 of file qgsowssourceselect.cpp.

Referenced by on_mChangeCRSButton_clicked().

Add some default wms servers to the list.

Definition at line 581 of file qgsowssourceselect.cpp.

References addDefaultServers().

Connects to the database using the stored connection parameters. Once connected, available layers are displayed.

Definition at line 355 of file qgsowssourceselect.cpp.

References clearCRS(), clearFormats(), clearTimes(), mConnectionInfo, mConnName, mService, mUri, populateLayerList(), QgsDebugMsg, and QgsDataSourceURI::uri().

Stores the selected datasource whenerver it is changed.

Definition at line 575 of file qgsowssourceselect.cpp.

References mService, and QgsOWSConnection::setSelectedConnection().

Definition at line 108 of file qgsowssourceselect.h.

References QgsContextHelp::run().

Opens a dialog to edit an existing connection.

Definition at line 269 of file qgsowssourceselect.cpp.

References connectionsChanged(), mService, and populateConnectionList().

Definition at line 770 of file qgsowssourceselect.cpp.

Signaled when a layer selection is changed.

Definition at line 425 of file qgsowssourceselect.cpp.

Definition at line 751 of file qgsowssourceselect.cpp.

Opens the create connection dialog to build a new connection.

Definition at line 256 of file qgsowssourceselect.cpp.

References connectionsChanged(), mService, and populateConnectionList().

Saves connections to the file.

Definition at line 296 of file qgsowssourceselect.cpp.

References QgsManageConnectionsDialog::Export, and QgsManageConnectionsDialog::WCS.

void QgsOWSSourceSelect::on_mTilesetsTableWidget_itemClicked ( QTableWidgetItem *  item) [private, slot]

Definition at line 477 of file qgsowssourceselect.cpp.

References mCurrentTileset, QgsDebugMsg, and updateButtons().

Populate supported formats.

Definition at line 134 of file qgsowssourceselect.cpp.

References clearFormats(), mMimeLabelMap, mProviderFormats, providerFormats(), QgsDebugMsg, and selectedLayersFormats().

void QgsOWSSourceSelect::populateLayerList ( ) [protected, virtual]

Populate the layer list.

Return values:
falseif the layers could not be retrieved or parsed

Definition at line 351 of file qgsowssourceselect.cpp.

Referenced by on_mConnectButton_clicked().

void QgsOWSSourceSelect::populateTimes ( ) [protected]

Populate times.

Definition at line 220 of file qgsowssourceselect.cpp.

References QgsDebugMsg, and selectedLayersTimes().

List of image formats (encodings) supported by provider.

Returns:
list of format/label pairs

Definition at line 789 of file qgsowssourceselect.cpp.

Referenced by populateFormats().

QNetworkRequest::CacheLoadControl QgsOWSSourceSelect::selectedCacheLoadControl ( ) [protected]

Returns currently selected cache load control.

Definition at line 518 of file qgsowssourceselect.cpp.

QString QgsOWSSourceSelect::selectedCRS ( ) [protected]

Returns currently selected Crs.

Definition at line 524 of file qgsowssourceselect.cpp.

References mSelectedCRS.

QString QgsOWSSourceSelect::selectedFormat ( ) [protected]

Returns currently selected format.

Definition at line 513 of file qgsowssourceselect.cpp.

References selectedLayersFormats().

QStringList QgsOWSSourceSelect::selectedLayersCRSs ( ) [protected, virtual]

Server CRS supported for currently selected layer item(s)

Definition at line 799 of file qgsowssourceselect.cpp.

Referenced by populateCRS().

QStringList QgsOWSSourceSelect::selectedLayersFormats ( ) [protected, virtual]

List of formats supported for currently selected layer item(s)

Definition at line 794 of file qgsowssourceselect.cpp.

Referenced by populateFormats(), and selectedFormat().

QStringList QgsOWSSourceSelect::selectedLayersTimes ( ) [protected, virtual]

List of times (temporalDomain timePosition/timePeriod for currently selected layer item(s)

Definition at line 804 of file qgsowssourceselect.cpp.

Referenced by populateTimes().

QString QgsOWSSourceSelect::selectedTime ( ) [protected]

Returns currently selected time.

Definition at line 529 of file qgsowssourceselect.cpp.

Set the server connection combo box to that stored in the config file.

Definition at line 534 of file qgsowssourceselect.cpp.

References mService, QgsOWSConnection::selectedConnection(), and QgsOWSConnection::setSelectedConnection().

Referenced by on_mDeleteButton_clicked(), and populateConnectionList().

void QgsOWSSourceSelect::showError ( const QString &  theTitle,
const QString &  theFormat,
const QString &  theError 
) [slot]
void QgsOWSSourceSelect::showStatusMessage ( const QString &  theMessage) [slot]

Set status message to theMessage.

Definition at line 550 of file qgsowssourceselect.cpp.

Referenced by searchFinished().

void QgsOWSSourceSelect::updateButtons ( ) [private, virtual, slot]

Member Data Documentation

QPushButton* QgsOWSSourceSelect::mAddButton [protected]

Definition at line 199 of file qgsowssourceselect.h.

Referenced by QgsOWSSourceSelect().

Connection info for selected connection.

Definition at line 227 of file qgsowssourceselect.h.

Referenced by connectionInfo(), and on_mConnectButton_clicked().

QString QgsOWSSourceSelect::mConnName [protected]

Name for selected connection.

Definition at line 224 of file qgsowssourceselect.h.

Referenced by connName(), and on_mConnectButton_clicked().

QMap<QString, QString> QgsOWSSourceSelect::mCrsNames [protected]

Definition at line 201 of file qgsowssourceselect.h.

Referenced by descriptionForAuthId().

QList<QTreeWidgetItem*> QgsOWSSourceSelect::mCurrentSelection [protected]

Definition at line 220 of file qgsowssourceselect.h.

QTableWidgetItem* QgsOWSSourceSelect::mCurrentTileset [protected]

Definition at line 221 of file qgsowssourceselect.h.

Referenced by on_mTilesetsTableWidget_itemClicked().

Embedded mode, without 'Close'.

Definition at line 174 of file qgsowssourceselect.h.

Referenced by QgsOWSSourceSelect().

layer name derived from latest layer selection (updated as long it's not edited manually)

Definition at line 197 of file qgsowssourceselect.h.

Connections manager mode.

Definition at line 171 of file qgsowssourceselect.h.

Referenced by QgsOWSSourceSelect().

QMap<QString, QString> QgsOWSSourceSelect::mMimeLabelMap [private]

Map mime type labels to supported formats.

Definition at line 243 of file qgsowssourceselect.h.

Referenced by populateFormats().

Supported formats.

Definition at line 240 of file qgsowssourceselect.h.

Referenced by populateFormats().

QSet<QString> QgsOWSSourceSelect::mSelectedLayersCRSs [private]

Common CRSs for selected layers.

Definition at line 237 of file qgsowssourceselect.h.

Referenced by on_mChangeCRSButton_clicked(), and populateCRS().

URI for selected connection.

Definition at line 230 of file qgsowssourceselect.h.

Referenced by on_mConnectButton_clicked().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines