-
-
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.
[mesh] option to add mesh layer from data source manager dialog
- Loading branch information
1 parent
bf56bd3
commit 4f70173
Showing
13 changed files
with
448 additions
and
0 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,59 @@ | ||
/*************************************************************************** | ||
qgsmdalsourceselect.cpp | ||
----------------------- | ||
begin : July 2018 | ||
copyright : (C) 2018 by Peter Petrik | ||
email : zilolv at gmail 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 <QMessageBox> | ||
|
||
#include "qgsmdalsourceselect.h" | ||
#include "qgsproviderregistry.h" | ||
#include "ogr/qgsogrhelperfunctions.h" | ||
|
||
QgsMdalSourceSelect::QgsMdalSourceSelect( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode widgetMode ): | ||
QgsAbstractDataSourceWidget( parent, fl, widgetMode ) | ||
{ | ||
setupUi( this ); | ||
setupButtons( buttonBox ); | ||
|
||
mFileWidget->setDialogTitle( tr( "Open MDAL Supported Mesh Dataset(s)" ) ); | ||
mFileWidget->setFilter( QStringLiteral( "Mesh File (*.2dm);;All files (*.*)" ) ); | ||
mFileWidget->setStorageMode( QgsFileWidget::GetMultipleFiles ); | ||
connect( mFileWidget, &QgsFileWidget::fileChanged, this, [ = ]( const QString & path ) | ||
{ | ||
mMeshPath = path; | ||
emit enableButtons( ! mMeshPath.isEmpty() ); | ||
} ); | ||
} | ||
|
||
void QgsMdalSourceSelect::addButtonClicked() | ||
{ | ||
if ( mMeshPath.isEmpty() ) | ||
{ | ||
QMessageBox::information( this, | ||
tr( "Add mesh layer" ), | ||
tr( "No layers selected." ) ); | ||
return; | ||
} | ||
|
||
for ( const QString &path : QgsFileWidget::splitFilePaths( mMeshPath ) ) | ||
{ | ||
emit addMeshLayer( path, QStringLiteral( "mdal" ) ); | ||
} | ||
} | ||
|
||
QGISEXTERN QgsMdalSourceSelect *selectWidget( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode widgetMode ) | ||
{ | ||
return new QgsMdalSourceSelect( parent, fl, widgetMode ); | ||
} |
Oops, something went wrong.