-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4969 from boundlessgeo/unified-layer-dialog-raste…
…r-mods Unified layer dialog raster mods
- Loading branch information
Showing
19 changed files
with
834 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/*************************************************************************** | ||
qgsgdalsourceselect.h | ||
------------------- | ||
begin : August 05 2017 | ||
copyright : (C) 2017 by Alessandro Pasotti | ||
email : apasotti at boundlessgeo dot com | ||
***************************************************************************/ | ||
|
||
/*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
#include "qgsgdalsourceselect.h" | ||
#include "qgsproviderregistry.h" | ||
|
||
QgsGdalSourceSelect::QgsGdalSourceSelect( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode widgetMode ): | ||
QgsAbstractDataSourceWidget( parent, fl, widgetMode ) | ||
{ | ||
setupUi( this ); | ||
setupButtons( buttonBox ); | ||
mQgsFileWidget->setFilter( QgsProviderRegistry::instance()->fileRasterFilters() ); | ||
connect( mQgsFileWidget, &QgsFileWidget::fileChanged, this, [ = ]( const QString & path ) | ||
{ | ||
mRasterPath = path; | ||
emit enableButtons( ! mRasterPath.isEmpty() ); | ||
} ); | ||
} | ||
|
||
QgsGdalSourceSelect::~QgsGdalSourceSelect() | ||
{ | ||
|
||
} | ||
|
||
void QgsGdalSourceSelect::addButtonClicked() | ||
{ | ||
QFileInfo baseName( mRasterPath ); | ||
emit addRasterLayer( mRasterPath, baseName.baseName(), QStringLiteral( "gdal" ) ); | ||
} | ||
|
||
QGISEXTERN QgsGdalSourceSelect *selectWidget( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode widgetMode ) | ||
{ | ||
return new QgsGdalSourceSelect( parent, fl, widgetMode ); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/*************************************************************************** | ||
qgsgdalsourceselect.h | ||
------------------- | ||
begin : August 05 2017 | ||
copyright : (C) 2017 by Alessandro Pasotti | ||
email : apasotti at boundlessgeo dot com | ||
***************************************************************************/ | ||
|
||
/*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
#ifndef QGGDALSOURCESELECT_H | ||
#define QGGDALSOURCESELECT_H | ||
|
||
#include "ui_qgsgdalsourceselectbase.h" | ||
#include "qgsabstractdatasourcewidget.h" | ||
|
||
|
||
/** \class QgsGdalSourceSelect | ||
* \brief Dialog to select GDAL supported rasters | ||
*/ | ||
class QgsGdalSourceSelect : public QgsAbstractDataSourceWidget, private Ui::QgsGdalSourceSelectBase | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
//! Constructor | ||
QgsGdalSourceSelect( QWidget *parent = nullptr, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags, QgsProviderRegistry::WidgetMode widgetMode = QgsProviderRegistry::WidgetMode::None ); | ||
|
||
~QgsGdalSourceSelect(); | ||
|
||
public slots: | ||
//! Determines the tables the user selected and closes the dialog | ||
void addButtonClicked() override; | ||
|
||
private: | ||
|
||
QString mRasterPath; | ||
|
||
}; | ||
|
||
#endif // QGGDALSOURCESELECT_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.