Showing with 36 additions and 24 deletions.
  1. +1 −0 python/gui/qgisinterface.sip
  2. +31 −24 src/app/composer/qgscomposer.cpp
  3. +1 −0 src/app/qgisapp.h
  4. +1 −0 src/app/qgisappinterface.cpp
  5. +1 −0 src/app/qgisappinterface.h
  6. +1 −0 src/gui/qgisinterface.h
1 change: 1 addition & 0 deletions python/gui/qgisinterface.sip
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ class QgisInterface : QObject
virtual QAction *actionSaveMapAsImage() = 0;
virtual QAction *actionProjectProperties() = 0;
virtual QAction *actionPrintComposer() = 0;
virtual QAction *actionShowComposerManager() = 0;
virtual QAction *actionExit() = 0;

//! Edit menu actions
Expand Down
55 changes: 31 additions & 24 deletions src/app/composer/qgscomposer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ QgsComposer::QgsComposer( QgisApp *qgis, const QString& title )
QMenu *composerMenu = menuBar()->addMenu( tr( "Composer" ) );
composerMenu->addAction( mSaveProjectAction );
composerMenu->addSeparator();
composerMenu->addAction( QgisApp::instance()->actionNewPrintComposer() );
composerMenu->addAction( QgisApp::instance()->actionShowComposerManager() );
composerMenu->addSeparator();
composerMenu->addAction( mActionLoadFromTemplate );
composerMenu->addAction( mActionSaveAsTemplate );
composerMenu->addSeparator();
Expand Down Expand Up @@ -658,15 +661,16 @@ void QgsComposer::on_mActionExportAsPDF_triggered()

QPainter painter;

try {
try
{
atlasMap->beginRender();
}
catch ( std::exception& e )
{
QMessageBox::warning( this, tr( "Atlas processing error" ),
e.what(),
QMessageBox::Ok,
QMessageBox::Ok );
e.what(),
QMessageBox::Ok,
QMessageBox::Ok );
mView->setPaintingEnabled( true );
return;
}
Expand Down Expand Up @@ -701,8 +705,8 @@ void QgsComposer::on_mActionExportAsPDF_triggered()
e.what(),
QMessageBox::Ok,
QMessageBox::Ok );
mView->setPaintingEnabled( true );
return;
mView->setPaintingEnabled( true );
return;
}
if ( !atlasOnASingleFile )
{
Expand Down Expand Up @@ -770,15 +774,16 @@ void QgsComposer::on_mActionPrint_triggered()

mComposition->beginPrint( mPrinter );
QPainter painter( &mPrinter );
try {
try
{
atlasMap->beginRender();
}
catch ( std::exception& e )
{
QMessageBox::warning( this, tr( "Atlas processing error" ),
e.what(),
QMessageBox::Ok,
QMessageBox::Ok );
e.what(),
QMessageBox::Ok,
QMessageBox::Ok );
mView->setPaintingEnabled( true );
return;
}
Expand All @@ -805,8 +810,8 @@ void QgsComposer::on_mActionPrint_triggered()
e.what(),
QMessageBox::Ok,
QMessageBox::Ok );
mView->setPaintingEnabled( true );
return;
mView->setPaintingEnabled( true );
return;
}


Expand Down Expand Up @@ -966,15 +971,16 @@ void QgsComposer::on_mActionExportAsImage_triggered()
mView->setPaintingEnabled( false );
QApplication::setOverrideCursor( Qt::BusyCursor );

try {
try
{
atlasMap->beginRender();
}
catch ( std::exception& e )
{
QMessageBox::warning( this, tr( "Atlas processing error" ),
e.what(),
QMessageBox::Ok,
QMessageBox::Ok );
e.what(),
QMessageBox::Ok,
QMessageBox::Ok );
mView->setPaintingEnabled( true );
return;
}
Expand Down Expand Up @@ -1002,8 +1008,8 @@ void QgsComposer::on_mActionExportAsImage_triggered()
e.what(),
QMessageBox::Ok,
QMessageBox::Ok );
mView->setPaintingEnabled( true );
return;
mView->setPaintingEnabled( true );
return;
}

QString filename = QDir( dir ).filePath( atlasMap->currentFilename() ) + fileExt;
Expand Down Expand Up @@ -1135,15 +1141,16 @@ void QgsComposer::on_mActionExportAsSVG_triggered()
size_t featureI = 0;
if ( hasAnAtlas )
{
try {
try
{
atlasMap->beginRender();
}
catch ( std::exception& e )
{
QMessageBox::warning( this, tr( "Atlas processing error" ),
e.what(),
QMessageBox::Ok,
QMessageBox::Ok );
e.what(),
QMessageBox::Ok,
QMessageBox::Ok );
mView->setPaintingEnabled( true );
return;
}
Expand Down Expand Up @@ -1175,8 +1182,8 @@ void QgsComposer::on_mActionExportAsSVG_triggered()
e.what(),
QMessageBox::Ok,
QMessageBox::Ok );
mView->setPaintingEnabled( true );
return;
mView->setPaintingEnabled( true );
return;
}
outputFileName = QDir( outputDir ).filePath( atlasMap->currentFilename() ) + ".svg";
}
Expand Down
1 change: 1 addition & 0 deletions src/app/qgisapp.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
QAction *actionSaveProjectAs() { return mActionSaveProjectAs; }
QAction *actionSaveMapAsImage() { return mActionSaveMapAsImage; }
QAction *actionProjectProperties() { return mActionProjectProperties; }
QAction *actionShowComposerManager() { return mActionShowComposerManager; }
QAction *actionNewPrintComposer() { return mActionNewPrintComposer; }
QAction *actionExit() { return mActionExit; }

Expand Down
1 change: 1 addition & 0 deletions src/app/qgisappinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ QAction *QgisAppInterface::actionSaveProjectAs() { return qgis->actionSaveProjec
QAction *QgisAppInterface::actionSaveMapAsImage() { return qgis->actionSaveMapAsImage(); }
QAction *QgisAppInterface::actionProjectProperties() { return qgis->actionProjectProperties(); }
QAction *QgisAppInterface::actionPrintComposer() { return qgis->actionNewPrintComposer(); }
QAction *QgisAppInterface::actionShowComposerManager() { return qgis->actionShowComposerManager(); }
QAction *QgisAppInterface::actionExit() { return qgis->actionExit(); }

//! Edit menu actions
Expand Down
1 change: 1 addition & 0 deletions src/app/qgisappinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ class QgisAppInterface : public QgisInterface
virtual QAction *actionSaveMapAsImage();
virtual QAction *actionProjectProperties();
virtual QAction *actionPrintComposer();
virtual QAction *actionShowComposerManager();
virtual QAction *actionExit();

//! Edit menu actions
Expand Down
1 change: 1 addition & 0 deletions src/gui/qgisinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ class GUI_EXPORT QgisInterface : public QObject
virtual QAction *actionSaveMapAsImage() = 0;
virtual QAction *actionProjectProperties() = 0;
virtual QAction *actionPrintComposer() = 0;
virtual QAction *actionShowComposerManager() = 0;
virtual QAction *actionExit() = 0;

//! Edit menu actions
Expand Down