mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Mainwindow datasources (#8883)
* Main Window: add three dock widgets for splitting project tree * Main Window: move scripts to separate tree widget * Add eclipse result addresses to data source project tree. * Grid Calculator: drag-and-drop for calculation variables. * Grid Calculator: rename to 'Grid Property Calculator'.
This commit is contained in:
committed by
GitHub
parent
65827f9c1c
commit
daf02571c2
@@ -108,6 +108,30 @@ QString RiuDockWidgetTools::summaryPlotManagerName()
|
||||
return "dockSummaryPlotManager";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiuDockWidgetTools::mainWindowProjectTreeName()
|
||||
{
|
||||
return "mainWindow_dockProjectTree";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiuDockWidgetTools::mainWindowDataSourceTreeName()
|
||||
{
|
||||
return "mainWindow_dockDataSourceTree";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiuDockWidgetTools::mainWindowScriptsTreeName()
|
||||
{
|
||||
return "mainWindow_dockScriptsTree";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -48,6 +48,10 @@ public:
|
||||
static QString undoStackName();
|
||||
static QString summaryPlotManagerName();
|
||||
|
||||
static QString mainWindowProjectTreeName();
|
||||
static QString mainWindowDataSourceTreeName();
|
||||
static QString mainWindowScriptsTreeName();
|
||||
|
||||
static QString plotMainWindowDataSourceTreeName();
|
||||
static QString plotMainWindowPlotsTreeName();
|
||||
static QString plotMainWindowScriptsTreeName();
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
|
||||
#include "RimCaseCollection.h"
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseResultAddress.h"
|
||||
#include "RimEclipseResultCase.h"
|
||||
#include "RimIdenticalGridCaseGroup.h"
|
||||
#include "RimMimeData.h"
|
||||
@@ -49,6 +50,7 @@
|
||||
#include "RimWellLogFileChannel.h"
|
||||
#include "RimWellLogPlot.h"
|
||||
#include "RimWellLogTrack.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
|
||||
#include "RicWellLogTools.h"
|
||||
@@ -271,6 +273,11 @@ Qt::ItemFlags RiuDragDrop::flags( const QModelIndex& index ) const
|
||||
{
|
||||
itemflags |= Qt::ItemIsDragEnabled;
|
||||
}
|
||||
auto eclipseResultAdr = dynamic_cast<RimEclipseResultAddress*>( uiItem );
|
||||
if ( eclipseResultAdr )
|
||||
{
|
||||
itemflags |= Qt::ItemIsDragEnabled;
|
||||
}
|
||||
}
|
||||
|
||||
if ( m_dragItems.empty() ) return itemflags;
|
||||
|
||||
@@ -710,16 +710,24 @@ void RiuMainWindow::createToolBars()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMainWindow::createDockPanels()
|
||||
{
|
||||
const int nTreeViews = 1;
|
||||
const int nTreeViews = 3;
|
||||
const std::vector<QString> treeViewTitles = { "Project Tree", "Data Sources", "Scripts" };
|
||||
const std::vector<QString> treeViewConfigs = { "MainWindow.ProjectTree", "MainWindow.DataSources", "MainWindow.Scripts" };
|
||||
const std::vector<QString> treeViewDockNames = { RiuDockWidgetTools::mainWindowProjectTreeName(),
|
||||
RiuDockWidgetTools::mainWindowDataSourceTreeName(),
|
||||
RiuDockWidgetTools::mainWindowScriptsTreeName() };
|
||||
|
||||
createTreeViews( nTreeViews );
|
||||
|
||||
QDockWidget* dockOntopOfWidget = nullptr;
|
||||
|
||||
for ( int i = 0; i < nTreeViews; i++ )
|
||||
{
|
||||
QDockWidget* dockWidget = new QDockWidget( "Project Tree", this );
|
||||
dockWidget->setObjectName( RiuDockWidgetTools::projectTreeName() );
|
||||
QDockWidget* dockWidget = new QDockWidget( treeViewTitles[i], this );
|
||||
dockWidget->setObjectName( treeViewDockNames[i] );
|
||||
dockWidget->setAllowedAreas( Qt::AllDockWidgetAreas );
|
||||
|
||||
caf::PdmUiTreeView* projectTree = projectTreeView( 0 );
|
||||
caf::PdmUiTreeView* projectTree = projectTreeView( i );
|
||||
projectTree->enableSelectionManagerUpdating( true );
|
||||
|
||||
projectTree->enableAppendOfClassNameToUiItemText( RiaPreferencesSystem::current()->appendClassNameToUiText() );
|
||||
@@ -741,11 +749,25 @@ void RiuMainWindow::createDockPanels()
|
||||
|
||||
addDockWidget( Qt::LeftDockWidgetArea, dockWidget );
|
||||
|
||||
if ( dockOntopOfWidget )
|
||||
{
|
||||
tabifyDockWidget( dockOntopOfWidget, dockWidget );
|
||||
}
|
||||
else
|
||||
{
|
||||
dockOntopOfWidget = dockWidget;
|
||||
}
|
||||
|
||||
connect( dockWidget, SIGNAL( visibilityChanged( bool ) ), projectTree, SLOT( treeVisibilityChanged( bool ) ) );
|
||||
|
||||
connect( projectTree, SIGNAL( selectionChanged() ), this, SLOT( selectedObjectsChanged() ) );
|
||||
|
||||
projectTree->treeView()->setContextMenuPolicy( Qt::CustomContextMenu );
|
||||
connect( projectTree->treeView(),
|
||||
SIGNAL( customContextMenuRequested( const QPoint& ) ),
|
||||
SLOT( customMenuRequested( const QPoint& ) ) );
|
||||
|
||||
projectTree->setUiConfigurationName( treeViewConfigs[i] );
|
||||
}
|
||||
|
||||
QDockWidget* resultPlotDock = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user