mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fix update of track names following DnD
This commit is contained in:
parent
88a80c1b71
commit
b343aa1ae9
@ -207,22 +207,10 @@ void RimGridPlotWindow::updateLayout()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
/// Empty default implementation
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimGridPlotWindow::updatePlotNames()
|
void RimGridPlotWindow::updatePlotNames() {}
|
||||||
{
|
|
||||||
auto plotVector = plots();
|
|
||||||
for ( size_t tIdx = 0; tIdx < plotVector.size(); ++tIdx )
|
|
||||||
{
|
|
||||||
QString description = plotVector[tIdx]->description();
|
|
||||||
QRegularExpression regexp( "Track \\d+" );
|
|
||||||
description.replace( regexp, QString( "Track %1" ).arg( tIdx + 1 ) );
|
|
||||||
plotVector[tIdx]->setDescription( description );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
@ -234,7 +222,7 @@ void RimGridPlotWindow::updatePlotOrderFromGridWidget()
|
|||||||
auto indexRhs = m_viewer->indexOfPlotWidget( toPlotInterfaceAsserted( rhs )->viewer() );
|
auto indexRhs = m_viewer->indexOfPlotWidget( toPlotInterfaceAsserted( rhs )->viewer() );
|
||||||
return indexLhs < indexRhs;
|
return indexLhs < indexRhs;
|
||||||
} );
|
} );
|
||||||
// updatePlotNames();
|
updatePlotNames();
|
||||||
updateConnectedEditors();
|
updateConnectedEditors();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -323,10 +311,10 @@ QString RimGridPlotWindow::asciiDataForPlotExport() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimGridPlotWindow::onPlotAdditionOrRemoval()
|
void RimGridPlotWindow::onPlotAdditionOrRemoval()
|
||||||
{
|
{
|
||||||
// updatePlotNames();
|
updatePlotNames();
|
||||||
updateColumnCount();
|
|
||||||
updateConnectedEditors();
|
updateConnectedEditors();
|
||||||
updateLayout();
|
updateLayout();
|
||||||
|
RiuPlotMainWindowTools::refreshToolbars();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -385,7 +373,7 @@ void RimGridPlotWindow::fieldChangedByUi( const caf::PdmFieldHandle* changedFiel
|
|||||||
if ( changedField == &m_columnCountEnum )
|
if ( changedField == &m_columnCountEnum )
|
||||||
{
|
{
|
||||||
updateLayout();
|
updateLayout();
|
||||||
updateColumnCount();
|
RiuPlotMainWindowTools::refreshToolbars();
|
||||||
}
|
}
|
||||||
updateConnectedEditors();
|
updateConnectedEditors();
|
||||||
}
|
}
|
||||||
@ -579,14 +567,6 @@ void RimGridPlotWindow::detachAllCurves()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void RimGridPlotWindow::updateColumnCount()
|
|
||||||
{
|
|
||||||
RiuPlotMainWindowTools::refreshToolbars();
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -67,7 +67,7 @@ public:
|
|||||||
std::vector<RimPlotInterface*> visiblePlots() const;
|
std::vector<RimPlotInterface*> visiblePlots() const;
|
||||||
|
|
||||||
void updateLayout() override;
|
void updateLayout() override;
|
||||||
// void updatePlotNames();
|
virtual void updatePlotNames();
|
||||||
void updatePlotOrderFromGridWidget();
|
void updatePlotOrderFromGridWidget();
|
||||||
|
|
||||||
virtual void setAutoScaleXEnabled( bool enabled );
|
virtual void setAutoScaleXEnabled( bool enabled );
|
||||||
@ -114,8 +114,6 @@ protected:
|
|||||||
private:
|
private:
|
||||||
void detachAllCurves() override;
|
void detachAllCurves() override;
|
||||||
|
|
||||||
void updateColumnCount();
|
|
||||||
|
|
||||||
static RimPlotInterface* toPlotInterfaceAsserted( caf::PdmObject* pdmObject );
|
static RimPlotInterface* toPlotInterfaceAsserted( caf::PdmObject* pdmObject );
|
||||||
static const RimPlotInterface* toPlotInterfaceAsserted( const caf::PdmObject* pdmObject );
|
static const RimPlotInterface* toPlotInterfaceAsserted( const caf::PdmObject* pdmObject );
|
||||||
static caf::PdmObject* toPdmObjectAsserted( RimPlotInterface* plotInterface );
|
static caf::PdmObject* toPdmObjectAsserted( RimPlotInterface* plotInterface );
|
||||||
|
@ -519,6 +519,26 @@ void RimWellLogPlot::onPlotAdditionOrRemoval()
|
|||||||
RimGridPlotWindow::onPlotAdditionOrRemoval();
|
RimGridPlotWindow::onPlotAdditionOrRemoval();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimWellLogPlot::updatePlotNames()
|
||||||
|
{
|
||||||
|
auto plotVector = plots();
|
||||||
|
for ( size_t tIdx = 0; tIdx < plotVector.size(); ++tIdx )
|
||||||
|
{
|
||||||
|
RimWellLogTrack* track = dynamic_cast<RimWellLogTrack*>( plotVector[tIdx] );
|
||||||
|
CAF_ASSERT( track );
|
||||||
|
if ( track )
|
||||||
|
{
|
||||||
|
QString description = track->description();
|
||||||
|
QRegularExpression regexp( "Track \\d+" );
|
||||||
|
description.replace( regexp, QString( "Track %1" ).arg( tIdx + 1 ) );
|
||||||
|
track->setDescription( description );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -109,6 +109,8 @@ public:
|
|||||||
|
|
||||||
void onPlotAdditionOrRemoval() override;
|
void onPlotAdditionOrRemoval() override;
|
||||||
|
|
||||||
|
void updatePlotNames() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QWidget* createViewWidget( QWidget* mainWindowParent ) override;
|
QWidget* createViewWidget( QWidget* mainWindowParent ) override;
|
||||||
void performAutoNameUpdate() override;
|
void performAutoNameUpdate() override;
|
||||||
|
Loading…
Reference in New Issue
Block a user