Skip to content
Permalink
Browse files

Remove executeExport* methods from QgsWindowManagerInterface

No longer required, and of limited value anyway
  • Loading branch information
nyalldawson committed Nov 1, 2018
1 parent f455b9e commit a8906229967ddc4b75f3afe6d97ade86817b9bed
@@ -45,40 +45,6 @@ existing instance to the foreground.

Returns the dialog if shown, or None if the dialog either could not be
created or is not supported by the window manager implementation.
%End

virtual QString executeExportVectorLayerDialog( QgsVectorLayer *layer );
%Docstring
Executes the standard "Export Vector Layer" dialog for the specified ``layer``,
and performs an export using the settings accepted in the dialog.

The created vector file name is returned.

Depending on the window manager implementation the actual export of the
layer may occur in a background task, in which case calling this method
will immediately return after the dialog has been accepted, but before
the exported layer has been finalized.

.. seealso:: :py:func:`executeExportRasterLayerDialog`

.. versionadded:: 3.6
%End

virtual QString executeExportRasterLayerDialog( QgsRasterLayer *layer );
%Docstring
Executes the standard "Export Raster Layer" dialog for the specified ``layer``,
and performs an export using the settings accepted in the dialog.

The created raster file name is returned.

Depending on the window manager implementation the actual export of the
layer may occur in a background task, in which case calling this method
will immediately return after the dialog has been accepted, but before
the exported layer has been finalized.

.. seealso:: :py:func:`executeExportVectorLayerDialog`

.. versionadded:: 3.6
%End

};
@@ -335,7 +335,7 @@ void QgsLayerItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu *men
std::unique_ptr<QgsVectorLayer> layer( new QgsVectorLayer( layerItem->uri(), layerItem->name(), layerItem->providerKey() ) );
if ( layer && layer->isValid() )
{
QgsGui::instance()->windowManager()->executeExportVectorLayerDialog( layer.get() );
QgisApp::instance()->saveAsFile( layer.get(), false, false );
}
break;
}
@@ -345,7 +345,7 @@ void QgsLayerItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu *men
std::unique_ptr<QgsRasterLayer> layer( new QgsRasterLayer( layerItem->uri(), layerItem->name(), layerItem->providerKey() ) );
if ( layer && layer->isValid() )
{
QgsGui::instance()->windowManager()->executeExportRasterLayerDialog( layer.get() );
QgisApp::instance()->saveAsFile( layer.get(), false, false );
}
break;
}
@@ -47,16 +47,6 @@ QWidget *QgsAppWindowManager::openStandardDialog( QgsWindowManagerInterface::Sta
return nullptr;
}

QString QgsAppWindowManager::executeExportVectorLayerDialog( QgsVectorLayer *layer )
{
return QgisApp::instance()->saveAsFile( layer, false, false );
}

QString QgsAppWindowManager::executeExportRasterLayerDialog( QgsRasterLayer *layer )
{
return QgisApp::instance()->saveAsFile( layer, false, false );
}

QWidget *QgsAppWindowManager::openApplicationDialog( QgsAppWindowManager::ApplicationDialog dialog )
{
switch ( dialog )
@@ -41,8 +41,6 @@ class QgsAppWindowManager : public QgsWindowManagerInterface
~QgsAppWindowManager();

QWidget *openStandardDialog( QgsWindowManagerInterface::StandardDialog dialog ) override;
QString executeExportVectorLayerDialog( QgsVectorLayer *layer ) override;
QString executeExportRasterLayerDialog( QgsRasterLayer *layer ) override;

/**
* Opens an instance of a application QGIS dialog. Depending on the dialog,
@@ -56,48 +56,6 @@ class GUI_EXPORT QgsWindowManagerInterface
*/
virtual QWidget *openStandardDialog( StandardDialog dialog ) = 0;

/**
* Executes the standard "Export Vector Layer" dialog for the specified \a layer,
* and performs an export using the settings accepted in the dialog.
*
* The created vector file name is returned.
*
* Depending on the window manager implementation the actual export of the
* layer may occur in a background task, in which case calling this method
* will immediately return after the dialog has been accepted, but before
* the exported layer has been finalized.
*
* \see executeExportRasterLayerDialog()
*
* \since QGIS 3.6
*/
virtual QString executeExportVectorLayerDialog( QgsVectorLayer *layer )
{
Q_UNUSED( layer );
return QString();
}

/**
* Executes the standard "Export Raster Layer" dialog for the specified \a layer,
* and performs an export using the settings accepted in the dialog.
*
* The created raster file name is returned.
*
* Depending on the window manager implementation the actual export of the
* layer may occur in a background task, in which case calling this method
* will immediately return after the dialog has been accepted, but before
* the exported layer has been finalized.
*
* \see executeExportVectorLayerDialog()
*
* \since QGIS 3.6
*/
virtual QString executeExportRasterLayerDialog( QgsRasterLayer *layer )
{
Q_UNUSED( layer );
return QString();
}

};

///@endcond

0 comments on commit a890622

Please sign in to comment.
You can’t perform that action at this time.