Skip to content

Commit 0557c70

Browse files
elpasonyalldawson
authored andcommittedFeb 6, 2019
Merge pull request #8985 from elpaso/bugfix-21091-ogr-protocol-download
OGR: add a download option to the protocol data source [needs-docs] Cherry-picked from master 1f8708f
1 parent 110c0ac commit 0557c70

File tree

4 files changed

+309
-189
lines changed

4 files changed

+309
-189
lines changed
 

‎src/app/qgisapp.cpp

Lines changed: 291 additions & 187 deletions
Large diffs are not rendered by default.

‎src/app/qgisapp.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1957,6 +1957,9 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
19571957
//! Create the option dialog
19581958
QgsOptions *createOptionsDialog( QWidget *parent = nullptr );
19591959

1960+
//! Returns the message bar of the datasource manager dialog if it is visible, the canvas's message bar otherwise.
1961+
QgsMessageBar *visibleMessageBar();
1962+
19601963
QgisAppStyleSheet *mStyleSheetBuilder = nullptr;
19611964

19621965
// actions for menus and toolbars -----------------

‎src/gui/qgsdatasourcemanagerdialog.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "qgsabstractdatasourcewidget.h"
2727
#include "qgsmapcanvas.h"
2828
#include "qgsmessagelog.h"
29+
#include "qgsmessagebar.h"
2930
#include "qgsgui.h"
3031

3132
QgsDataSourceManagerDialog::QgsDataSourceManagerDialog( QgsBrowserModel *browserModel, QWidget *parent, QgsMapCanvas *canvas, Qt::WindowFlags fl )
@@ -34,12 +35,15 @@ QgsDataSourceManagerDialog::QgsDataSourceManagerDialog( QgsBrowserModel *browser
3435
, mPreviousRow( -1 )
3536
, mMapCanvas( canvas )
3637
{
37-
3838
ui->setupUi( this );
3939
ui->verticalLayout_2->setSpacing( 6 );
4040
ui->verticalLayout_2->setMargin( 0 );
4141
ui->verticalLayout_2->setContentsMargins( 0, 0, 0, 0 );
4242

43+
mMessageBar = new QgsMessageBar( this );
44+
mMessageBar->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Fixed );
45+
static_cast<QVBoxLayout *>( layout() )->insertWidget( 0, mMessageBar );
46+
4347
// QgsOptionsDialogBase handles saving/restoring of geometry, splitter and current tab states,
4448
// switching vertical tabs between icon/text to icon-only modes (splitter collapsed to left),
4549
// and connecting QDialogButtonBox's accepted/rejected signals to dialog's accept/reject slots
@@ -89,6 +93,11 @@ void QgsDataSourceManagerDialog::openPage( const QString &pageName )
8993
}
9094
}
9195

96+
QgsMessageBar *QgsDataSourceManagerDialog::messageBar() const
97+
{
98+
return mMessageBar;
99+
}
100+
92101
void QgsDataSourceManagerDialog::setCurrentPage( int index )
93102
{
94103
mPreviousRow = ui->mOptionsStackedWidget->currentIndex();

‎src/gui/qgsdatasourcemanagerdialog.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class QgsRasterLayer;
3333
class QgsMapCanvas;
3434
class QgsAbstractDataSourceWidget;
3535
class QgsBrowserModel;
36+
class QgsMessageBar;
3637

3738
/**
3839
* \ingroup gui
@@ -66,6 +67,9 @@ class GUI_EXPORT QgsDataSourceManagerDialog : public QgsOptionsDialogBase, priva
6667
*/
6768
void openPage( const QString &pageName );
6869

70+
//! Returns the dialog's message bar
71+
QgsMessageBar *messageBar() const;
72+
6973
public slots:
7074

7175
//! Sync current page with the leftbar list
@@ -139,7 +143,7 @@ class GUI_EXPORT QgsDataSourceManagerDialog : public QgsOptionsDialogBase, priva
139143
QStringList mPageNames;
140144
// Map canvas
141145
QgsMapCanvas *mMapCanvas = nullptr;
142-
146+
QgsMessageBar *mMessageBar = nullptr;
143147

144148
};
145149

0 commit comments

Comments
 (0)
Please sign in to comment.