Skip to content
Permalink
Browse files
Add ability to save parent project when in Composer
  • Loading branch information
dakcarto committed Dec 11, 2012
1 parent 5de1ad1 commit 94614314a7fea846c4b2f80e9f2be307504d1c58
Showing with 14 additions and 0 deletions.
  1. +10 −0 src/app/composer/qgscomposer.cpp
  2. +4 −0 src/app/composer/qgscomposer.h
@@ -93,6 +93,14 @@ QgsComposer::QgsComposer( QgisApp *qgis, const QString& title )
int size = settings.value( "/IconSize", QGIS_ICON_SIZE ).toInt();
setIconSize( QSize( size, size ) );

// ability to save parent project from composer
mSaveProjectAction = QgisApp::instance()->actionSaveProject();
QToolButton* saveProjectToolButton = new QToolButton( this );
saveProjectToolButton->addAction( mSaveProjectAction );
saveProjectToolButton->setDefaultAction( mSaveProjectAction );
toolBar->insertWidget( mActionLoadFromTemplate, saveProjectToolButton );
toolBar->insertSeparator( mActionLoadFromTemplate );

QToolButton* orderingToolButton = new QToolButton( this );
orderingToolButton->setPopupMode( QToolButton::InstantPopup );
orderingToolButton->setAutoRaise( true );
@@ -162,6 +170,8 @@ QgsComposer::QgsComposer( QgisApp *qgis, const QString& title )
#endif

QMenu *fileMenu = menuBar()->addMenu( tr( "File" ) );
fileMenu->addAction( mSaveProjectAction );
fileMenu->addSeparator();
fileMenu->addAction( mActionLoadFromTemplate );
fileMenu->addAction( mActionSaveAsTemplate );
fileMenu->addSeparator();
@@ -346,6 +346,10 @@ class QgsComposer: public QMainWindow, private Ui::QgsComposerBase

QMenu* mPanelMenu;
QMenu* mToolbarMenu;

//! Save parent Project action
//! @note added in 1.9
QAction *mSaveProjectAction;
};

#endif

0 comments on commit 9461431

Please sign in to comment.