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