mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Get rid of "ghost" windows on startup. (#9171)
* Get rid of "ghost" windows on startup. Removes hide all docking windows feature for now, to be replaced by a new implementation. Will probably break some tests due to this.
This commit is contained in:
parent
63b26ebf2d
commit
a3c561b7e5
@ -425,8 +425,7 @@ void RiaGuiApplication::initialize()
|
||||
// Create main windows
|
||||
// The plot window is created to be able to set expanded state on created objects, but hidden by default
|
||||
getOrCreateAndShowMainWindow();
|
||||
RiuPlotMainWindow* plotMainWindow = getOrCreateMainPlotWindow();
|
||||
plotMainWindow->hideAllDockWidgets();
|
||||
getOrCreateMainPlotWindow();
|
||||
|
||||
RiuGuiTheme::updateGuiTheme( m_preferences->guiTheme() );
|
||||
|
||||
@ -968,7 +967,6 @@ void RiaGuiApplication::createMainWindow()
|
||||
m_mainWindow->setWindowTitle( "ResInsight " + platform );
|
||||
m_mainWindow->setDefaultWindowSize();
|
||||
m_mainWindow->setDefaultToolbarVisibility();
|
||||
m_mainWindow->storeDefaultDockWidgetVisibilitiesIfRequired();
|
||||
m_mainWindow->loadWinGeoAndDockToolBarLayout();
|
||||
m_mainWindow->showWindow();
|
||||
}
|
||||
@ -996,18 +994,12 @@ void RiaGuiApplication::createMainPlotWindow()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuPlotMainWindow* RiaGuiApplication::getOrCreateAndShowMainPlotWindow()
|
||||
{
|
||||
bool triggerReloadOfDockWidgetVisibilities = false;
|
||||
|
||||
if ( !m_mainPlotWindow )
|
||||
{
|
||||
createMainPlotWindow();
|
||||
m_mainPlotWindow->initializeGuiNewProjectLoaded();
|
||||
loadAndUpdatePlotData();
|
||||
}
|
||||
else
|
||||
{
|
||||
triggerReloadOfDockWidgetVisibilities = !m_mainPlotWindow->isVisible();
|
||||
}
|
||||
|
||||
if ( m_mainPlotWindow->isMinimized() )
|
||||
{
|
||||
@ -1022,11 +1014,6 @@ RiuPlotMainWindow* RiaGuiApplication::getOrCreateAndShowMainPlotWindow()
|
||||
m_mainPlotWindow->raise();
|
||||
m_mainPlotWindow->activateWindow();
|
||||
|
||||
if ( triggerReloadOfDockWidgetVisibilities )
|
||||
{
|
||||
m_mainPlotWindow->restoreDockWidgetVisibilities();
|
||||
}
|
||||
|
||||
return m_mainPlotWindow.get();
|
||||
}
|
||||
|
||||
@ -1252,8 +1239,6 @@ void RiaGuiApplication::onProjectOpened()
|
||||
m_mainPlotWindow->show();
|
||||
m_mainPlotWindow->raise();
|
||||
}
|
||||
|
||||
m_mainPlotWindow->restoreDockWidgetVisibilities();
|
||||
}
|
||||
else if ( mainPlotWindow() )
|
||||
{
|
||||
@ -1640,8 +1625,6 @@ void RiaGuiApplication::runMultiCaseSnapshots( const QString& templateProj
|
||||
{
|
||||
if ( !m_mainWindow ) return;
|
||||
|
||||
m_mainWindow->hideAllDockWidgets();
|
||||
|
||||
const size_t numGridFiles = gridFileNames.size();
|
||||
for ( size_t i = 0; i < numGridFiles; i++ )
|
||||
{
|
||||
@ -1656,8 +1639,6 @@ void RiaGuiApplication::runMultiCaseSnapshots( const QString& templateProj
|
||||
RicSnapshotAllViewsToFileFeature::exportSnapshotOfViewsIntoFolder( snapshotFolderName );
|
||||
}
|
||||
}
|
||||
|
||||
m_mainWindow->loadWinGeoAndDockToolBarLayout();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -657,7 +657,6 @@ void RiaRegressionTestRunner::executeRegressionTests( const QString& regressionT
|
||||
RiuMainWindow* mainWnd = RiuMainWindow::instance();
|
||||
if ( mainWnd )
|
||||
{
|
||||
mainWnd->hideAllDockWidgets();
|
||||
mainWnd->statusBar()->close();
|
||||
|
||||
mainWnd->setDefaultWindowSize();
|
||||
@ -667,8 +666,6 @@ void RiaRegressionTestRunner::executeRegressionTests( const QString& regressionT
|
||||
m_rootPath = regressionTestPath;
|
||||
m_testFilter = testFilter;
|
||||
runRegressionTest();
|
||||
|
||||
mainWnd->loadWinGeoAndDockToolBarLayout();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -82,7 +82,6 @@ caf::PdmScriptResponse RicfExportSnapshots::execute()
|
||||
|
||||
RiuMainWindow* mainWnd = RiuMainWindow::instance();
|
||||
CVF_ASSERT( mainWnd );
|
||||
mainWnd->hideAllDockWidgets();
|
||||
RiaGuiApplication::instance()->processEvents();
|
||||
|
||||
QString absolutePathToSnapshotDir =
|
||||
@ -134,7 +133,6 @@ caf::PdmScriptResponse RicfExportSnapshots::execute()
|
||||
fileSuffix );
|
||||
}
|
||||
|
||||
mainWnd->loadWinGeoAndDockToolBarLayout();
|
||||
RiaGuiApplication::instance()->processEvents();
|
||||
|
||||
return caf::PdmScriptResponse();
|
||||
|
@ -15,8 +15,6 @@ set(SOURCE_GROUP_HEADER_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicLaunchRegressionTestsFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicRunCommandFileFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicShowMemoryCleanupDialogFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicDefaultDockConfigEclipseFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicDefaultDockConfigGeoMechFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicExportObjectAndFieldKeywordsFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicSaveProjectNoGlobalPathsFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicShowClassNamesFeature.h
|
||||
@ -40,8 +38,6 @@ set(SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicLaunchRegressionTestsFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicRunCommandFileFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicShowMemoryCleanupDialogFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicDefaultDockConfigEclipseFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicDefaultDockConfigGeoMechFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicExportObjectAndFieldKeywordsFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicSaveProjectNoGlobalPathsFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicShowClassNamesFeature.cpp
|
||||
|
@ -1,54 +0,0 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2019- 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 "RicDefaultDockConfigEclipseFeature.h"
|
||||
|
||||
#include "RiuDockWidgetTools.h"
|
||||
|
||||
#include <QAction>
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicDefaultDockConfigEclipseFeature, "RicDefaultDockConfigEclipseFeature" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicDefaultDockConfigEclipseFeature::isCommandEnabled()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicDefaultDockConfigEclipseFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
RiuDockWidgetTools::setVisibleDockingWindowsForEclipse();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicDefaultDockConfigEclipseFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
QString menuText = "Default Window Visibility";
|
||||
#ifdef USE_ODB_API
|
||||
menuText += " (Eclipse)";
|
||||
#endif
|
||||
|
||||
actionToSetup->setText( menuText );
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2019- 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 "cafCmdFeature.h"
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicDefaultDockConfigEclipseFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
protected:
|
||||
bool isCommandEnabled() override;
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
};
|
@ -1,49 +0,0 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2019- 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 "RicDefaultDockConfigGeoMechFeature.h"
|
||||
|
||||
#include "RiuDockWidgetTools.h"
|
||||
|
||||
#include <QAction>
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicDefaultDockConfigGeoMechFeature, "RicDefaultDockConfigGeoMechFeature" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicDefaultDockConfigGeoMechFeature::isCommandEnabled()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicDefaultDockConfigGeoMechFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
RiuDockWidgetTools::setVisibleDockingWindowsForGeoMech();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicDefaultDockConfigGeoMechFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setText( "Default Window Visibility (Geo Mech)" );
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2019- 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 "cafCmdFeature.h"
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicDefaultDockConfigGeoMechFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
protected:
|
||||
bool isCommandEnabled() override;
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
};
|
@ -46,8 +46,6 @@ void RicShowMainWindowFeature::showMainWindow()
|
||||
}
|
||||
|
||||
mainWnd->raise();
|
||||
|
||||
mainWnd->restoreDockWidgetVisibilities();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -198,50 +198,6 @@ QString RiuDockWidgetTools::messagesName()
|
||||
return "dockMessages";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QMap<QString, QVariant> RiuDockWidgetTools::widgetVisibilitiesForEclipse()
|
||||
{
|
||||
QMap<QString, QVariant> widgetVisibility;
|
||||
|
||||
widgetVisibility[RiuDockWidgetTools::projectTreeName()] = true;
|
||||
widgetVisibility[RiuDockWidgetTools::propertyEditorName()] = true;
|
||||
widgetVisibility[RiuDockWidgetTools::resultInfoName()] = true;
|
||||
widgetVisibility[RiuDockWidgetTools::processMonitorName()] = true;
|
||||
widgetVisibility[RiuDockWidgetTools::resultPlotName()] = true;
|
||||
widgetVisibility[RiuDockWidgetTools::relPermPlotName()] = true;
|
||||
widgetVisibility[RiuDockWidgetTools::pvtPlotName()] = true;
|
||||
widgetVisibility[RiuDockWidgetTools::messagesName()] = true;
|
||||
widgetVisibility[RiuDockWidgetTools::undoStackName()] = false;
|
||||
|
||||
widgetVisibility[RiuDockWidgetTools::mohrsCirclePlotName()] = false;
|
||||
|
||||
return widgetVisibility;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QMap<QString, QVariant> RiuDockWidgetTools::widgetVisibilitiesForGeoMech()
|
||||
{
|
||||
QMap<QString, QVariant> widgetVisibility;
|
||||
|
||||
widgetVisibility[RiuDockWidgetTools::projectTreeName()] = true;
|
||||
widgetVisibility[RiuDockWidgetTools::propertyEditorName()] = true;
|
||||
widgetVisibility[RiuDockWidgetTools::resultInfoName()] = true;
|
||||
widgetVisibility[RiuDockWidgetTools::processMonitorName()] = true;
|
||||
widgetVisibility[RiuDockWidgetTools::resultPlotName()] = true;
|
||||
widgetVisibility[RiuDockWidgetTools::relPermPlotName()] = false;
|
||||
widgetVisibility[RiuDockWidgetTools::pvtPlotName()] = false;
|
||||
widgetVisibility[RiuDockWidgetTools::messagesName()] = true;
|
||||
widgetVisibility[RiuDockWidgetTools::undoStackName()] = false;
|
||||
|
||||
widgetVisibility[RiuDockWidgetTools::mohrsCirclePlotName()] = true;
|
||||
|
||||
return widgetVisibility;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -267,138 +223,12 @@ QAction* RiuDockWidgetTools::toggleActionForWidget( const ads::CDockManager* doc
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuDockWidgetTools::setVisibleDockingWindowsForEclipse()
|
||||
void RiuDockWidgetTools::showDockWidget( const ads::CDockManager* dockManager, const QString& dockWidgetName )
|
||||
{
|
||||
if ( !RiuMainWindow::instance() ) return;
|
||||
|
||||
RiuMainWindow* mainWindow = RiuMainWindow::instance();
|
||||
auto widgetVisibilities = widgetVisibilitiesForEclipse();
|
||||
|
||||
applyDockWidgetVisibilities( mainWindow->dockManager(), widgetVisibilities );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuDockWidgetTools::setVisibleDockingWindowsForGeoMech()
|
||||
{
|
||||
if ( !RiuMainWindow::instance() ) return;
|
||||
|
||||
RiuMainWindow* mainWindow = RiuMainWindow::instance();
|
||||
auto widgetVisibilities = widgetVisibilitiesForGeoMech();
|
||||
|
||||
applyDockWidgetVisibilities( mainWindow->dockManager(), widgetVisibilities );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuDockWidgetTools::setDockWidgetVisibility( const ads::CDockManager* dockManager,
|
||||
const QString& dockWidgetName,
|
||||
bool isVisible )
|
||||
{
|
||||
ads::CDockWidget* dockWidget = findDockWidget( dockManager, dockWidgetName );
|
||||
if ( dockWidget )
|
||||
auto dw = findDockWidget( dockManager, dockWidgetName );
|
||||
if ( dw )
|
||||
{
|
||||
dockWidget->setVisible( isVisible );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QVariant RiuDockWidgetTools::dockWidgetsVisibility( const ads::CDockManager* dockManager )
|
||||
{
|
||||
QMap<QString, QVariant> widgetVisibility;
|
||||
|
||||
auto dockWidgets = dockManager->dockWidgetsMap();
|
||||
|
||||
for ( auto dock : dockWidgets )
|
||||
{
|
||||
if ( dock )
|
||||
{
|
||||
bool isVisible = dock->isVisible();
|
||||
widgetVisibility[dock->objectName()] = isVisible;
|
||||
}
|
||||
}
|
||||
|
||||
return QVariant( widgetVisibility );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QVariant RiuDockWidgetTools::defaultDockWidgetVisibilities()
|
||||
{
|
||||
return QVariant( widgetVisibilitiesForEclipse() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Qwt widgets in non-visible dock widgets (tabbed dock windows) will on some systems enter an
|
||||
/// eternal update loop. This is seen on both Windows and Linux.
|
||||
/// The workaround is to hide all dock widgets, and then set visible the docking windows seen to
|
||||
/// trigger the unwanted behavior
|
||||
///
|
||||
/// https://github.com/OPM/ResInsight/issues/6743
|
||||
/// https://github.com/OPM/ResInsight/issues/6627
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuDockWidgetTools::workaroundForQwtDockWidgets()
|
||||
{
|
||||
if ( !RiuMainWindow::instance() ) return;
|
||||
|
||||
RiuMainWindow* mainWindow = RiuMainWindow::instance();
|
||||
|
||||
auto dockWidgets = mainWindow->dockManager()->dockWidgetsMap();
|
||||
|
||||
for ( auto dock : dockWidgets )
|
||||
{
|
||||
if ( dock ) dock->setVisible( false );
|
||||
}
|
||||
QApplication::processEvents();
|
||||
|
||||
{
|
||||
auto dock = mainWindow->dockManager()->findDockWidget( relPermPlotName() );
|
||||
if ( dock )
|
||||
{
|
||||
dock->setVisible( true );
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
auto dock = mainWindow->dockManager()->findDockWidget( pvtPlotName() );
|
||||
if ( dock )
|
||||
{
|
||||
dock->setVisible( true );
|
||||
}
|
||||
}
|
||||
|
||||
QApplication::processEvents();
|
||||
|
||||
mainWindow->loadWinGeoAndDockToolBarLayout();
|
||||
mainWindow->restoreDockWidgetVisibilities();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuDockWidgetTools::applyDockWidgetVisibilities( const ads::CDockManager* dockManager,
|
||||
const QMap<QString, QVariant>& widgetVisibilities )
|
||||
{
|
||||
auto dockWidgets = dockManager->dockWidgetsMap();
|
||||
|
||||
for ( auto dock : dockWidgets )
|
||||
{
|
||||
if ( dock )
|
||||
{
|
||||
bool isVisible = true;
|
||||
|
||||
auto widgetVisibility = widgetVisibilities.find( dock->objectName() );
|
||||
if ( widgetVisibility != widgetVisibilities.end() )
|
||||
{
|
||||
isVisible = widgetVisibility.value().toBool();
|
||||
}
|
||||
|
||||
dock->setVisible( isVisible );
|
||||
}
|
||||
dw->show();
|
||||
dw->raise();
|
||||
}
|
||||
}
|
||||
|
@ -68,22 +68,7 @@ public:
|
||||
|
||||
static QAction* toggleActionForWidget( const ads::CDockManager* dockManager, const QString& dockWidgetName );
|
||||
|
||||
static QVariant dockWidgetsVisibility( const ads::CDockManager* dockManager );
|
||||
static QVariant defaultDockWidgetVisibilities();
|
||||
static ads::CDockWidget* findDockWidget( const ads::CDockManager* dockManager, const QString& dockWidgetName );
|
||||
|
||||
static void workaroundForQwtDockWidgets();
|
||||
|
||||
static void setVisibleDockingWindowsForEclipse();
|
||||
static void setVisibleDockingWindowsForGeoMech();
|
||||
|
||||
static void
|
||||
setDockWidgetVisibility( const ads::CDockManager* dockManager, const QString& dockWidgetName, bool isVisible );
|
||||
static void applyDockWidgetVisibilities( const ads::CDockManager* dockManager,
|
||||
const QMap<QString, QVariant>& visibilityMap );
|
||||
|
||||
static ads::CDockWidget* findDockWidget( const ads::CDockManager*, const QString& dockWidgetName );
|
||||
|
||||
private:
|
||||
static QMap<QString, QVariant> widgetVisibilitiesForEclipse();
|
||||
static QMap<QString, QVariant> widgetVisibilitiesForGeoMech();
|
||||
static void showDockWidget( const ads::CDockManager* dockManager, const QString& dockWidgetName );
|
||||
};
|
||||
|
@ -163,11 +163,6 @@ RiuMainWindow::RiuMainWindow()
|
||||
m_memoryRefreshTimer = new QTimer( this );
|
||||
connect( m_memoryRefreshTimer, SIGNAL( timeout() ), this, SLOT( updateMemoryUsage() ) );
|
||||
m_memoryRefreshTimer->start( 1000 );
|
||||
|
||||
auto dockTimer = new QTimer( this );
|
||||
dockTimer->setSingleShot( true );
|
||||
connect( dockTimer, SIGNAL( timeout() ), this, SLOT( slotWorkaroundForQwtDockWidgets() ) );
|
||||
dockTimer->start( 1000 );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -316,7 +311,6 @@ void RiuMainWindow::closeEvent( QCloseEvent* event )
|
||||
}
|
||||
}
|
||||
this->saveWinGeoAndDockToolBarLayout();
|
||||
this->hideAllDockWidgets();
|
||||
QMainWindow::closeEvent( event );
|
||||
}
|
||||
|
||||
@ -754,7 +748,7 @@ void RiuMainWindow::createDockPanels()
|
||||
|
||||
for ( int i = 0; i < nTreeViews; i++ )
|
||||
{
|
||||
ads::CDockWidget* dockWidget = new ads::CDockWidget( treeViewTitles[i], this );
|
||||
ads::CDockWidget* dockWidget = new ads::CDockWidget( treeViewTitles[i], dockManager() );
|
||||
dockWidget->setObjectName( treeViewDockNames[i] );
|
||||
|
||||
caf::PdmUiTreeView* projectTree = projectTreeView( i );
|
||||
@ -795,14 +789,14 @@ void RiuMainWindow::createDockPanels()
|
||||
// undo/redo view
|
||||
if ( m_undoView && RiaPreferences::current()->useUndoRedo() )
|
||||
{
|
||||
ads::CDockWidget* dockWidget = new ads::CDockWidget( "Undo Stack", this );
|
||||
ads::CDockWidget* dockWidget = new ads::CDockWidget( "Undo Stack", dockManager() );
|
||||
dockWidget->setObjectName( RiuDockWidgetTools::undoStackName() );
|
||||
dockWidget->setWidget( m_undoView );
|
||||
rightWidgets.push_back( dockWidget );
|
||||
}
|
||||
|
||||
{
|
||||
ads::CDockWidget* dockWidget = new ads::CDockWidget( "Result Plot", this );
|
||||
ads::CDockWidget* dockWidget = new ads::CDockWidget( "Result Plot", dockManager() );
|
||||
dockWidget->setObjectName( RiuDockWidgetTools::resultPlotName() );
|
||||
m_resultQwtPlot = new RiuResultQwtPlot( dockWidget );
|
||||
dockWidget->setWidget( m_resultQwtPlot );
|
||||
@ -816,7 +810,7 @@ void RiuMainWindow::createDockPanels()
|
||||
dockManager()->centralWidget()->dockAreaWidget() );
|
||||
|
||||
{
|
||||
ads::CDockWidget* dockWidget = new ads::CDockWidget( "Property Editor", this );
|
||||
ads::CDockWidget* dockWidget = new ads::CDockWidget( "Property Editor", dockManager() );
|
||||
dockWidget->setObjectName( RiuDockWidgetTools::propertyEditorName() );
|
||||
|
||||
m_pdmUiPropertyView = new caf::PdmUiPropertyView( dockWidget );
|
||||
@ -826,7 +820,7 @@ void RiuMainWindow::createDockPanels()
|
||||
|
||||
#ifdef USE_ODB_API
|
||||
{
|
||||
ads::CDockWidget* dockWidget = new ads::CDockWidget( "Mohr's Circle Plot", this );
|
||||
ads::CDockWidget* dockWidget = new ads::CDockWidget( "Mohr's Circle Plot", dockManager() );
|
||||
dockWidget->setObjectName( RiuDockWidgetTools::mohrsCirclePlotName() );
|
||||
m_mohrsCirclePlot = new RiuMohrsCirclePlot( dockWidget );
|
||||
dockWidget->setWidget( m_mohrsCirclePlot );
|
||||
@ -835,7 +829,7 @@ void RiuMainWindow::createDockPanels()
|
||||
#endif
|
||||
|
||||
{
|
||||
ads::CDockWidget* dockWidget = new ads::CDockWidget( "Relative Permeability Plot", this );
|
||||
ads::CDockWidget* dockWidget = new ads::CDockWidget( "Relative Permeability Plot", dockManager() );
|
||||
dockWidget->setObjectName( RiuDockWidgetTools::relPermPlotName() );
|
||||
m_relPermPlotPanel = new RiuRelativePermeabilityPlotPanel( dockWidget );
|
||||
dockWidget->setWidget( m_relPermPlotPanel );
|
||||
@ -843,7 +837,7 @@ void RiuMainWindow::createDockPanels()
|
||||
}
|
||||
|
||||
{
|
||||
ads::CDockWidget* dockWidget = new ads::CDockWidget( "PVT Plot", this );
|
||||
ads::CDockWidget* dockWidget = new ads::CDockWidget( "PVT Plot", dockManager() );
|
||||
dockWidget->setObjectName( RiuDockWidgetTools::pvtPlotName() );
|
||||
m_pvtPlotPanel = new RiuPvtPlotPanel( dockWidget );
|
||||
dockWidget->setWidget( m_pvtPlotPanel );
|
||||
@ -852,7 +846,7 @@ void RiuMainWindow::createDockPanels()
|
||||
|
||||
// result info
|
||||
{
|
||||
ads::CDockWidget* dockWidget = new ads::CDockWidget( "Result Info", this );
|
||||
ads::CDockWidget* dockWidget = new ads::CDockWidget( "Result Info", dockManager() );
|
||||
dockWidget->setObjectName( RiuDockWidgetTools::resultInfoName() );
|
||||
m_resultInfoPanel = new RiuResultInfoPanel( dockWidget );
|
||||
dockWidget->setWidget( m_resultInfoPanel );
|
||||
@ -862,7 +856,7 @@ void RiuMainWindow::createDockPanels()
|
||||
ads::CDockAreaWidget* procAndMsgTabs = nullptr;
|
||||
// process monitor
|
||||
{
|
||||
ads::CDockWidget* dockWidget = new ads::CDockWidget( "Process Monitor", this );
|
||||
ads::CDockWidget* dockWidget = new ads::CDockWidget( "Process Monitor", dockManager() );
|
||||
dockWidget->setObjectName( RiuDockWidgetTools::processMonitorName() );
|
||||
m_processMonitor = new RiuProcessMonitor( dockWidget );
|
||||
dockWidget->setWidget( m_processMonitor );
|
||||
@ -870,7 +864,7 @@ void RiuMainWindow::createDockPanels()
|
||||
}
|
||||
|
||||
{
|
||||
ads::CDockWidget* dockWidget = new ads::CDockWidget( "Messages", this );
|
||||
ads::CDockWidget* dockWidget = new ads::CDockWidget( "Messages", dockManager() );
|
||||
dockWidget->setObjectName( RiuDockWidgetTools::messagesName() );
|
||||
m_messagePanel = new RiuMessagePanel( dockWidget );
|
||||
dockWidget->setWidget( m_messagePanel );
|
||||
@ -886,8 +880,6 @@ void RiuMainWindow::createDockPanels()
|
||||
for ( ads::CDockWidget* dock : widgets )
|
||||
{
|
||||
connect( dock->toggleViewAction(), SIGNAL( triggered() ), SLOT( slotDockWidgetToggleViewActionTriggered() ) );
|
||||
dock->setVisible( true );
|
||||
dock->raise();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1761,7 +1753,7 @@ void RiuMainWindow::updateMemoryUsage()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMainWindow::showProcessMonitorDockPanel()
|
||||
{
|
||||
RiuDockWidgetTools::setDockWidgetVisibility( this->dockManager(), RiuDockWidgetTools::processMonitorName(), true );
|
||||
RiuDockWidgetTools::showDockWidget( this->dockManager(), RiuDockWidgetTools::processMonitorName() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -1955,14 +1947,6 @@ void RiuMainWindow::customMenuRequested( const QPoint& pos )
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMainWindow::slotWorkaroundForQwtDockWidgets()
|
||||
{
|
||||
RiuDockWidgetTools::workaroundForQwtDockWidgets();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -245,8 +245,6 @@ private slots:
|
||||
void selectedObjectsChanged();
|
||||
void customMenuRequested( const QPoint& pos );
|
||||
|
||||
void slotWorkaroundForQwtDockWidgets();
|
||||
|
||||
private:
|
||||
void selectViewInProjectTreePreservingSubItemSelection( const Rim3dView* previousActiveReservoirView,
|
||||
Rim3dView* activatedView );
|
||||
|
@ -158,8 +158,6 @@ void RiuMainWindowBase::loadWinGeoAndDockToolBarLayout()
|
||||
|
||||
settings.beginGroup( registryFolderName() );
|
||||
m_dockManager->loadPerspectives( settings );
|
||||
|
||||
restoreDockWidgetVisibilities();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -189,44 +187,6 @@ void RiuMainWindowBase::saveWinGeoAndDockToolBarLayout()
|
||||
settings.setValue( QString( "%1/isMaximized" ).arg( registryFolderName() ), isMaximized() );
|
||||
|
||||
settings.setValue( QString( "%1/dockLayout" ).arg( registryFolderName() ), m_dockManager->saveState( 1 ) );
|
||||
|
||||
if ( this->isVisible() )
|
||||
{
|
||||
QVariant dockWindowVisibilities = RiuDockWidgetTools::dockWidgetsVisibility( this->dockManager() );
|
||||
QString key = mainWindowDockWidgetSettingsKey( registryFolderName() );
|
||||
|
||||
settings.setValue( key, dockWindowVisibilities );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMainWindowBase::storeDefaultDockWidgetVisibilitiesIfRequired()
|
||||
{
|
||||
QSettings settings;
|
||||
|
||||
QString key = mainWindowDockWidgetSettingsKey( registryFolderName() );
|
||||
|
||||
if ( !settings.contains( key ) )
|
||||
{
|
||||
QVariant dockWidgetVisibilities = RiuDockWidgetTools::defaultDockWidgetVisibilities();
|
||||
settings.setValue( key, dockWidgetVisibilities );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMainWindowBase::restoreDockWidgetVisibilities()
|
||||
{
|
||||
// Company and appname set through QCoreApplication
|
||||
QSettings settings;
|
||||
|
||||
QString key = mainWindowDockWidgetSettingsKey( registryFolderName() );
|
||||
|
||||
QVariant dockWindowVisibilities = settings.value( key );
|
||||
RiuDockWidgetTools::applyDockWidgetVisibilities( this->dockManager(), dockWindowVisibilities.toMap() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -246,20 +206,6 @@ void RiuMainWindowBase::showWindow()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMainWindowBase::hideAllDockWidgets()
|
||||
{
|
||||
for ( auto dock : dockManager()->dockWidgetsMap() )
|
||||
{
|
||||
if ( dock )
|
||||
{
|
||||
dock->hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -69,12 +69,8 @@ public:
|
||||
RimMdiWindowGeometry windowGeometryForViewer( QWidget* viewer );
|
||||
void loadWinGeoAndDockToolBarLayout();
|
||||
void saveWinGeoAndDockToolBarLayout();
|
||||
void storeDefaultDockWidgetVisibilitiesIfRequired();
|
||||
void restoreDockWidgetVisibilities();
|
||||
void showWindow();
|
||||
|
||||
void hideAllDockWidgets();
|
||||
|
||||
std::vector<caf::PdmUiTreeView*> projectTreeViews();
|
||||
caf::PdmUiTreeView* projectTreeView( int treeId );
|
||||
caf::PdmUiTreeView* getTreeViewWithItem( const caf::PdmUiItem* item );
|
||||
|
@ -249,7 +249,6 @@ void RiuPlotMainWindow::closeEvent( QCloseEvent* event )
|
||||
}
|
||||
}
|
||||
this->saveWinGeoAndDockToolBarLayout();
|
||||
this->hideAllDockWidgets();
|
||||
QMainWindow::closeEvent( event );
|
||||
}
|
||||
|
||||
@ -503,7 +502,7 @@ void RiuPlotMainWindow::createDockPanels()
|
||||
// the project trees
|
||||
for ( int i = 0; i < nTreeViews; i++ )
|
||||
{
|
||||
ads::CDockWidget* dockWidget = new ads::CDockWidget( treeViewTitles[i], this );
|
||||
ads::CDockWidget* dockWidget = new ads::CDockWidget( treeViewTitles[i], dockManager() );
|
||||
dockWidget->setObjectName( treeViewDockNames[i] );
|
||||
|
||||
caf::PdmUiTreeView* projectTree = projectTreeView( i );
|
||||
@ -543,7 +542,7 @@ void RiuPlotMainWindow::createDockPanels()
|
||||
|
||||
// the plot manager
|
||||
{
|
||||
ads::CDockWidget* dockWidget = new ads::CDockWidget( "Plot Manager", this );
|
||||
ads::CDockWidget* dockWidget = new ads::CDockWidget( "Plot Manager", dockManager() );
|
||||
dockWidget->setObjectName( RiuDockWidgetTools::summaryPlotManagerName() );
|
||||
|
||||
m_summaryPlotManagerView = std::make_unique<caf::PdmUiPropertyView>( dockWidget );
|
||||
@ -561,7 +560,7 @@ void RiuPlotMainWindow::createDockPanels()
|
||||
// the undo stack
|
||||
if ( m_undoView && RiaPreferences::current()->useUndoRedo() )
|
||||
{
|
||||
ads::CDockWidget* dockWidget = new ads::CDockWidget( "Undo Stack", this );
|
||||
ads::CDockWidget* dockWidget = new ads::CDockWidget( "Undo Stack", dockManager() );
|
||||
dockWidget->setObjectName( RiuDockWidgetTools::plotMainWindowUndoStackName() );
|
||||
dockWidget->setWidget( m_undoView );
|
||||
rightWidgets.push_back( dockWidget );
|
||||
@ -575,7 +574,7 @@ void RiuPlotMainWindow::createDockPanels()
|
||||
|
||||
// the property editor
|
||||
{
|
||||
ads::CDockWidget* dockWidget = new ads::CDockWidget( "Property Editor", this );
|
||||
ads::CDockWidget* dockWidget = new ads::CDockWidget( "Property Editor", dockManager() );
|
||||
dockWidget->setObjectName( RiuDockWidgetTools::plotMainWindowPropertyEditorName() );
|
||||
|
||||
m_pdmUiPropertyView = std::make_unique<caf::PdmUiPropertyView>( dockWidget );
|
||||
@ -585,7 +584,7 @@ void RiuPlotMainWindow::createDockPanels()
|
||||
|
||||
// the log message view
|
||||
{
|
||||
ads::CDockWidget* dockWidget = new ads::CDockWidget( "Messages", this );
|
||||
ads::CDockWidget* dockWidget = new ads::CDockWidget( "Messages", dockManager() );
|
||||
dockWidget->setObjectName( RiuDockWidgetTools::plotMainWindowMessagesName() );
|
||||
m_messagePanel = new RiuMessagePanel( dockWidget );
|
||||
dockWidget->setWidget( m_messagePanel );
|
||||
@ -602,8 +601,6 @@ void RiuPlotMainWindow::createDockPanels()
|
||||
for ( ads::CDockWidget* dock : widgets )
|
||||
{
|
||||
connect( dock->toggleViewAction(), SIGNAL( triggered() ), SLOT( slotDockWidgetToggleViewActionTriggered() ) );
|
||||
dock->setVisible( true );
|
||||
dock->raise();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user