mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#851 Added "Open 3D Window" tool button in plot window. Raise mainWindow when activated from toolbar
This commit is contained in:
@@ -80,7 +80,7 @@ RiuMainPlotWindow::RiuMainPlotWindow()
|
||||
// Store the layout so we can offer reset option
|
||||
m_initialDockAndToolbarLayout = saveState(0);
|
||||
|
||||
m_dragDropInterface = new RiuDragDrop;
|
||||
m_dragDropInterface = std::make_unique<RiuDragDrop>();
|
||||
|
||||
initializeGuiNewProjectLoaded();
|
||||
|
||||
@@ -90,14 +90,6 @@ RiuMainPlotWindow::RiuMainPlotWindow()
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuMainPlotWindow::~RiuMainPlotWindow()
|
||||
{
|
||||
delete m_dragDropInterface;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -126,6 +118,8 @@ void RiuMainPlotWindow::cleanupGuiBeforeProjectClose()
|
||||
void RiuMainPlotWindow::closeEvent(QCloseEvent* event)
|
||||
{
|
||||
saveWinGeoAndDockToolBarLayout();
|
||||
|
||||
RiaApplication::instance()->tryClosePlotWindow();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -189,6 +183,7 @@ void RiuMainPlotWindow::createToolBars()
|
||||
QToolBar* toolbar = addToolBar(tr("Window Management"));
|
||||
toolbar->setObjectName(toolbar->windowTitle());
|
||||
toolbar->addAction(cmdFeatureMgr->action("RicTilePlotWindowsFeature"));
|
||||
toolbar->addAction(cmdFeatureMgr->action("RicShowMainWindowFeature"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -358,7 +353,7 @@ void RiuMainPlotWindow::setPdmRoot(caf::PdmObject* pdmRoot)
|
||||
|
||||
m_projectTreeView->setPdmItem(pdmRoot);
|
||||
// For debug only : m_projectTreeView->treeView()->expandAll();
|
||||
m_projectTreeView->setDragDropInterface(m_dragDropInterface);
|
||||
m_projectTreeView->setDragDropInterface(m_dragDropInterface.get());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
|
||||
#include <QMdiArea>
|
||||
|
||||
#include <memory>
|
||||
|
||||
class QMdiSubWindow;
|
||||
|
||||
class RiuViewer;
|
||||
@@ -48,7 +50,6 @@ class RiuMainPlotWindow : public RiuMainWindowBase
|
||||
|
||||
public:
|
||||
RiuMainPlotWindow();
|
||||
~RiuMainPlotWindow();
|
||||
|
||||
virtual QString mainWindowName() { return "RiuMainPlotWindow"; }
|
||||
|
||||
@@ -125,7 +126,7 @@ public:
|
||||
private:
|
||||
caf::PdmUiTreeView* m_projectTreeView;
|
||||
|
||||
caf::PdmUiDragDropInterface* m_dragDropInterface;
|
||||
std::unique_ptr<caf::PdmUiDragDropInterface> m_dragDropInterface;
|
||||
|
||||
caf::PdmObject* m_pdmRoot;
|
||||
caf::PdmUiPropertyView* m_pdmUiPropertyView;
|
||||
|
||||
@@ -139,7 +139,7 @@ RiuMainWindow::RiuMainWindow()
|
||||
|
||||
sm_mainWindowInstance = this;
|
||||
|
||||
m_dragDropInterface = new RiuDragDrop;
|
||||
m_dragDropInterface = std::make_unique<RiuDragDrop>();
|
||||
|
||||
initializeGuiNewProjectLoaded();
|
||||
|
||||
@@ -215,15 +215,16 @@ void RiuMainWindow::cleanupGuiBeforeProjectClose()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMainWindow::closeEvent(QCloseEvent* event)
|
||||
{
|
||||
saveWinGeoAndDockToolBarLayout();
|
||||
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
|
||||
if (!app->tryClosePlotWindow()) return;
|
||||
|
||||
if (!RiaApplication::instance()->closeProject(true))
|
||||
{
|
||||
event->ignore();
|
||||
return;
|
||||
}
|
||||
|
||||
delete m_dragDropInterface;
|
||||
|
||||
saveWinGeoAndDockToolBarLayout();
|
||||
|
||||
event->accept();
|
||||
}
|
||||
@@ -1212,7 +1213,7 @@ void RiuMainWindow::setPdmRoot(caf::PdmObject* pdmRoot)
|
||||
|
||||
m_projectTreeView->setPdmItem(pdmRoot);
|
||||
// For debug only : m_projectTreeView->treeView()->expandAll();
|
||||
m_projectTreeView->setDragDropInterface(m_dragDropInterface);
|
||||
m_projectTreeView->setDragDropInterface(m_dragDropInterface.get());
|
||||
|
||||
for (size_t i = 0; i < additionalProjectViews.size(); i++)
|
||||
{
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
#include <QPointer>
|
||||
#include <QMdiArea>
|
||||
|
||||
#include <memory>
|
||||
|
||||
class QActionGroup;
|
||||
class QComboBox;
|
||||
class QFrame;
|
||||
@@ -74,6 +76,7 @@ class RiuMainWindow : public RiuMainWindowBase
|
||||
|
||||
public:
|
||||
RiuMainWindow();
|
||||
|
||||
static RiuMainWindow* instance();
|
||||
|
||||
virtual QString mainWindowName() { return "RiuMainWindow"; }
|
||||
@@ -292,7 +295,7 @@ public:
|
||||
private:
|
||||
caf::PdmUiTreeView* m_projectTreeView;
|
||||
|
||||
caf::PdmUiDragDropInterface* m_dragDropInterface;
|
||||
std::unique_ptr<caf::PdmUiDragDropInterface> m_dragDropInterface;
|
||||
|
||||
QUndoView* m_undoView;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user