Commit 0943da35 authored by jcfr's avatar jcfr
Browse files

ENH: Added Screenshot Capture dialog

git-svn-id: http://svn.slicer.org/Slicer4/trunk@15200 3bd1e089-480b-0410-8dfb-8563597acbee
parent 2f8e17db
......@@ -34,6 +34,7 @@
#include "qSlicerModuleManager.h"
#include "qSlicerMainWindowCore.h"
#include "qSlicerModuleSelectorToolBar.h"
#include "qSlicerIOManager.h"
// MRML includes
#include <vtkMRMLScene.h>
......@@ -139,6 +140,10 @@ void qSlicerMainWindowPrivate::setupUi(QMainWindow * mainWindow)
this->MRMLThreeDViewsControllerWidget->setActiveMRMLThreeDViewNode(
layoutManager->activeMRMLThreeDViewNode());
QObject::connect(this->MRMLThreeDViewsControllerWidget,
SIGNAL(screenshotButtonClicked()),
qSlicerApplication::application()->ioManager(),
SLOT(openScreenshotDialog()));
// Populate the View ToolBar
QToolButton* layoutButton = new QToolButton(q);
......@@ -165,7 +170,6 @@ void qSlicerMainWindowPrivate::setupUi(QMainWindow * mainWindow)
this->actionHelpInterfaceDocumentation->setIcon(networkIcon);
this->actionHelpSlicerPublications->setIcon(networkIcon);
this->actionHelpAboutSlicerQT->setIcon(informationIcon);
this->actionFeedbackReportBug->setIcon(criticalIcon);
this->actionFeedbackReportUsabilityIssue->setIcon(warningIcon);
this->actionFeedbackMakeFeatureRequest->setIcon(questionIcon);
......
......@@ -7,12 +7,17 @@
#include <QString>
#include <QUrl>
// CTK includes
#include "ctkScreenshotDialog.h"
/// SlicerQt includes
#include "qSlicerIOManager.h"
#include "qSlicerFileDialog.h"
#include "qSlicerDataDialog.h"
#include "qSlicerModelsDialog.h"
#include "qSlicerSaveDataDialog.h"
#include "qSlicerApplication.h"
#include "qSlicerLayoutManager.h"
/// MRML includes
#include <vtkMRMLScene.h>
......@@ -34,6 +39,8 @@ public:
QList<QUrl> Favorites;
QMap<int, qSlicerFileDialog*> ReadDialogs;
QMap<int, qSlicerFileDialog*> WriteDialogs;
QSharedPointer<ctkScreenshotDialog> ScreenshotDialog;
};
//-----------------------------------------------------------------------------
......@@ -164,3 +171,17 @@ void qSlicerIOManager::registerDialog(qSlicerFileDialog* dialog)
}
dialog->setParent(this);
}
//-----------------------------------------------------------------------------
void qSlicerIOManager::openScreenshotDialog()
{
Q_D(qSlicerIOManager);
if (!d->ScreenshotDialog)
{
d->ScreenshotDialog = QSharedPointer<ctkScreenshotDialog>(
new ctkScreenshotDialog());
d->ScreenshotDialog->setWidgetToGrab(
qSlicerApplication::application()->layoutManager()->viewport());
}
d->ScreenshotDialog->show();
}
......@@ -56,6 +56,10 @@ public:
/// fileType (only 1 dialog per filetype) is overriden.
void registerDialog(qSlicerFileDialog* dialog);
public slots:
void openScreenshotDialog();
protected:
friend class qSlicerFileDialog;
using qSlicerCoreIOManager::ios;
......
......@@ -327,6 +327,8 @@ qMRMLThreeDViewsControllerWidget::qMRMLThreeDViewsControllerWidget(QWidget* _par
{
Q_D(qMRMLThreeDViewsControllerWidget);
d->setupUi(this);
connect(d->ScreenshotButton, SIGNAL(clicked()), SIGNAL(screenshotButtonClicked()));
}
// --------------------------------------------------------------------------
......@@ -357,7 +359,7 @@ void qMRMLThreeDViewsControllerWidget::setActiveMRMLThreeDViewNode(
QList<QWidget*> widgets;
widgets << d->PitchButton << d->RollButton << d->YawButton
<< d->CenterButton << d->OrthoButton << d->VisibilityButton
/*<< d->ScreenshotButton << d->SceneSnapshotButton << d->SelectSceneSnapshotMenuButton*/
<< d->ScreenshotButton /*<< d->SceneSnapshotButton << d->SelectSceneSnapshotMenuButton*/
<< d->ZoomInButton << d->ZoomOutButton << d->StereoButton
<< d->RockButton << d->SpinButton;
foreach(QWidget* w, widgets)
......
......@@ -50,6 +50,10 @@ public slots:
void setActiveMRMLThreeDViewNode(vtkMRMLViewNode * newActiveMRMLThreeDViewNode);
signals:
void screenshotButtonClicked();
protected:
QScopedPointer<qMRMLThreeDViewsControllerWidgetPrivate> d_ptr;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment