mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-04 00:04:03 -04:00
overrirde accept
This commit is contained in:
parent
032f8ff70c
commit
7d453b4d19
@ -449,13 +449,20 @@ void QgsMapSaveDialog::copyToClipboard()
|
||||
QgsApplication::taskManager()->addTask( mapRendererTask );
|
||||
}
|
||||
|
||||
void QgsMapSaveDialog::accept()
|
||||
{
|
||||
// prevent the dialog from closing before saving the image/pdf
|
||||
QgsMapSaveDialog::onAccepted();
|
||||
QDialog::accept();
|
||||
}
|
||||
|
||||
void QgsMapSaveDialog::onAccepted()
|
||||
{
|
||||
switch ( mDialogType )
|
||||
{
|
||||
case Image:
|
||||
{
|
||||
const QPair<QString, QString> fileNameAndFilter = QgsGuiUtils::getSaveAsImageName( QgisApp::instance(), tr( "Choose a file name to save the map image as" ) );
|
||||
const QPair<QString, QString> fileNameAndFilter = QgsGuiUtils::getSaveAsImageName( this, tr( "Choose a file name to save the map image as" ) );
|
||||
if ( !fileNameAndFilter.first.isEmpty() )
|
||||
{
|
||||
QgsMapSettings ms = QgsMapSettings();
|
||||
@ -503,7 +510,7 @@ void QgsMapSaveDialog::onAccepted()
|
||||
{
|
||||
QgsSettings settings;
|
||||
const QString lastUsedDir = settings.value( QStringLiteral( "UI/lastSaveAsImageDir" ), QDir::homePath() ).toString();
|
||||
QString fileName = QFileDialog::getSaveFileName( QgisApp::instance(), tr( "Save Map As" ), lastUsedDir, tr( "PDF Format" ) + " (*.pdf *.PDF)" );
|
||||
QString fileName = QFileDialog::getSaveFileName( this, tr( "Save Map As" ), lastUsedDir, tr( "PDF Format" ) + " (*.pdf *.PDF)" );
|
||||
// return dialog focus on Mac
|
||||
activateWindow();
|
||||
raise();
|
||||
|
@ -78,6 +78,8 @@ class APP_EXPORT QgsMapSaveDialog : public QDialog, private Ui::QgsMapSaveDialog
|
||||
//! configure a map settings object
|
||||
void applyMapSettings( QgsMapSettings &mapSettings );
|
||||
|
||||
void accept() override;
|
||||
|
||||
private slots:
|
||||
void onAccepted();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user