2016-06-24 08:10:18 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2016 Statoil ASA
|
|
|
|
//
|
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2016-06-24 08:53:04 -05:00
|
|
|
#include "RiuMainWindowBase.h"
|
|
|
|
|
2016-10-04 04:44:31 -05:00
|
|
|
#include "cafPdmUiDragDropInterface.h"
|
|
|
|
|
2016-06-24 08:10:18 -05:00
|
|
|
#include <QMdiArea>
|
|
|
|
|
2016-10-04 02:29:45 -05:00
|
|
|
#include <memory>
|
|
|
|
|
2016-06-24 08:10:18 -05:00
|
|
|
class QMdiSubWindow;
|
2016-06-27 07:00:19 -05:00
|
|
|
|
2016-06-24 08:10:18 -05:00
|
|
|
class RiuViewer;
|
2016-06-27 07:00:19 -05:00
|
|
|
|
2016-06-24 08:10:18 -05:00
|
|
|
struct RimMdiWindowGeometry;
|
|
|
|
|
|
|
|
namespace caf
|
|
|
|
{
|
2016-06-27 07:00:19 -05:00
|
|
|
class PdmUiTreeView;
|
|
|
|
class PdmObject;
|
|
|
|
class PdmUiPropertyView;
|
|
|
|
class PdmUiItem;
|
2016-06-24 08:10:18 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//==================================================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==================================================================================================
|
2016-06-24 08:53:04 -05:00
|
|
|
class RiuMainPlotWindow : public RiuMainWindowBase
|
2016-06-24 08:10:18 -05:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
RiuMainPlotWindow();
|
|
|
|
|
2016-06-24 08:53:04 -05:00
|
|
|
virtual QString mainWindowName() { return "RiuMainPlotWindow"; }
|
|
|
|
|
2016-06-24 08:10:18 -05:00
|
|
|
void initializeGuiNewProjectLoaded();
|
|
|
|
void cleanupGuiBeforeProjectClose();
|
|
|
|
|
|
|
|
void removeViewer( QWidget* viewer );
|
|
|
|
void addViewer(QWidget* viewer, const RimMdiWindowGeometry& windowsGeometry);
|
|
|
|
void setActiveViewer(QWidget* subWindow);
|
|
|
|
|
|
|
|
caf::PdmUiTreeView* projectTreeView() { return m_projectTreeView;}
|
|
|
|
|
|
|
|
void hideAllDockWindows();
|
|
|
|
|
|
|
|
void selectAsCurrentItem(caf::PdmObject* object);
|
|
|
|
|
|
|
|
void setDefaultWindowSize();
|
|
|
|
|
|
|
|
void setExpanded(const caf::PdmUiItem* uiItem, bool expanded);
|
|
|
|
|
|
|
|
RimMdiWindowGeometry windowGeometryForViewer(QWidget* viewer);
|
|
|
|
RimMdiWindowGeometry windowGeometryForWidget(QWidget* widget);
|
|
|
|
|
|
|
|
void tileWindows();
|
|
|
|
bool isAnyMdiSubWindowVisible();
|
|
|
|
QMdiSubWindow* findMdiSubWindow(QWidget* viewer);
|
|
|
|
QList<QMdiSubWindow*> subWindowList(QMdiArea::WindowOrder order);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void closeEvent(QCloseEvent* event);
|
|
|
|
|
|
|
|
private:
|
|
|
|
void createActions();
|
|
|
|
void createMenus();
|
|
|
|
void createToolBars();
|
|
|
|
void createDockPanels();
|
|
|
|
|
|
|
|
void restoreTreeViewState();
|
|
|
|
|
|
|
|
private:
|
|
|
|
QByteArray m_initialDockAndToolbarLayout; // Initial dock window and toolbar layout, used to reset GUI
|
|
|
|
|
|
|
|
private:
|
|
|
|
QMdiArea* m_mdiArea;
|
|
|
|
RiuViewer* m_mainViewer;
|
|
|
|
|
|
|
|
QMenu* m_windowMenu;
|
|
|
|
|
|
|
|
|
|
|
|
// Menu and action slots
|
|
|
|
private slots:
|
|
|
|
|
|
|
|
friend class RiuMdiSubWindow;
|
|
|
|
|
|
|
|
void slotBuildWindowActions();
|
|
|
|
|
|
|
|
void slotSubWindowActivated(QMdiSubWindow* subWindow);
|
|
|
|
|
|
|
|
void selectedObjectsChanged();
|
|
|
|
void customMenuRequested(const QPoint& pos);
|
|
|
|
|
|
|
|
public:
|
|
|
|
void setPdmRoot(caf::PdmObject* pdmRoot);
|
2016-06-27 07:00:19 -05:00
|
|
|
|
2016-06-24 08:10:18 -05:00
|
|
|
private:
|
|
|
|
caf::PdmUiTreeView* m_projectTreeView;
|
|
|
|
|
2016-10-04 02:29:45 -05:00
|
|
|
std::unique_ptr<caf::PdmUiDragDropInterface> m_dragDropInterface;
|
2016-06-24 08:10:18 -05:00
|
|
|
|
|
|
|
caf::PdmObject* m_pdmRoot;
|
|
|
|
caf::PdmUiPropertyView* m_pdmUiPropertyView;
|
|
|
|
|
|
|
|
bool m_blockSlotSubWindowActivated;
|
|
|
|
};
|