QGIS API Documentation  2.6.0-Brighton
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Public Slots | Signals | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
QgsOWSSourceSelect Class Reference

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

#include <qgsowssourceselect.h>

Classes

struct  SupportedFormat
 Formats supported by provider. More...

Public Slots

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

Signals

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

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

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

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.

Constructor & Destructor Documentation

QgsOWSSourceSelect::QgsOWSSourceSelect ( QString  service,
QWidget *  parent = 0,
Qt::WindowFlags  fl = QgisGui::ModalDialogFlags,
bool  managerMode = false,
bool  embeddedMode = false 
)

Constructor.

QgsOWSSourceSelect::~QgsOWSSourceSelect ( )

Destructor.

Member Function Documentation

void QgsOWSSourceSelect::addClicked ( )
virtualslot

Determines the layers the user selected.

void QgsOWSSourceSelect::addDefaultServers ( )
protected

Add a few example servers to the list.

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

Clear CRSs.

void QgsOWSSourceSelect::clearFormats ( )
protected

Clear previously set formats.

void QgsOWSSourceSelect::clearTimes ( )
protected

Clear times.

QString QgsOWSSourceSelect::connectionInfo ( )
protected

Connection info (uri)

void QgsOWSSourceSelect::connectionsChanged ( )
signal
QString QgsOWSSourceSelect::connName ( )
protected

Connection name.

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
QString QgsOWSSourceSelect::descriptionForAuthId ( QString  authId)
protected

Returns a textual description for the authority id.

void QgsOWSSourceSelect::enableLayersForCrs ( QTreeWidgetItem *  item)
protectedvirtual
void QgsOWSSourceSelect::on_mAddDefaultButton_clicked ( )
slot

Add some default wms servers to the list.

void QgsOWSSourceSelect::on_mChangeCRSButton_clicked ( )
slot

Opens the Spatial Reference System dialog.

void QgsOWSSourceSelect::on_mConnectButton_clicked ( )
slot

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

void QgsOWSSourceSelect::on_mConnectionsComboBox_activated ( int  )
slot

Stores the selected datasource whenerver it is changed.

void QgsOWSSourceSelect::on_mDeleteButton_clicked ( )
slot

Deletes the selected connection.

void QgsOWSSourceSelect::on_mDialogButtonBox_helpRequested ( )
inlineslot
void QgsOWSSourceSelect::on_mEditButton_clicked ( )
slot

Opens a dialog to edit an existing connection.

void QgsOWSSourceSelect::on_mLayersTreeWidget_itemSelectionChanged ( )
virtualslot

Signaled when a layer selection is changed.

void QgsOWSSourceSelect::on_mLoadButton_clicked ( )
slot

Loads connections from the file.

void QgsOWSSourceSelect::on_mNewButton_clicked ( )
slot

Opens the create connection dialog to build a new connection.

void QgsOWSSourceSelect::on_mSaveButton_clicked ( )
slot

Saves connections to the file.

void QgsOWSSourceSelect::populateConnectionList ( )
protected

Populate the connection list combo box.

void QgsOWSSourceSelect::populateCRS ( )
protected

Set supported CRSs.

void QgsOWSSourceSelect::populateFormats ( )
protected

Populate supported formats.

void QgsOWSSourceSelect::populateLayerList ( )
protectedvirtual

Populate the layer list.

Return values
falseif the layers could not be retrieved or parsed
void QgsOWSSourceSelect::populateTimes ( )
protected

Populate times.

QList< QgsOWSSourceSelect::SupportedFormat > QgsOWSSourceSelect::providerFormats ( )
protectedvirtual

List of image formats (encodings) supported by provider.

Returns
list of format/label pairs
void QgsOWSSourceSelect::searchFinished ( )
slot
QNetworkRequest::CacheLoadControl QgsOWSSourceSelect::selectedCacheLoadControl ( )
protected

Returns currently selected cache load control.

QString QgsOWSSourceSelect::selectedCRS ( )
protected

Returns currently selected Crs.

QString QgsOWSSourceSelect::selectedFormat ( )
protected

Returns currently selected format.

QStringList QgsOWSSourceSelect::selectedLayersCRSs ( )
protectedvirtual

Server CRS supported for currently selected layer item(s)

QStringList QgsOWSSourceSelect::selectedLayersFormats ( )
protectedvirtual

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

QStringList QgsOWSSourceSelect::selectedLayersTimes ( )
protectedvirtual

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

QString QgsOWSSourceSelect::selectedTime ( )
protected

Returns currently selected time.

void QgsOWSSourceSelect::setConnectionListPosition ( )
protected

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

void QgsOWSSourceSelect::showError ( const QString &  theTitle,
const QString &  theFormat,
const QString &  theError 
)
slot

show whatever error is exposed.

void QgsOWSSourceSelect::showStatusMessage ( const QString &  theMessage)
slot

Set status message to theMessage.

Member Data Documentation

QPushButton* QgsOWSSourceSelect::mAddButton
protected
QString QgsOWSSourceSelect::mConnectionInfo
protected

Connection info for selected connection.

QString QgsOWSSourceSelect::mConnName
protected

Name for selected connection.

QMap<QString, QString> QgsOWSSourceSelect::mCrsNames
protected
QList<QTreeWidgetItem*> QgsOWSSourceSelect::mCurrentSelection
protected
QTableWidgetItem* QgsOWSSourceSelect::mCurrentTileset
protected
bool QgsOWSSourceSelect::mEmbeddedMode
protected

Embedded mode, without 'Close'.

QString QgsOWSSourceSelect::mLastLayerName
protected

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

bool QgsOWSSourceSelect::mManagerMode
protected

Connections manager mode.

QString QgsOWSSourceSelect::mService
protected

Service name.

QgsDataSourceURI QgsOWSSourceSelect::mUri
protected

URI for selected connection.


The documentation for this class was generated from the following files: