2016-06-24 15:10:18 +02: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 15:53:04 +02:00
|
|
|
#include "RiuMainWindowBase.h"
|
|
|
|
|
|
2016-10-04 11:44:31 +02:00
|
|
|
#include "cafPdmUiDragDropInterface.h"
|
2018-01-25 14:53:51 +01:00
|
|
|
#include "cafPdmPointer.h"
|
2016-10-04 11:44:31 +02:00
|
|
|
|
2016-06-24 15:10:18 +02:00
|
|
|
#include <QMdiArea>
|
|
|
|
|
|
2016-10-04 09:29:45 +02:00
|
|
|
#include <memory>
|
|
|
|
|
|
2016-06-24 15:10:18 +02:00
|
|
|
class QMdiSubWindow;
|
2016-06-27 14:00:19 +02:00
|
|
|
|
2016-06-24 15:10:18 +02:00
|
|
|
class RiuViewer;
|
2016-06-27 14:00:19 +02:00
|
|
|
|
2016-06-24 15:10:18 +02:00
|
|
|
struct RimMdiWindowGeometry;
|
2017-04-07 18:00:14 +02:00
|
|
|
class RimViewWindow;
|
2016-06-24 15:10:18 +02:00
|
|
|
|
|
|
|
|
namespace caf
|
|
|
|
|
{
|
2016-06-27 14:00:19 +02:00
|
|
|
class PdmUiTreeView;
|
|
|
|
|
class PdmObject;
|
|
|
|
|
class PdmUiPropertyView;
|
|
|
|
|
class PdmUiItem;
|
2017-11-29 12:55:42 +01:00
|
|
|
class PdmUiToolBarEditor;
|
2016-06-24 15:10:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//==================================================================================================
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
//==================================================================================================
|
2018-04-27 06:28:08 +02:00
|
|
|
class RiuPlotMainWindow : public RiuMainWindowBase
|
2016-06-24 15:10:18 +02:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2018-04-27 06:28:08 +02:00
|
|
|
RiuPlotMainWindow();
|
2016-06-24 15:10:18 +02:00
|
|
|
|
2018-02-27 11:23:43 +01:00
|
|
|
QString mainWindowName() override;
|
2016-06-24 15:53:04 +02:00
|
|
|
|
2016-11-03 09:59:41 +01:00
|
|
|
void initializeGuiNewProjectLoaded();
|
|
|
|
|
void cleanupGuiBeforeProjectClose();
|
2017-09-27 14:35:12 +02:00
|
|
|
void cleanUpTemporaryWidgets();
|
2016-06-24 15:10:18 +02:00
|
|
|
|
2017-01-17 13:06:57 +01:00
|
|
|
void removeViewer( QWidget* viewer ) override;
|
|
|
|
|
void addViewer(QWidget* viewer, const RimMdiWindowGeometry& windowsGeometry) override;
|
|
|
|
|
void setActiveViewer(QWidget* subWindow) override;
|
2016-06-24 15:10:18 +02:00
|
|
|
|
2016-11-03 09:59:41 +01:00
|
|
|
void hideAllDockWindows();
|
2016-06-24 15:10:18 +02:00
|
|
|
|
2016-11-03 09:59:41 +01:00
|
|
|
void setDefaultWindowSize();
|
2016-06-24 15:10:18 +02:00
|
|
|
|
|
|
|
|
|
2017-01-17 13:06:57 +01:00
|
|
|
RimMdiWindowGeometry windowGeometryForViewer(QWidget* viewer) override;
|
2016-06-24 15:10:18 +02:00
|
|
|
|
2016-11-03 09:59:41 +01:00
|
|
|
void tileWindows();
|
|
|
|
|
bool isAnyMdiSubWindowVisible();
|
|
|
|
|
QMdiSubWindow* findMdiSubWindow(QWidget* viewer);
|
2018-03-12 11:12:39 +01:00
|
|
|
QList<QMdiSubWindow*> subWindowList(QMdiArea::WindowOrder order);
|
2016-06-24 15:10:18 +02:00
|
|
|
|
2018-07-03 12:54:51 +02:00
|
|
|
void setWidthOfMdiWindow(QWidget* mdiWindowWidget, int newWidth);
|
2017-03-15 20:15:04 +01:00
|
|
|
void addToTemporaryWidgets(QWidget* widget);
|
|
|
|
|
|
2018-09-10 09:55:07 +02:00
|
|
|
void updateWellLogPlotToolBar();
|
2017-12-01 15:15:43 +01:00
|
|
|
void updateSummaryPlotToolBar();
|
|
|
|
|
|
2016-06-24 15:10:18 +02:00
|
|
|
protected:
|
2018-02-27 11:23:43 +01:00
|
|
|
void closeEvent(QCloseEvent* event) override;
|
2016-06-24 15:10:18 +02:00
|
|
|
|
|
|
|
|
private:
|
2016-11-03 09:59:41 +01:00
|
|
|
void setPdmRoot(caf::PdmObject* pdmRoot);
|
2016-06-24 15:10:18 +02:00
|
|
|
|
2016-11-03 09:59:41 +01:00
|
|
|
void createMenus();
|
|
|
|
|
void createToolBars();
|
|
|
|
|
void createDockPanels();
|
2016-06-24 15:10:18 +02:00
|
|
|
|
2016-11-03 09:59:41 +01:00
|
|
|
void restoreTreeViewState();
|
2016-06-24 15:10:18 +02:00
|
|
|
|
2016-11-03 09:59:41 +01:00
|
|
|
void refreshToolbars();
|
2016-06-24 15:10:18 +02:00
|
|
|
|
2016-11-03 09:59:41 +01:00
|
|
|
static QStringList toolbarCommandIds(const QString& toolbarName = "");
|
2016-06-24 15:10:18 +02:00
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
|
|
|
|
|
friend class RiuMdiSubWindow;
|
|
|
|
|
|
2016-11-03 09:59:41 +01:00
|
|
|
void slotBuildWindowActions();
|
2016-06-24 15:10:18 +02:00
|
|
|
|
2016-11-03 09:59:41 +01:00
|
|
|
void slotSubWindowActivated(QMdiSubWindow* subWindow);
|
2016-06-24 15:10:18 +02:00
|
|
|
|
2016-11-03 09:59:41 +01:00
|
|
|
void selectedObjectsChanged();
|
|
|
|
|
void customMenuRequested(const QPoint& pos);
|
2016-06-27 14:00:19 +02:00
|
|
|
|
2016-06-24 15:10:18 +02:00
|
|
|
private:
|
2016-11-03 09:59:41 +01:00
|
|
|
QByteArray m_initialDockAndToolbarLayout; // Initial dock window and toolbar layout, used to reset GUI
|
|
|
|
|
|
|
|
|
|
QMdiArea* m_mdiArea;
|
2018-01-25 14:53:51 +01:00
|
|
|
caf::PdmPointer<RimViewWindow> m_activePlotViewWindow;
|
2017-04-07 18:00:14 +02:00
|
|
|
|
2016-11-03 09:59:41 +01:00
|
|
|
QMenu* m_windowMenu;
|
|
|
|
|
|
2018-09-10 09:55:07 +02:00
|
|
|
caf::PdmUiToolBarEditor* m_wellLogPlotToolBarEditor;
|
2017-12-01 13:55:36 +01:00
|
|
|
caf::PdmUiToolBarEditor* m_summaryPlotToolBarEditor;
|
2016-10-04 09:29:45 +02:00
|
|
|
std::unique_ptr<caf::PdmUiDragDropInterface> m_dragDropInterface;
|
2016-06-24 15:10:18 +02:00
|
|
|
|
|
|
|
|
caf::PdmUiPropertyView* m_pdmUiPropertyView;
|
|
|
|
|
|
|
|
|
|
bool m_blockSlotSubWindowActivated;
|
2017-03-15 20:15:04 +01:00
|
|
|
|
|
|
|
|
std::vector<QWidget*> m_temporaryWidgets;
|
2016-06-24 15:10:18 +02:00
|
|
|
};
|