From 56d75eb7949cb5a813f3621ab9bb43bfa111e650 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20M=C3=B6ller?= Date: Fri, 13 Apr 2012 10:33:35 +0000 Subject: [PATCH] - extra button for pasting view and the window size - old "paste View" paste only the view refs #531 git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@14363 383ad7c9-94d9-4d36-a494-682f7c89f535 --- widgets/coreWidget/ContextMenu.cc | 9 +++++++- widgets/coreWidget/CoreWidget.hh | 3 +++ widgets/coreWidget/viewerControl.cc | 32 +++++++++++------------------ 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/widgets/coreWidget/ContextMenu.cc b/widgets/coreWidget/ContextMenu.cc index 674ead5e..1212e1b7 100644 --- a/widgets/coreWidget/ContextMenu.cc +++ b/widgets/coreWidget/ContextMenu.cc @@ -434,7 +434,7 @@ void CoreWidget::updatePopupMenuCoordsysNode(QMenu* _menu , const int /*_part*/ //==================================================================================================== QAction* copyView = _menu->addAction(tr("Copy View")); - copyView->setToolTip(tr("Copy current view to clipboard")); + copyView->setToolTip(tr("Copy current view, window size and toolbar size to clipboard")); copyView->setIcon( QIcon(iconPath+"edit-copy.png") ); connect(copyView, SIGNAL(triggered()), this, SLOT(slotCopyView()) ); @@ -447,6 +447,13 @@ void CoreWidget::updatePopupMenuCoordsysNode(QMenu* _menu , const int /*_part*/ //==================================================================================================== + QAction* pasteViewAndWindow = _menu->addAction(tr("Paste View and Window Size")); + pasteViewAndWindow->setToolTip(tr("Paste current view, window size and the toolbox size from clipboard")); + pasteViewAndWindow->setIcon( QIcon(iconPath+"edit-paste.png") ); + connect(pasteViewAndWindow, SIGNAL(triggered()), this , SLOT( slotPasteViewAndWindow( ) ) ); + + //==================================================================================================== + QAction* snapshot_examiner = _menu->addAction(tr("Examiner Snapshot")); snapshot_examiner->setToolTip(tr("Take a snapshot of the current examiner")); snapshot_examiner->setIcon( QIcon(iconPath+"snapshot.png") ); diff --git a/widgets/coreWidget/CoreWidget.hh b/widgets/coreWidget/CoreWidget.hh index fe5a7fd6..53f2e182 100644 --- a/widgets/coreWidget/CoreWidget.hh +++ b/widgets/coreWidget/CoreWidget.hh @@ -882,6 +882,9 @@ public: /// Paste the view to the last active examiner void slotPasteView( ); + /// Paste the view, the window and toolbox size to the last active examiner + void slotPasteViewAndWindow( ); + /// Copy view from the last active examiner void slotCopyView( ); diff --git a/widgets/coreWidget/viewerControl.cc b/widgets/coreWidget/viewerControl.cc index 96292546..8be41e32 100644 --- a/widgets/coreWidget/viewerControl.cc +++ b/widgets/coreWidget/viewerControl.cc @@ -832,6 +832,11 @@ void CoreWidget::delete_garbage() { } void CoreWidget::slotPasteView( ) { + examiner_widgets_[PluginFunctions::activeExaminer()]->actionPasteView(); +} + +void CoreWidget::slotPasteViewAndWindow() +{ QSize size; int splitterWidth; examiner_widgets_[PluginFunctions::activeExaminer()]->actionPasteView(&size,&splitterWidth); @@ -860,29 +865,16 @@ void CoreWidget::slotPasteView( ) { //resize window if (size.isValid()) { - //ask for restoring the window size - QMessageBox msgBox; - msgBox.setText(QString("Restore window size?")); - msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::No); - msgBox.setDefaultButton(QMessageBox::Ok); - - int ret = msgBox.exec(); - - if (ret == QMessageBox::Ok) + if (size == QSize(0,0)) { - if (size == QSize(0,0)) - { - showMaximized(); - } - else - { - showNormal(); - resizeApplication(size.width(),size.height()); - } + showMaximized(); + } + else + { + showNormal(); + resizeApplication(size.width(),size.height()); } } - - } void CoreWidget::slotCopyView( ) { -- GitLab