51
50
QgsWMSSourceSelect( QWidget *parent = 0, Qt::WFlags fl = QgisGui::ModalDialogFlags );
53
52
~QgsWMSSourceSelect();
54
//! Populate the connection list combo box
55
void populateConnectionList();
60
//! Connection info (uri)
61
QString connectionInfo();
63
//! Connection Proxy Host
64
QString connProxyHost();
66
//! Connection Proxy Port
69
//! Connection Proxy User
70
QString connProxyUser();
72
//! Connection Proxy Pass
73
QString connProxyPass();
75
//! String list containing the selected layers
76
QStringList selectedLayers();
78
//! String list containing the visual styles selected for the selected layers - this corresponds with the output from selectedLayers()
79
QStringList selectedStylesForSelectedLayers();
81
//! String containing the MIME type of the preferred image encoding
82
QString selectedImageEncoding();
84
//! String containing the selected WMS-format CRS
85
QString selectedCrs();
87
//! Stores which server is now selected.
90
//! Set the server connection combo box to that stored in the config file.
91
void setConnectionListPosition();
129
95
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
98
//! Populate the connection list combo box
99
void populateConnectionList();
104
//! Connection info (uri)
105
QString connectionInfo();
107
//! Connection Proxy Host
108
QString connProxyHost();
110
//! Connection Proxy Port
113
//! Connection Proxy User
114
QString connProxyUser();
116
//! Connection Proxy Pass
117
QString connProxyPass();
119
//! Set the server connection combo box to that stored in the config file.
120
void setConnectionListPosition();
133
122
//! Add a few example servers to the list.
134
123
void addDefaultServers();
128
//! Common CRSs for selected layers
131
//! Supported formats
132
QStringList mFormats;
134
//! Labels for supported formats
137
//! Map mime types to supported formats
138
QMap<QString, int> mMimeMap;
137
141
* \brief Populate the layer list - private for now.
139
* \retval FALSE if the layers could not be retrieved or parsed -
143
* \retval false if the layers could not be retrieved or parsed -
140
144
* see mWmsProvider->errorString() for more info
142
bool populateLayerList( QgsWmsProvider* wmsProvider );
144
//! Populate the image encoding button group - private for now.
145
void populateImageEncodingGroup( QgsWmsProvider* wmsProvider );
146
bool populateLayerList( QgsWmsProvider *wmsProvider );
147
148
//! create an item including possible parents
148
QgsNumericSortTreeWidgetItem *createItem( int id, const QStringList &names, QMap<int, QgsNumericSortTreeWidgetItem *> &items, int &layerAndStyleCount, const QMap<int, int> &layerParents, const QMap<int, QStringList> &layerParentNames );
149
QgsNumericSortTreeWidgetItem *createItem( int id,
150
const QStringList &names,
151
QMap<int, QgsNumericSortTreeWidgetItem *> &items,
152
int &layerAndStyleCount,
153
const QMap<int, int> &layerParents,
154
const QMap<int, QStringList> &layerParentNames );
150
//! Returns a textual description for the EpsgCrsId number
151
QString descriptionForEpsg( long epsg );
156
//! Returns a textual description for the authority id
157
QString descriptionForAuthId( QString authId );
153
159
//! Keeps the layer order list up-to-date with changed layers and styles
154
160
void updateLayerOrderTab( const QStringList& newLayerList, const QStringList& newStyleList );
156
162
//! Name for selected connection
159
165
//! URI for selected connection
160
QString m_connectionInfo;
162
//! Proxy Host for selected connection
163
QString m_connProxyHost;
165
//! Proxy Port for selected connection
168
//! Proxy User for selected connection
169
QString m_connProxyUser;
171
//! Proxy Pass for selected connection
172
QString m_connProxyPass;
174
//QStringList m_selectedLayers;
175
//QStringList m_selectedStylesForSelectedLayers;
178
QMap<QString, QString> m_selectedStyleIdForLayer;
180
//! The mime type, the text to use in the button and a unique number
181
QMap<QString, QPair<QString, int> > m_PotentialFormats;
166
QString mConnectionInfo;
168
//! layer name derived from latest layer selection (updated as long it's not edited manually)
169
QString mLastLayerName;
183
171
//! The widget that controls the image format radio buttons
184
QButtonGroup* m_imageFormatGroup;
185
QHBoxLayout* m_imageFormatLayout;
187
QPushButton * mAddButton;
189
//! The WMS provider that retrieves information for this dialog
190
QgsWmsProvider * mWmsProvider;
193
bool retrieveSearchResults( const QString& searchTerm, QByteArray& httpResponse );
172
QButtonGroup *mImageFormatGroup;
174
QPushButton *mAddButton;
176
QMap<QString, QString> mCrsNames;
194
178
void addWMSListRow( const QDomElement& item, int row );
195
179
void addWMSListItem( const QDomElement& el, int row, int column );
181
void applySelectionConstraints( QTreeWidgetItem *item );
182
void collectNamedLayers( QTreeWidgetItem *item, QStringList &layers, QStringList &styles );
183
void enableLayersForCrs( QTreeWidgetItem *item );
185
void collectSelectedLayers( QStringList &layers, QStringList &styles );
186
QString selectedImageEncoding();
188
QList<QTreeWidgetItem*> mCurrentSelection;
189
QTableWidgetItem* mCurrentTileset;
198
192
void on_btnSearch_clicked();
199
193
void on_btnAddWMS_clicked();
200
void wmsSelectionChanged();
194
void on_tableWidgetWMSList_itemSelectionChanged();
195
void on_lstTilesets_itemClicked( QTableWidgetItem *item );
201
196
void on_mLayerUpButton_clicked();
202
197
void on_mLayerDownButton_clicked();
198
void updateButtons();