Skip to content

Commit

Permalink
Refs #7363. multiple VATES windows
Browse files Browse the repository at this point in the history
  • Loading branch information
quantumsteve committed Dec 9, 2014
1 parent 2ab748d commit 2149a09
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 140 deletions.
34 changes: 13 additions & 21 deletions Code/Mantid/MantidPlot/src/Mantid/MantidUI.cpp
Expand Up @@ -110,8 +110,8 @@ MantidUI::MantidUI(ApplicationWindow *aw):
m_configServiceObserver(*this,&MantidUI::handleConfigServiceUpdate),
m_appWindow(aw),
m_lastShownInstrumentWin(NULL), m_lastShownSliceViewWin(NULL), m_lastShownSpectrumViewerWin(NULL),
m_lastShownColorFillWin(NULL), m_lastShown1DPlotWin(NULL),
m_vatesSubWindow(NULL)//, m_spectrumViewWindow(NULL)
m_lastShownColorFillWin(NULL), m_lastShown1DPlotWin(NULL)
//, m_spectrumViewWindow(NULL)
{

// To be able to use them in queued signals they need to be registered
Expand Down Expand Up @@ -696,40 +696,32 @@ void MantidUI::showVatesSimpleInterface()
wsType = MantidQt::API::VatesViewerInterface::MDHW;
}

if (m_vatesSubWindow)
{
QWidget *vwidget = m_vatesSubWindow->widget();
vwidget->show();
qobject_cast<MantidQt::API::VatesViewerInterface *>(vwidget)->renderWorkspace(wsName, wsType);
return;
}
else
{
m_vatesSubWindow = new QMdiSubWindow;
m_vatesSubWindow->setAttribute(Qt::WA_DeleteOnClose, false);
QMdiSubWindow *vatesSubWindow = new QMdiSubWindow;
vatesSubWindow->setAttribute(Qt::WA_DeleteOnClose, false);
QIcon icon; icon.addFile(QString::fromUtf8(":/VatesSimpleGuiViewWidgets/icons/pvIcon.png"), QSize(), QIcon::Normal, QIcon::Off);
m_vatesSubWindow->setWindowIcon(icon);
connect(m_appWindow, SIGNAL(shutting_down()), m_vatesSubWindow, SLOT(close()));
vatesSubWindow->setWindowIcon(icon);
connect(m_appWindow, SIGNAL(shutting_down()), vatesSubWindow, SLOT(close()));

MantidQt::API::InterfaceManager interfaceManager;
MantidQt::API::VatesViewerInterface *vsui = interfaceManager.createVatesSimpleGui();
if (vsui)
{
connect(m_appWindow, SIGNAL(shutting_down()),
vsui, SLOT(shutdown()));
connect(vsui, SIGNAL(requestClose()), m_vatesSubWindow, SLOT(close()));
vsui->setParent(m_vatesSubWindow);
m_vatesSubWindow->setWindowTitle("Vates Simple Interface");
connect(vsui, SIGNAL(requestClose()), vatesSubWindow, SLOT(close()));
vsui->setParent(vatesSubWindow);
vatesSubWindow->setWindowTitle("Vates Simple Interface");
vsui->setupPluginMode();
//m_appWindow->setGeometry(m_vatesSubWindow, vsui);
m_vatesSubWindow->setWidget(vsui);
m_vatesSubWindow->widget()->show();
vatesSubWindow->setWidget(vsui);
vatesSubWindow->widget()->show();
vsui->renderWorkspace(wsName, wsType);
}
else
{
delete m_vatesSubWindow;
m_vatesSubWindow = NULL;
delete vatesSubWindow;
vatesSubWindow = NULL;
return;
}
}
Expand Down
2 changes: 0 additions & 2 deletions Code/Mantid/MantidPlot/src/Mantid/MantidUI.h
Expand Up @@ -564,8 +564,6 @@ private slots:
// Stores dependent mdi windows. If the 'key' window closes, all 'value' ones must be closed as well.
std::multimap<MdiSubWindow*,MdiSubWindow*> m_mdiDependency;

QMdiSubWindow *m_vatesSubWindow; ///< Holder for the Vates interface sub-window

//prevents some repeated code realtating to log names
void formatLogName(QString &label, const QString &wsName);
};
Expand Down
3 changes: 3 additions & 0 deletions Code/Mantid/Vates/VatesSimpleGui/ViewWidgets/CMakeLists.txt
Expand Up @@ -7,6 +7,7 @@ set( INCLUDE_FILES
inc/MantidVatesSimpleGuiViewWidgets/LibHelper.h
inc/MantidVatesSimpleGuiViewWidgets/MdViewerWidget.h
inc/MantidVatesSimpleGuiViewWidgets/MultisliceView.h
inc/MantidVatesSimpleGuiViewWidgets/VatesParaViewApplication.h
inc/MantidVatesSimpleGuiViewWidgets/SaveScreenshotReaction.h
inc/MantidVatesSimpleGuiViewWidgets/StandardView.h
inc/MantidVatesSimpleGuiViewWidgets/SplatterPlotView.h
Expand All @@ -26,6 +27,7 @@ set( SOURCE_FILES
src/SplatterPlotView.cpp
src/ThreesliceView.cpp
src/TimeControlWidget.cpp
src/VatesParaViewApplication.cpp
src/ViewBase.cpp
)

Expand All @@ -40,6 +42,7 @@ qt4_wrap_cpp( MOC_SOURCES
inc/MantidVatesSimpleGuiViewWidgets/SplatterPlotView.h
inc/MantidVatesSimpleGuiViewWidgets/ThreesliceView.h
inc/MantidVatesSimpleGuiViewWidgets/TimeControlWidget.h
inc/MantidVatesSimpleGuiViewWidgets/VatesParaViewApplication.h
inc/MantidVatesSimpleGuiViewWidgets/ViewBase.h
)

Expand Down
Expand Up @@ -114,11 +114,10 @@ protected slots:

private:
Q_DISABLE_COPY(MdViewerWidget)

QString m_widgetName;
ViewBase *currentView; ///< Holder for the current view
pqLoadDataReaction *dataLoader; ///< Holder for the load data reaction
ViewBase *hiddenView; ///< Holder for the view that is being switched from
bool isPluginInitialized; ///< Flag for plugin initialization
double lodThreshold; ///< Default value for the LOD threshold (5 MB)
QAction *lodAction; ///< Holder for the LOD threshold menu item
bool pluginMode; ///< Flag to say widget is in plugin mode
Expand All @@ -129,16 +128,12 @@ protected slots:
pqApplicationSettingsReaction *viewSettings; ///< Holder for the view settings reaction
bool viewSwitched;

/// Check the environmental variables.
void checkEnvSetup();
/// Setup color selection widget connections.
void connectColorSelectionWidget();
/// Setup connections for all dialogs.
void connectDialogs();
/// Setup rotation point dialog connections.
void connectRotationPointDialog();
/// Create the pqPVApplicationCore object in plugin mode.
void createAppCoreForPlugin();
/// Add view specific stuff to a menu.
void createMenus();
/// Disconnect dialog connections.
Expand All @@ -153,8 +148,6 @@ protected slots:
void setParaViewComponentsForView();
/// Run the necessary setup for the main view.
void setupMainView();
/// Mimic ParaView behavior setup without QMainWindow.
void setupParaViewBehaviors();
/// Creates the UI and mode switch connection.
void setupUiAndConnections();
/// Create the requested view.
Expand Down
Expand Up @@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>974</width>
<width>1361</width>
<height>710</height>
</rect>
</property>
Expand Down Expand Up @@ -191,26 +191,27 @@
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="properties">
<widget class="QWidget" name="properties2">
<attribute name="title">
<string>Properties</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="pqPropertiesPanel" name="propertiesPanel" native="true"/>
<widget class="pqProxiesWidget" name="proxiesPanel" native="true"/>
</item>
</layout>
</layout>
</widget>
<widget class="QWidget" name="properties2">
<widget class="QWidget" name="properties">
<attribute name="title">
<string>Properties</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="pqProxiesWidget" name="proxiesPanel" native="true"/>
<widget class="pqPropertiesPanel" name="propertiesPanel" native="true"/>
</item>
</layout>
</widget>

<widget class="QWidget" name="information">
<attribute name="title">
<string>Information</string>
Expand All @@ -226,8 +227,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>126</width>
<height>390</height>
<width>105</width>
<height>387</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
Expand Down Expand Up @@ -339,6 +340,11 @@
<header>pqColorMapEditor.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>pqProxiesWidget</class>
<extends>QWidget</extends>
<header>pqproxieswidget.h</header>
</customwidget>
</customwidgets>
<resources>
<include location="../../icons/ViewWidgetsIcons.qrc"/>
Expand Down

0 comments on commit 2149a09

Please sign in to comment.