@@ -214,22 +214,24 @@ QgsComposer::QgsComposer( QgisApp *qgis, const QString& title )
214214 composerMenu->addAction ( mActionPrint );
215215 composerMenu->addSeparator ();
216216 composerMenu->addAction ( mActionQuit );
217- QObject:: connect ( mActionQuit , SIGNAL ( triggered () ), this , SLOT ( close () ) );
217+ connect ( mActionQuit , SIGNAL ( triggered () ), this , SLOT ( close () ) );
218218
219219 // cut/copy/paste actions. Note these are not included in the ui file
220220 // as ui files have no support for QKeySequence shortcuts
221221 mActionCut = new QAction ( tr ( " Cu&t" ), this );
222222 mActionCut ->setShortcuts ( QKeySequence::Cut );
223223 mActionCut ->setStatusTip ( tr ( " Cut" ) );
224- QObject::connect ( mActionCut , SIGNAL ( triggered () ), this , SLOT ( actionCutTriggered () ) );
224+ connect ( mActionCut , SIGNAL ( triggered () ), this , SLOT ( actionCutTriggered () ) );
225+
225226 mActionCopy = new QAction ( tr ( " &Copy" ), this );
226227 mActionCopy ->setShortcuts ( QKeySequence::Copy );
227228 mActionCopy ->setStatusTip ( tr ( " Copy" ) );
228- QObject::connect ( mActionCopy , SIGNAL ( triggered () ), this , SLOT ( actionCopyTriggered () ) );
229+ connect ( mActionCopy , SIGNAL ( triggered () ), this , SLOT ( actionCopyTriggered () ) );
230+
229231 mActionPaste = new QAction ( tr ( " &Paste" ), this );
230232 mActionPaste ->setShortcuts ( QKeySequence::Paste );
231233 mActionPaste ->setStatusTip ( tr ( " Paste" ) );
232- QObject:: connect ( mActionPaste , SIGNAL ( triggered () ), this , SLOT ( actionPasteTriggered () ) );
234+ connect ( mActionPaste , SIGNAL ( triggered () ), this , SLOT ( actionPasteTriggered () ) );
233235
234236 QMenu *editMenu = menuBar ()->addMenu ( tr ( " Edit" ) );
235237 editMenu->addAction ( mActionUndo );
@@ -337,6 +339,7 @@ QgsComposer::QgsComposer( QgisApp *qgis, const QString& title )
337339
338340 QMenu *settingsMenu = menuBar ()->addMenu ( tr ( " Settings" ) );
339341 settingsMenu->addAction ( mActionOptions );
342+ settingsMenu->addAction ( mActionResetUIdefaults );
340343
341344#ifdef Q_WS_MAC
342345 // this doesn't work on Mac anymore: menuBar()->addMenu( mQgis->windowMenu() );
@@ -2496,6 +2499,17 @@ void QgsComposer::restoreWindowState()
24962499 }
24972500}
24982501
2502+ void QgsComposer::on_mActionResetUIdefaults_triggered ()
2503+ {
2504+ if ( QMessageBox::warning ( this , tr ( " Restore UI defaults" ), tr ( " Are you sure to reset the UI to default?" ), QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
2505+ return ;
2506+
2507+ saveWindowState ();
2508+ QSettings settings;
2509+ settings.remove ( " /ComposerUI/state" );
2510+ restoreWindowState ();
2511+ }
2512+
24992513void QgsComposer::writeXML ( QDomDocument& doc )
25002514{
25012515
@@ -2593,9 +2607,9 @@ void QgsComposer::readXML( const QDomElement& composerElem, const QDomDocument&
25932607
25942608 // create compositionwidget
25952609 QgsCompositionWidget* compositionWidget = new QgsCompositionWidget ( mGeneralDock , mComposition );
2596- QObject:: connect ( mComposition , SIGNAL ( paperSizeChanged () ), compositionWidget, SLOT ( displayCompositionWidthHeight () ) );
2597- QObject:: connect ( this , SIGNAL ( printAsRasterChanged ( bool ) ), compositionWidget, SLOT ( setPrintAsRasterCheckBox ( bool ) ) );
2598- QObject:: connect ( compositionWidget, SIGNAL ( pageOrientationChanged ( QString ) ), this , SLOT ( setPrinterPageOrientation ( QString ) ) );
2610+ connect ( mComposition , SIGNAL ( paperSizeChanged () ), compositionWidget, SLOT ( displayCompositionWidthHeight () ) );
2611+ connect ( this , SIGNAL ( printAsRasterChanged ( bool ) ), compositionWidget, SLOT ( setPrintAsRasterCheckBox ( bool ) ) );
2612+ connect ( compositionWidget, SIGNAL ( pageOrientationChanged ( QString ) ), this , SLOT ( setPrinterPageOrientation ( QString ) ) );
25992613 mGeneralDock ->setWidget ( compositionWidget );
26002614
26012615 // read and restore all the items
0 commit comments