mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-26 07:00:17 -05:00
The MDI to dock widget refactoring renamed the PDM class RimMdiWindowController to RimDockWindowController, and with it the class keyword written to the project file. Previous versions of ResInsight have no factory entry for DockWindowController, so the window controller of a plot is never created and the plot is silently invisible when the project file is opened by such a version. Keep DockWindowController as the keyword written for the window controller in use, and write the main window id a second time using the old keyword. RimViewWindow now has two child fields, the previous keyword WindowController holds the compatibility object and the new keyword DockWindow holds the window controller in use. Previous versions read the compatibility section and ignore the unknown DockWindow field, current versions read both and keep them in sync in dockInWindow(). RimMdiWindowController_OBSOLETE owns the keyword MdiWindowController and is derived from RimDockWindowController, so project files written by intermediate development versions using DockWindowController in the compatibility section are read into the same field without a type mismatch. RimDockWindowController::initAfterRead() restores the window controller in use from the compatibility section, covering both file layouts. The dropped geometry fields are harmless, RimMdiWindowGeometry::isValid() returns false and the previous version falls back to a default subwindow size, which is the same path the 3D views already take.
38 lines
1.7 KiB
C++
38 lines
1.7 KiB
C++
/////////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// Copyright (C) 2026 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 "RimDockWindowController.h"
|
|
|
|
//==================================================================================================
|
|
/// Compatibility object used to make project files readable by ResInsight 2026.06 and older.
|
|
///
|
|
/// These versions create the window controller for a view window from the class keyword
|
|
/// "MdiWindowController". Without a section using this keyword, plot windows are never made visible
|
|
/// when the project file is opened by an older version.
|
|
///
|
|
/// The object adds no behavior, it is only used to write the main window id using the old class
|
|
/// keyword. It is stored in RimViewWindow::m_legacyWindowController, and is kept in sync with the
|
|
/// window controller in use. Can be removed after 2-3 major releases.
|
|
//==================================================================================================
|
|
class RimMdiWindowController_OBSOLETE : public RimDockWindowController
|
|
{
|
|
CAF_PDM_HEADER_INIT;
|
|
};
|