Skip to content

Commit

Permalink
Add ability to save parent project when in Composer
Browse files Browse the repository at this point in the history
  • Loading branch information
dakcarto committed Dec 11, 2012
1 parent 5de1ad1 commit 9461431
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/app/composer/qgscomposer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down Expand Up @@ -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();
Expand Down
4 changes: 4 additions & 0 deletions src/app/composer/qgscomposer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.