QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
Loading...
Searching...
No Matches
qgsdatasourcemanagerdialog.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsdatasourcemanagerdialog.h - datasource manager dialog
3
4 ---------------------
5 begin : May 19, 2017
6 copyright : (C) 2017 by Alessandro Pasotti
7 email : apasotti at itopen dot it
8 ***************************************************************************
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 ***************************************************************************/
16
17#ifndef QGSDATASOURCEMANAGERDIALOG_H
18#define QGSDATASOURCEMANAGERDIALOG_H
19
20#include <QList>
21#include <QDialog>
22#include "ui_qgsdatasourcemanagerdialog.h"
24#include "qgsguiutils.h"
25#include "qgsmimedatautils.h"
26#include "qgshelp.h"
27#include "qgis_gui.h"
28
29#define SIP_NO_FILE
30
32class QgsRasterLayer;
33class QgsMapCanvas;
37class QgsMessageBar;
38
47class GUI_EXPORT QgsDataSourceManagerDialog : public QgsOptionsDialogBase, private Ui::QgsDataSourceManagerDialog
48{
49 Q_OBJECT
50
51 public:
52
60 explicit QgsDataSourceManagerDialog( QgsBrowserGuiModel *browserModel, QWidget *parent = nullptr, QgsMapCanvas *canvas = nullptr, Qt::WindowFlags fl = Qt::Window );
62
68 void openPage( const QString &pageName );
69
71 QgsMessageBar *messageBar() const;
72
73 public slots:
74
80 void activate();
81
83 void setCurrentPage( int index );
84
85 // TODO: use this with an internal source select dialog instead of forwarding the whole raster selection to app
86
91 void rasterLayersAdded( const QStringList &layersList );
92
94 void vectorLayersAdded( const QStringList &layerQStringList, const QString &enc, const QString &dataSourceType );
96 void setPreviousPage();
98 void refresh();
99
107 void reset();
108
109
114 void configureFromUri( const QString &pageName, const QString &uri );
115
116
117 protected:
118 void showEvent( QShowEvent *event ) override;
119
120 signals:
121
129 void addLayer( Qgis::LayerType type, const QString &url, const QString &baseName, const QString &providerKey );
130
135 void addRasterLayers( const QStringList &layersList );
136
138 void replaceSelectedVectorLayer( const QString &oldId, const QString &uri, const QString &layerName, const QString &provider );
140 void addVectorLayers( const QStringList &layerQStringList, const QString &enc, const QString &dataSourceType );
141
143 void showStatusMessage( const QString &message );
145 void addDatabaseLayers( const QStringList &layerPathList, const QString &providerKey );
147 void openFile( const QString &fileName, const QString &fileTypeHint = QString() );
152
159
165
166 private:
167 void addProviderDialog( QgsAbstractDataSourceWidget *dlg, const QString &providerKey, const QString &providerName, const QString &text, const QIcon &icon, const QString &toolTip = QString() );
168 void removeProviderDialog( const QString &providerName );
169 void makeConnections( QgsAbstractDataSourceWidget *dlg, const QString &providerKey );
170 Ui::QgsDataSourceManagerDialog *ui = nullptr;
171 QgsBrowserDockWidget *mBrowserWidget = nullptr;
172 QgsLayerMetadataSearchWidget *mLayerMetadataSearchWidget = nullptr;
173 int mPreviousRow;
174 QStringList mPageProviderKeys;
175 QStringList mPageProviderNames;
176 // Map canvas
177 QgsMapCanvas *mMapCanvas = nullptr;
178 QgsMessageBar *mMessageBar = nullptr;
179 QgsBrowserGuiModel *mBrowserModel = nullptr;
180
181};
182
183#endif // QGSDATASOURCEMANAGERDIALOG_H
LayerType
Types of layers that can be added to a map.
Definition qgis.h:169
Abstract base Data Source Widget to create connections and add layers This class provides common func...
A dock widget containing a QgsBrowserWidget for navigating and managing data sources.
A model for showing available data sources and other items in a structured tree.
The QgsDataSourceManagerDialog class embeds the browser panel and all the provider dialogs.
void addVectorLayers(const QStringList &layerQStringList, const QString &enc, const QString &dataSourceType)
Emitted when a one or more layer were selected for addition: for signal forwarding to QgisApp.
void openFile(const QString &fileName, const QString &fileTypeHint=QString())
Emitted when a file needs to be opened.
void showStatusMessage(const QString &message)
Emitted when a status message needs to be shown: for signal forwarding to QgisApp.
void replaceSelectedVectorLayer(const QString &oldId, const QString &uri, const QString &layerName, const QString &provider)
Replace the selected layer by a vector layer defined by uri, layer name, data source uri.
void connectionsChanged()
Emitted when a connection has changed inside the provider dialogs This signal is normally forwarded t...
void addDatabaseLayers(const QStringList &layerPathList, const QString &providerKey)
Emitted when a DB layer was selected for addition: for signal forwarding to QgisApp.
void handleDropUriList(const QgsMimeDataUtils::UriList &)
Emitted when drop uri list needs to be handled from the browser.
void providerDialogsRefreshRequested()
One or more provider connections have changed and the dialogs should be refreshed.
void addLayer(Qgis::LayerType type, const QString &url, const QString &baseName, const QString &providerKey)
Emitted when a layer has been selected for addition.
void updateProjectHome()
Update project home directory.
void addRasterLayers(const QStringList &layersList)
Emitted when a one or more layer were selected for addition: for signal forwarding to QgisApp.
The QgsLayerMetadataSearchWidget class offers layer metadata search and filtering.
Map canvas is a class for displaying all GIS data types on a canvas.
A bar for displaying non-blocking messages to the user.
QList< QgsMimeDataUtils::Uri > UriList
A base dialog for options and properties dialogs that offers vertical tabs.
void showEvent(QShowEvent *e) override
void setCurrentPage(const QString &page)
Sets the dialog page (by object name) to show.
Represents a raster layer.