Remove last traces of MDI

This commit is contained in:
Jon Jenssen authored and JJ committed 2026-06-17 13:55:32 +02:00
1 parent 967975828c
commit a1fe3739d1
27 files changed
+27 -251

No files matched your search

@@ -862,7 +862,8 @@ RiaApplication::ApplicationStatus RiaGuiApplication::handleArguments( gsl::not_n
if ( snapshotHeight > -1 && snapshotWidth > -1 )
{
RiuMainWindowTools::setWindowSizeOnWidgetsInMdiWindows( mainPlotWnd, snapshotWidth, snapshotHeight );
// TODO - handle snapshot view sizes
// RiuMainWindowTools::setWindowSizeOnWidgetsInViewWindows( mainPlotWnd, snapshotWidth, snapshotHeight );
}
processEvents();
@@ -879,7 +880,8 @@ RiaApplication::ApplicationStatus RiaGuiApplication::handleArguments( gsl::not_n
if ( snapshotHeight > -1 && snapshotWidth > -1 )
{
RiuMainWindowTools::setFixedWindowSizeFor3dViews( mainWnd, snapshotWidth, snapshotHeight );
// TODO - handle snapshot view sizes
// RiuMainWindowTools::setFixedWindowSizeFor3dViews( mainWnd, snapshotWidth, snapshotHeight );
}
processEvents();
@@ -556,7 +556,8 @@ void RiaRegressionTestRunner::setDefaultSnapshotSizeFor3dViews()
QSize defaultSize = RiaRegressionTestRunner::regressionDefaultImageSize();
RiuMainWindowTools::setFixedWindowSizeFor3dViews( mainWnd, defaultSize.width(), defaultSize.height() );
// TODO - fix snapshot view sizes
// RiuMainWindowTools::setFixedWindowSizeFor3dViews( mainWnd, defaultSize.width(), defaultSize.height() );
}
//--------------------------------------------------------------------------------------------------
@@ -569,7 +570,8 @@ void RiaRegressionTestRunner::setDefaultSnapshotSizeForPlotWindows()
QSize defaultSize = RiaRegressionTestRunner::regressionDefaultImageSize();
RiuMainWindowTools::setWindowSizeOnWidgetsInMdiWindows( plotMainWindow, defaultSize.width(), defaultSize.height() );
// TODO - fix snapshot view sizes
// RiuMainWindowTools::setWindowSizeOnWidgetsInViewWindows( plotMainWindow, defaultSize.width(), defaultSize.height() );
}
//--------------------------------------------------------------------------------------------------
@@ -37,7 +37,6 @@
#include <QDebug>
#include <QDir>
#include <QFileInfo>
#include <QMdiSubWindow>
CAF_CMD_SOURCE_INIT( RicSnapshotAllPlotsToFileFeature, "RicSnapshotAllPlotsToFileFeature" );
@@ -101,9 +100,6 @@ void RicSnapshotAllPlotsToFileFeature::exportSnapshotOfPlotsIntoFolder( const QS
if ( activateWidget )
{
// If the active MDI widget is maximized, all widgets will be maximized in the MDI area before taking
// snapshots
RiuPlotMainWindowTools::selectAsCurrentItem( viewWindow );
QApplication::processEvents();
}
@@ -47,7 +47,6 @@
#include <QDir>
#include <QFileInfo>
#include <QImage>
#include <QMdiSubWindow>
CAF_CMD_SOURCE_INIT( RicSnapshotAllViewsToFileFeature, "RicSnapshotAllViewsToFileFeature" );
@@ -33,7 +33,6 @@
#include <QClipboard>
#include <QDebug>
#include <QFileInfo>
#include <QMdiSubWindow>
CAF_CMD_SOURCE_INIT( RicSnapshotViewToClipboardFeature, "RicSnapshotViewToClipboardFeature" );
@@ -40,7 +40,6 @@
#include <QClipboard>
#include <QDebug>
#include <QFileInfo>
#include <QMdiSubWindow>
#include <QPageLayout>
#include <QPdfWriter>
@@ -41,7 +41,6 @@ set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RicDeleteSubPlotCtxFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicToggleYAxisLinkingFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicToggleXAxisLinkingFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicOpenSummaryPlotEditorFromMdiAreaFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicNewSummaryTableFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicDuplicateSummaryTableFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicCreateDeclineCurvesFeature.cpp
@@ -1,29 +0,0 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2023- Equinor 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.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RicOpenSummaryPlotEditorFromMdiAreaFeature.h"
CAF_CMD_SOURCE_INIT( RicOpenSummaryPlotEditorFromMdiAreaFeature, "RicOpenSummaryPlotEditorFromMdiAreaFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicOpenSummaryPlotEditorFromMdiAreaFeature::isCommandEnabled() const
{
return true;
}
@@ -1,32 +0,0 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2023- Equinor 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
#include "RicOpenSummaryPlotEditorFeature.h"
//==================================================================================================
///
//==================================================================================================
class RicOpenSummaryPlotEditorFromMdiAreaFeature : public RicOpenSummaryPlotEditorFeature
{
CAF_CMD_HEADER_INIT;
protected:
bool isCommandEnabled() const override;
};
@@ -28,7 +28,6 @@
#include "RiuPlotMainWindow.h"
#include <QAction>
#include <QMdiSubWindow>
CAF_CMD_SOURCE_INIT( RicViewZoomAllFeature, "RicViewZoomAllFeature" );
@@ -43,25 +42,17 @@ void RicViewZoomAllFeature::onActionTriggered( bool isChecked )
if ( dynamic_cast<RiuMainWindow*>( topLevelWidget ) )
{
RimViewWindow* viewWindow = RiaGuiApplication::instance()->activeReservoirView();
if ( viewWindow )
if ( auto viewWindow = RiaGuiApplication::instance()->activeReservoirView() )
{
viewWindow->zoomAll();
}
}
else if ( dynamic_cast<RiuPlotMainWindow*>( topLevelWidget ) )
else if ( auto plotMainWin = dynamic_cast<RiuPlotMainWindow*>( topLevelWidget ) )
{
RiuPlotMainWindow* mainPlotWindow = dynamic_cast<RiuPlotMainWindow*>( topLevelWidget );
// QList<QMdiSubWindow*> subwindows = mainPlotWindow->subWindowList( QMdiArea::StackingOrder );
// if ( !subwindows.empty() )
//{
// RimViewWindow* viewWindow = RiuInterfaceToViewWindow::viewWindowFromWidget( subwindows.back()->widget() );
// if ( viewWindow )
// {
// viewWindow->zoomAll();
// }
//}
if ( auto activePlotView = plotMainWin->activePlotView() )
{
activePlotView->zoomAll();
}
}
}
@@ -66,7 +66,7 @@ void RimFlowPlotCollection::deleteAllPlots()
{
if ( m_defaultWellAllocPlot )
{
m_defaultWellAllocPlot->removeFromMdiAreaAndDeleteViewWidget();
m_defaultWellAllocPlot->removeFromDockAreaAndDeleteViewWidget();
delete m_defaultWellAllocPlot();
}
delete m_defaultWellConnectivityTable;
@@ -737,7 +737,7 @@ QString RimWellAllocationPlot::wellName() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellAllocationPlot::removeFromMdiAreaAndDeleteViewWidget()
void RimWellAllocationPlot::removeFromDockAreaAndDeleteViewWidget()
{
removeWindowFromDock();
deleteViewWidget();
@@ -87,7 +87,7 @@ public:
QString wellName() const;
void removeFromMdiAreaAndDeleteViewWidget();
void removeFromDockAreaAndDeleteViewWidget();
void showPlotLegend( bool doShow );
@@ -27,7 +27,6 @@
class RiuMainWindowBase;
class RimViewWindow;
struct RimMdiWindowGeometry;
//==================================================================================================
///
@@ -38,7 +38,6 @@
#include "cafFactory.h"
#include <QtNetwork>
#include <QtWidgets/QMdiSubWindow>
#include <cstdlib>
@@ -149,22 +148,6 @@ RimEclipseCase* RiaSocketServer::findReservoir( int caseId )
{
return eclipseView->eclipseCase();
}
//// If the active mdi window is different from an Eclipse view, search through available mdi windows to find the
//// last activated Eclipse view. The sub windows are returned with the most recent activated window at the back.
// QList<QMdiSubWindow*> subWindows = RiuMainWindow::instance()->subWindowList( QMdiArea::ActivationHistoryOrder );
// for ( int i = subWindows.size() - 1; i > -1; i-- )
//{
// RiuViewer* viewer = subWindows[i]->widget()->findChild<RiuViewer*>();
// if ( viewer )
// {
// RimEclipseView* riv = dynamic_cast<RimEclipseView*>( viewer->ownerReservoirView() );
// if ( riv )
// {
// return riv->eclipseCase();
// }
// }
// }
}
else
{
@@ -100,7 +100,6 @@
#include <QDir>
#include <QLabel>
#include <QLayout>
#include <QMdiSubWindow>
#include <QMenuBar>
#include <QMimeData>
#include <QSpinBox>
@@ -234,8 +233,6 @@ void RiuMainWindow::initializeGuiNewProjectLoaded()
setPdmRoot( RimProject::current() );
restoreTreeViewState();
// m_mdiArea->applyTiling();
slotRefreshFileActions();
slotRefreshUndoRedoActions();
slotRefreshViewActions();
@@ -254,16 +251,6 @@ void RiuMainWindow::initializeGuiNewProjectLoaded()
statusBar()->showMessage( "Ready ...", 5000 );
}
// QMdiSubWindow* activeSubWindow = m_mdiArea->activeSubWindow();
// if ( activeSubWindow )
//{
// auto w = findViewWindowFromSubWindow( activeSubWindow );
// if ( w && w->mdiWindowGeometry().isMaximized )
// {
// activeSubWindow->showMaximized();
// }
// }
// Sync selections with property editor.
// Go backwards as the most "important" tree view is first in the list
// and we want that to use the property editor in case multiple tree views are visible
@@ -336,7 +323,10 @@ void RiuMainWindow::cleanupGuiCaseClose()
//--------------------------------------------------------------------------------------------------
void RiuMainWindow::cleanupGuiBeforeProjectClose()
{
// m_mdiArea->closeAllSubWindows();
for ( auto v : viewWindows() )
{
v->removeWindowFromDock();
}
setPdmRoot( nullptr );
@@ -242,7 +242,6 @@ private slots:
// Windows slots
void slotBuildWindowActions();
// void slotSubWindowActivated( QMdiSubWindow* subWindow );
void selectedObjectsChanged();
void customMenuRequested( const QPoint& pos );
@@ -36,7 +36,6 @@
#include "cafPdmUiTreeView.h"
#include <QMainWindow>
#include <QMdiSubWindow>
#include <QModelIndex>
// Dark title bar is taken from
@@ -167,68 +166,6 @@ void RiuMainWindowTools::collapseSiblings( const caf::PdmUiItem* sourceUiItem )
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuMainWindowTools::setWindowSizeOnWidgetsInMdiWindows( RiuMainWindowBase* mainWindow, int width, int height )
{
if ( !mainWindow ) return;
auto widgets = mainWindow->findChildren<QMdiSubWindow*>();
for ( auto w : widgets )
{
if ( !w ) continue;
w->showNormal();
}
// Process events before resize to make sure the widget is ready for resize
// If not, a maximized window with not get the prescribed window size
QApplication::processEvents();
for ( auto w : widgets )
{
if ( !w ) continue;
auto viewWindow = RiuInterfaceToViewWindow::viewWindowFromWidget( w->widget() );
if ( viewWindow && viewWindow->viewWidget() )
{
QWidget* viewWidget = viewWindow->viewWidget();
viewWidget->resize( width, height );
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuMainWindowTools::setFixedWindowSizeFor3dViews( RiuMainWindowBase* mainWindow, int width, int height )
{
if ( !mainWindow ) return;
RimProject* proj = RimProject::current();
if ( !proj ) return;
for ( Rim3dView* riv : proj->allViews() )
{
if ( riv && riv->viewer() )
{
//// Make sure all views are maximized for snapshotting
// QMdiSubWindow* subWnd = mainWindow->findMdiSubWindow( riv->viewer()->layoutWidget() );
// if ( subWnd )
//{
// subWnd->showMaximized();
// }
// This size is set to match the regression test reference images
QSize windowSize( width, height );
riv->viewer()->setFixedSize( windowSize );
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -23,7 +23,6 @@ namespace caf
class PdmUiItem;
} // namespace caf
class RiuMainWindowBase;
class QWidget;
//--------------------------------------------------------------------------------------------------
///
@@ -33,7 +32,5 @@ class RiuMainWindowTools
public:
static void collapseSiblings( const caf::PdmUiItem* uiItem );
static void setWindowSizeOnWidgetsInMdiWindows( RiuMainWindowBase* mainWindow, int width, int height );
static void setFixedWindowSizeFor3dViews( RiuMainWindowBase* mainWindow, int width, int height );
static void setDarkTitleBarWindows( QWidget* widget );
};
@@ -210,8 +210,8 @@ RimViewWindow* RiuMatrixPlotWidget::ownerViewWindow() const
//--------------------------------------------------------------------------------------------------
void RiuMatrixPlotWidget::contextMenuEvent( QContextMenuEvent* )
{
// Added empty override to preventing menu for Mdi Area
// I.e.: RiuContextMenuLauncher for RiuPlotMainWindow (mdi area)
// Added empty override to preventing menu for central area
// I.e.: RiuContextMenuLauncher for RiuPlotMainWindow
return;
}
@@ -44,7 +44,6 @@
#include <QFocusEvent>
#include <QFontMetrics>
#include <QHBoxLayout>
#include <QMdiSubWindow>
#include <QMenu>
#include <QPagedPaintDevice>
#include <QPainter>
@@ -59,7 +59,6 @@
#include <QFontMetrics>
#include <QGraphicsDropShadowEffect>
#include <QHBoxLayout>
#include <QMdiSubWindow>
#include <QMenu>
#include <QPainter>
#include <QScrollBar>
@@ -76,7 +76,6 @@
#include <QCloseEvent>
#include <QLayout>
#include <QMdiSubWindow>
#include <QMenuBar>
#include <QMessageBox>
#include <QSettings>
@@ -236,7 +235,10 @@ void RiuPlotMainWindow::initializeGuiNewProjectLoaded()
//--------------------------------------------------------------------------------------------------
void RiuPlotMainWindow::cleanupGuiBeforeProjectClose()
{
// m_mdiArea->closeAllSubWindows();
for ( auto v : viewWindows() )
{
v->removeWindowFromDock();
}
setPdmRoot( nullptr );
@@ -807,52 +809,6 @@ void RiuPlotMainWindow::setPdmRoot( caf::PdmObject* pdmRoot )
}
}
////--------------------------------------------------------------------------------------------------
/////
////--------------------------------------------------------------------------------------------------
// void RiuPlotMainWindow::slotSubWindowActivated( QMdiSubWindow* subWindow )
//{
// if ( isBlockingSubWindowActivatedSignal() ) return;
//
// RimViewWindow* activatedView = findViewWindowFromSubWindow( subWindow );
//
// if ( !activatedView ) return;
// m_activePlotViewWindow = activatedView;
//
// if ( !isBlockingViewSelectionOnSubWindowActivated() )
// {
// caf::PdmUiTreeView* projectTree = getTreeViewWithItem( activatedView );
// if ( projectTree )
// {
// std::vector<caf::PdmUiItem*> currentSelection;
// projectTree->selectedUiItems( currentSelection );
// bool childSelected = false;
// for ( caf::PdmUiItem* uiItem : currentSelection )
// {
// caf::PdmObject* pdmObject = dynamic_cast<caf::PdmObject*>( uiItem );
// if ( pdmObject )
// {
// std::vector<RimViewWindow*> ancestralViews = pdmObject->allAncestorsOrThisOfType<RimViewWindow>();
// for ( auto ancestralView : ancestralViews )
// {
// if ( ancestralView == activatedView )
// {
// childSelected = true;
// }
// }
// }
// }
// if ( !childSelected )
// {
// selectAsCurrentItem( activatedView );
// }
// }
// }
//
// updateWellLogPlotToolBar();
// updateMultiPlotToolBar();
// }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -22,15 +22,11 @@
#include "cafPdmPointer.h"
#include <QMdiArea>
#include <QPointer>
#include <QString>
#include <memory>
struct RimMdiWindowGeometry;
class QMdiSubWindow;
class RiuViewer;
class RimViewWindow;
class RicSummaryPlotEditorDialog;
@@ -119,8 +115,6 @@ private slots:
void slotBuildWindowActions();
// void slotSubWindowActivated( QMdiSubWindow* subWindow );
void selectedObjectsChanged( caf::PdmUiTreeView* projectTree, caf::PdmUiPropertyView* propertyView );
void customMenuRequested( const QPoint& pos );
@@ -107,7 +107,6 @@ RiuQwtPlotWidget::RiuQwtPlotWidget( RimPlot* plotDefinition, QWidget* parent )
SLOT( onPlotItemSelected( std::shared_ptr<RiuPlotItem>, bool, int ) ) );
connect( this, SIGNAL( onKeyPressEvent( QKeyEvent* ) ), plotDefinition, SLOT( onKeyPressEvent( QKeyEvent* ) ) );
connect( this, SIGNAL( onWheelEvent( QWheelEvent* ) ), plotDefinition, SLOT( onWheelEvent( QWheelEvent* ) ) );
connect( this, SIGNAL( onMousePressEvent( QMouseEvent* ) ), plotDefinition, SLOT( onMousePressEvent( QMouseEvent* ) ) );
connect( this, SIGNAL( destroyed() ), plotDefinition, SLOT( onViewerDestroyed() ) );
}
@@ -39,7 +39,6 @@
#include <QFocusEvent>
#include <QHBoxLayout>
#include <QMdiSubWindow>
#include <QMenu>
#include <cmath>
@@ -27,7 +27,6 @@
class RimCase;
class RimViewLinker;
struct RimMdiWindowGeometry;
class RimViewController;
namespace caf