Skip to content

Commit f66c19b

Browse files
authoredJul 12, 2017
Merge pull request #4769 from boundlessgeo/unified-button-movetogui-2
Move all app/ogr and datasource manager dialog to GUI
2 parents 6067d51 + b6e2579 commit f66c19b

12 files changed

+53
-19
lines changed
 

‎src/app/CMakeLists.txt‎

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ SET(QGIS_APP_SRCS
6161
qgsversioninfo.cpp
6262
qgswelcomepageitemsmodel.cpp
6363
qgswelcomepage.cpp
64-
qgsdatasourcemanagerdialog.cpp
6564

6665
qgsmaptooladdfeature.cpp
6766
qgsmaptooladdpart.cpp
@@ -161,11 +160,6 @@ SET(QGIS_APP_SRCS
161160
locator/qgsinbuiltlocatorfilters.cpp
162161
locator/qgslocatoroptionswidget.cpp
163162

164-
ogr/qgsogrhelperfunctions.cpp
165-
ogr/qgsopenvectorlayerdialog.cpp
166-
ogr/qgsnewogrconnection.cpp
167-
ogr/qgsvectorlayersaveasdialog.cpp
168-
169163
gps/qgsgpsinformationwidget.cpp
170164
gps/qgsgpsmarker.cpp
171165

@@ -250,7 +244,6 @@ SET (QGIS_APP_MOC_HDRS
250244
qgsversioninfo.h
251245
qgswelcomepageitemsmodel.h
252246
qgswelcomepage.h
253-
qgsdatasourcemanagerdialog.h
254247

255248
qgsmaptooladdfeature.h
256249
qgsmaptoolannotation.h
@@ -344,10 +337,6 @@ SET (QGIS_APP_MOC_HDRS
344337
locator/qgsinbuiltlocatorfilters.h
345338
locator/qgslocatoroptionswidget.h
346339

347-
ogr/qgsopenvectorlayerdialog.h
348-
ogr/qgsnewogrconnection.h
349-
ogr/qgsvectorlayersaveasdialog.h
350-
351340
gps/qgsgpsinformationwidget.h
352341

353342
openstreetmap/qgsosmdownloaddialog.h
@@ -515,6 +504,7 @@ INCLUDE_DIRECTORIES(
515504
${CMAKE_SOURCE_DIR}/src/gui/symbology-ng
516505
${CMAKE_SOURCE_DIR}/src/gui/attributetable
517506
${CMAKE_SOURCE_DIR}/src/gui/auth
507+
${CMAKE_SOURCE_DIR}/src/gui/ogr
518508
${CMAKE_SOURCE_DIR}/src/gui/raster
519509
${CMAKE_SOURCE_DIR}/src/gui/editorwidgets
520510
${CMAKE_SOURCE_DIR}/src/gui/editorwidgets/core
@@ -560,6 +550,7 @@ INCLUDE_DIRECTORIES(
560550
../gui/symbology-ng
561551
../gui/attributetable
562552
../gui/auth
553+
../gui/ogr
563554
../gui/raster
564555
../gui/editorwidgets
565556
../gui/editorwidgets/core
@@ -568,7 +559,6 @@ INCLUDE_DIRECTORIES(
568559
../plugins
569560
../python
570561
gps
571-
ogr
572562
openstreetmap
573563
dwg
574564
dwg/libdxfrw

‎src/gui/CMakeLists.txt‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,12 @@ SET(QGIS_GUI_SRCS
162162
locator/qgslocatorfilter.cpp
163163
locator/qgslocatorwidget.cpp
164164

165+
ogr/qgsopenvectorlayerdialog.cpp
166+
ogr/qgsogrhelperfunctions.cpp
167+
ogr/qgsnewogrconnection.cpp
168+
ogr/qgsopenvectorlayerdialog.cpp
169+
ogr/qgsvectorlayersaveasdialog.cpp
170+
165171
qgisinterface.cpp
166172
qgsactionmenu.cpp
167173
qgsadvanceddigitizingcanvasitem.cpp
@@ -325,6 +331,7 @@ SET(QGIS_GUI_SRCS
325331
qgsvariableeditorwidget.cpp
326332
qgsvertexmarker.cpp
327333
qgsfiledownloader.cpp
334+
qgsdatasourcemanagerdialog.cpp
328335
)
329336

330337
SET(QGIS_GUI_MOC_HDRS
@@ -476,6 +483,11 @@ SET(QGIS_GUI_MOC_HDRS
476483
qgsuserinputdockwidget.h
477484
qgsvariableeditorwidget.h
478485
qgsfiledownloader.h
486+
qgsdatasourcemanagerdialog.h
487+
488+
ogr/qgsopenvectorlayerdialog.h
489+
ogr/qgsnewogrconnection.h
490+
ogr/qgsvectorlayersaveasdialog.h
479491

480492
raster/qgsmultibandcolorrendererwidget.h
481493
raster/qgspalettedrendererwidget.h
@@ -666,6 +678,13 @@ SET(QGIS_GUI_HDRS
666678
qgsbrowserdockwidget_p.h
667679
qgsvertexmarker.h
668680
qgsfiledownloader.h
681+
qgsdatasourcemanagerdialog.h
682+
683+
ogr/qgsopenvectorlayerdialog.h
684+
ogr/qgsogrhelperfunctions.h
685+
ogr/qgsnewogrconnection.h
686+
ogr/qgsvectorlayersaveasdialog.h
687+
669688

670689
attributetable/qgsfeaturemodel.h
671690

@@ -756,6 +775,7 @@ SET(QGIS_GUI_UI_HDRS
756775
${CMAKE_CURRENT_BINARY_DIR}/../ui/ui_qgssqlcomposerdialogbase.h
757776
${CMAKE_CURRENT_BINARY_DIR}/../ui/ui_qgssublayersdialogbase.h
758777
${CMAKE_CURRENT_BINARY_DIR}/../ui/ui_qgstablewidgetuibase.h
778+
${CMAKE_CURRENT_BINARY_DIR}/../ui/ui_qgsopenvectorlayerdialogbase.h
759779
)
760780

761781
IF(ENABLE_MODELTEST)
@@ -775,6 +795,7 @@ INCLUDE_DIRECTORIES(
775795
${CMAKE_SOURCE_DIR}/src/gui/layertree
776796
${CMAKE_SOURCE_DIR}/src/gui/layout
777797
${CMAKE_SOURCE_DIR}/src/gui/effects
798+
${CMAKE_SOURCE_DIR}/src/gui/ogr
778799
${CMAKE_SOURCE_DIR}/src/core
779800
${CMAKE_SOURCE_DIR}/src/core/annotations
780801
${CMAKE_SOURCE_DIR}/src/core/auth
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

‎src/app/ogr/qgsopenvectorlayerdialog.cpp‎ renamed to ‎src/gui/ogr/qgsopenvectorlayerdialog.cpp‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,5 +489,3 @@ void QgsOpenVectorLayerDialog::on_cmbConnections_currentIndexChanged( const QStr
489489
setSelectedConnection();
490490
}
491491
//********************end auto connected slots *****************/
492-
493-
File renamed without changes.
File renamed without changes.

‎src/app/ogr/qgsvectorlayersaveasdialog.h‎ renamed to ‎src/gui/ogr/qgsvectorlayersaveasdialog.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323
#include "qgshelp.h"
2424
#include "qgsfields.h"
2525
#include "qgsvectorfilewriter.h"
26-
#include "qgis_app.h"
26+
#include "qgis_gui.h"
2727

2828
class QgsVectorLayer;
2929

3030
/**
3131
* Class to select destination file, type and CRS for ogr layers
3232
*/
33-
class APP_EXPORT QgsVectorLayerSaveAsDialog : public QDialog, private Ui::QgsVectorLayerSaveAsDialogBase
33+
class GUI_EXPORT QgsVectorLayerSaveAsDialog : public QDialog, private Ui::QgsVectorLayerSaveAsDialogBase
3434
{
3535
Q_OBJECT
3636

File renamed without changes.

‎src/app/qgsdatasourcemanagerdialog.h‎ renamed to ‎src/gui/qgsdatasourcemanagerdialog.h‎

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "qgsguiutils.h"
2424
#include "qgsmimedatautils.h"
2525
#include "qgshelp.h"
26+
#include "qgis_gui.h"
2627

2728
class QgsBrowserDockWidget;
2829
class QgsRasterLayer;
@@ -33,11 +34,25 @@ namespace Ui
3334
class QgsDataSourceManagerDialog;
3435
}
3536

36-
class QgsDataSourceManagerDialog : public QgsOptionsDialogBase
37+
/** \ingroup gui
38+
* The QgsDataSourceManagerDialog class embeds the browser panel and all
39+
* the provider dialogs.
40+
* The dialog does not handle layer addition directly but emits signals that
41+
* need to be forwarded to the QGIS application to be handled.
42+
* \since QGIS 3.0
43+
* @note not available in Python bindings
44+
*/
45+
class GUI_EXPORT QgsDataSourceManagerDialog : public QgsOptionsDialogBase
3746
{
3847
Q_OBJECT
3948

4049
public:
50+
51+
/** QgsDataSourceManagerDialog constructor
52+
* @param mapCanvas the map canvas
53+
* @param parent the object
54+
* @param fl window flags
55+
*/
4156
explicit QgsDataSourceManagerDialog( QgsMapCanvas *mapCanvas, QWidget *parent = nullptr, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );
4257
~QgsDataSourceManagerDialog();
4358

@@ -53,25 +68,35 @@ class QgsDataSourceManagerDialog : public QgsOptionsDialogBase
5368
//! Sync current page with the leftbar list
5469
void setCurrentPage( int index );
5570

56-
//! For signal forwarding to QgisApp
71+
//! A raster layer was added: for signal forwarding to QgisApp
5772
void rasterLayerAdded( QString const &uri, QString const &baseName, QString const &providerKey );
73+
//! A vector layer was added: for signal forwarding to QgisApp
5874
void vectorLayerAdded( const QString &vectorLayerPath, const QString &baseName, const QString &providerKey );
75+
//! One or more vector layer were added: for signal forwarding to QgisApp
5976
void vectorLayersAdded( const QStringList &layerQStringList, const QString &enc, const QString &dataSourceType );
6077
//! Reset current page to previously selected page
6178
void setPreviousPage();
6279

6380
signals:
64-
//! For signal forwarding to QgisApp
81+
//! Emitted when a raster layer was selected for addition: for signal forwarding to QgisApp
6582
void addRasterLayer( QString const &uri, QString const &baseName, QString const &providerKey );
83+
//! Emitted when the user wants to select a raster layer: for signal forwarding to QgisApp
6684
void addRasterLayer( );
85+
//! Emitted when a vector layer was selected for addition: for signal forwarding to QgisApp
6786
void addVectorLayer( const QString &vectorLayerPath, const QString &baseName, const QString &providerKey );
6887
//! Replace the selected layer by a vector layer defined by uri, layer name, data source uri
6988
void replaceSelectedVectorLayer( const QString &oldId, const QString &uri, const QString &layerName, const QString &provider );
89+
//! Emitted when a WFS layer was selected for addition: for signal forwarding to QgisApp
7090
void addWfsLayer( const QString &uri, const QString &typeName );
91+
//! Emitted when a AFS layer was selected for addition: for signal forwarding to QgisApp
7192
void addAfsLayer( const QString &uri, const QString &typeName );
93+
//! Emitted when a one or more layer were selected for addition: for signal forwarding to QgisApp
7294
void addVectorLayers( const QStringList &layerQStringList, const QString &enc, const QString &dataSourceType );
95+
//! Emitted when the dialog is busy: for signal forwarding to QgisApp
7396
void showProgress( int progress, int totalSteps );
97+
//! Emitted when a status message needs to be shown: for signal forwarding to QgisApp
7498
void showStatusMessage( const QString &message );
99+
//! Emitted when a DB layer was selected for addition: for signal forwarding to QgisApp
75100
void addDatabaseLayers( QStringList const &layerPathList, QString const &providerKey );
76101
//! Emitted when a file needs to be opened
77102
void openFile( const QString & );

0 commit comments

Comments
 (0)
Please sign in to comment.