mirror of
https://github.com/OPM/ResInsight.git
synced 2026-09-03 20:53:13 -05:00
#14602 UI adjustments for summary import and curve calculator
Use a file dialog caption matching the imported file type instead of always showing "Import Grid Model". Parent the summary vector selection dialog to the active window, so closing it does not raise the 3D main window in front of the plot window when opened from the Summary Curve Calculator.
This commit is contained in:
@@ -281,6 +281,18 @@ QString RicImportGeneralDataFeature::getFilePattern( RiaDefines::ImportFileType
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
static QString fileDialogTitle( RiaDefines::ImportFileType fileType )
|
||||||
|
{
|
||||||
|
if ( fileType == ImportFileType::ECLIPSE_SUMMARY_FILE ) return "Import Summary Case";
|
||||||
|
if ( fileType == ImportFileType::ECLIPSE_INPUT_FILE ) return "Import Eclipse Input File";
|
||||||
|
if ( fileType == ImportFileType::ROFF_FILE ) return "Import Roff File";
|
||||||
|
|
||||||
|
return "Import Grid Model";
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -321,7 +333,7 @@ QStringList RicImportGeneralDataFeature::getEclipseFileNamesWithDialog( RiaDefin
|
|||||||
QString defaultDir = RiaApplication::instance()->lastUsedDialogDirectory( defaultDirectoryLabel( fileType ) );
|
QString defaultDir = RiaApplication::instance()->lastUsedDialogDirectory( defaultDirectoryLabel( fileType ) );
|
||||||
|
|
||||||
// Use nullptr as parent to this dialog, as this function is called from both plot window and main window
|
// Use nullptr as parent to this dialog, as this function is called from both plot window and main window
|
||||||
QStringList fileNames = RiuFileDialogTools::getOpenFileNames( nullptr, "Import Grid Model", defaultDir, fullPattern );
|
QStringList fileNames = RiuFileDialogTools::getOpenFileNames( nullptr, fileDialogTitle( fileType ), defaultDir, fullPattern );
|
||||||
|
|
||||||
return fileNames;
|
return fileNames;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,12 @@ void RimSummaryCalculationVariable::fieldChangedByUi( const caf::PdmFieldHandle*
|
|||||||
bool updateContainingEditor = false;
|
bool updateContainingEditor = false;
|
||||||
|
|
||||||
{
|
{
|
||||||
RiuSummaryVectorSelectionDialog dlg( RiaGuiApplication::widgetToUseAsParent() );
|
// This dialog can be opened from the summary calculator dialog. Use the active window as parent, as using
|
||||||
|
// a main window as parent will raise that main window in front of the calculator dialog when closing.
|
||||||
|
QWidget* parentWidget = RiaGuiApplication::activeWindow();
|
||||||
|
if ( !parentWidget ) parentWidget = RiaGuiApplication::widgetToUseAsParent();
|
||||||
|
|
||||||
|
RiuSummaryVectorSelectionDialog dlg( parentWidget );
|
||||||
dlg.hideEnsembles();
|
dlg.hideEnsembles();
|
||||||
dlg.hideCalculationIncompatibleCategories();
|
dlg.hideCalculationIncompatibleCategories();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user