2012-05-18 02:45:23 -05:00
/////////////////////////////////////////////////////////////////////////////////
//
2019-04-02 06:28:31 -05:00
// Copyright (C) 2019- Equinor ASA
// Copyright (C) 2011-2018 Statoil ASA
2014-09-23 08:04:57 -05:00
// Copyright (C) 2013- Ceetron Solutions AS
// Copyright (C) 2011-2012 Ceetron AS
2012-05-18 02:45:23 -05:00
//
// 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.
//
/////////////////////////////////////////////////////////////////////////////////
2013-03-22 10:24:42 -05:00
# include "RiaPreferences.h"
2013-05-06 03:55:00 -05:00
2019-04-02 06:28:31 -05:00
# include "RiaColorTables.h"
2015-07-31 11:58:23 -05:00
# include "RifReaderSettings.h"
2013-05-06 03:55:00 -05:00
# include "cafPdmFieldCvfColor.h"
2019-04-14 08:40:37 -05:00
# include "cafPdmUiComboBoxEditor.h"
2014-07-22 05:10:51 -05:00
# include "cafPdmUiCheckBoxEditor.h"
2015-07-31 11:58:23 -05:00
# include "cafPdmUiFieldHandle.h"
# include "cafPdmUiFilePathEditor.h"
2012-05-18 02:45:23 -05:00
2018-03-20 08:57:11 -05:00
namespace caf
2018-03-19 07:35:56 -05:00
{
2018-03-20 08:57:11 -05:00
template < >
void RiaPreferences : : SummaryRestartFilesImportModeType : : setUp ( )
{
2018-04-13 08:44:28 -05:00
addItem ( RiaPreferences : : IMPORT , " IMPORT " , " Unified " ) ;
addItem ( RiaPreferences : : SEPARATE_CASES , " SEPARATE_CASES " , " Separate Cases " ) ;
2018-04-25 04:21:30 -05:00
addItem ( RiaPreferences : : NOT_IMPORT , " NOT_IMPORT " , " Skip " ) ;
2018-04-09 06:21:48 -05:00
setDefault ( RiaPreferences : : IMPORT ) ;
2018-03-20 08:57:11 -05:00
}
2018-03-19 07:35:56 -05:00
}
2013-03-22 10:24:42 -05:00
CAF_PDM_SOURCE_INIT ( RiaPreferences , " RiaPreferences " ) ;
2012-05-18 02:45:23 -05:00
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
2013-03-22 09:50:44 -05:00
RiaPreferences : : RiaPreferences ( void )
2012-05-18 02:45:23 -05:00
{
2019-05-06 03:36:05 -05:00
CAF_PDM_InitField ( & navigationPolicy , " navigationPolicy " , caf : : AppEnum < RiaGuiApplication : : RINavigationPolicy > ( RiaGuiApplication : : NAVIGATION_POLICY_RMS ) , " Navigation Mode " , " " , " " , " " ) ;
2012-05-18 02:45:23 -05:00
2019-05-20 06:21:02 -05:00
CAF_PDM_InitField ( & enableGrpcServer , " enableGrpcServer " , true , " Enable gRPC script server " , " " , " Remote Procedure Call Scripting Engine " , " " ) ;
CAF_PDM_InitField ( & defaultGrpcPortNumber , " defaultGrpcPort " , 50051 , " Default gRPC port " , " " , " " , " " ) ;
2013-04-24 00:35:31 -05:00
CAF_PDM_InitFieldNoDefault ( & scriptDirectories , " scriptDirectory " , " Shared Script Folder(s) " , " " , " " , " " ) ;
2015-08-05 06:27:36 -05:00
scriptDirectories . uiCapability ( ) - > setUiEditorTypeName ( caf : : PdmUiFilePathEditor : : uiEditorTypeName ( ) ) ;
2012-06-26 09:10:41 -05:00
2012-05-18 02:45:23 -05:00
CAF_PDM_InitField ( & scriptEditorExecutable , " scriptEditorExecutable " , QString ( " kate " ) , " Script Editor " , " " , " " , " " ) ;
2015-08-05 06:27:36 -05:00
scriptEditorExecutable . uiCapability ( ) - > setUiEditorTypeName ( caf : : PdmUiFilePathEditor : : uiEditorTypeName ( ) ) ;
2012-06-26 09:10:41 -05:00
2017-04-27 06:16:44 -05:00
CAF_PDM_InitField ( & octaveExecutable , " octaveExecutable " , QString ( " octave " ) , " Octave Executable Location " , " " , " " , " " ) ;
2015-08-05 06:27:36 -05:00
octaveExecutable . uiCapability ( ) - > setUiEditorTypeName ( caf : : PdmUiFilePathEditor : : uiEditorTypeName ( ) ) ;
octaveExecutable . uiCapability ( ) - > setUiLabelPosition ( caf : : PdmUiItemInfo : : TOP ) ;
2014-07-22 05:10:51 -05:00
2017-04-27 06:16:44 -05:00
CAF_PDM_InitField ( & octaveShowHeaderInfoWhenExecutingScripts , " octaveShowHeaderInfoWhenExecutingScripts " , false , " Show Text Header When Executing Scripts " , " " , " " , " " ) ;
2015-08-05 06:27:36 -05:00
octaveShowHeaderInfoWhenExecutingScripts . uiCapability ( ) - > setUiLabelPosition ( caf : : PdmUiItemInfo : : HIDDEN ) ;
2012-05-18 02:45:23 -05:00
2017-04-27 06:16:44 -05:00
CAF_PDM_InitField ( & ssihubAddress , " ssihubAddress " , QString ( " http:// " ) , " SSIHUB Address " , " " , " " , " " ) ;
2015-09-22 01:39:53 -05:00
ssihubAddress . uiCapability ( ) - > setUiLabelPosition ( caf : : PdmUiItemInfo : : TOP ) ;
2013-05-29 05:59:08 -05:00
2019-04-10 05:49:20 -05:00
CAF_PDM_InitFieldNoDefault ( & defaultMeshModeType , " defaultMeshModeType " , " Show Grid Lines " , " " , " " , " " ) ;
2019-04-02 06:28:31 -05:00
CAF_PDM_InitField ( & defaultGridLineColors , " defaultGridLineColors " , RiaColorTables : : defaultGridLineColor ( ) , " Mesh Color " , " " , " " , " " ) ;
CAF_PDM_InitField ( & defaultFaultGridLineColors , " defaultFaultGridLineColors " , RiaColorTables : : defaultFaultLineColor ( ) , " Mesh Color Along Faults " , " " , " " , " " ) ;
CAF_PDM_InitField ( & defaultWellLabelColor , " defaultWellLableColor " , RiaColorTables : : defaultWellLabelColor ( ) , " Well Label Color " , " " , " The default well label color in new views " , " " ) ;
2013-04-12 06:15:41 -05:00
2019-04-02 06:28:31 -05:00
CAF_PDM_InitField ( & defaultViewerBackgroundColor , " defaultViewerBackgroundColor " , RiaColorTables : : defaultViewerBackgroundColor ( ) , " Viewer Background " , " " , " The viewer background color for new views " , " " ) ;
2013-04-15 06:13:41 -05:00
2019-04-10 05:49:20 -05:00
CAF_PDM_InitField ( & defaultScaleFactorZ , " defaultScaleFactorZ " , 5 , " Default Z Scale Factor " , " " , " " , " " ) ;
2019-04-30 05:36:53 -05:00
caf : : AppEnum < RiaFontCache : : FontSize > fontSize = RiaFontCache : : FONT_SIZE_8 ;
CAF_PDM_InitField ( & defaultSceneFontSize , " fontSizeInScene " , fontSize , " Viewer Font Size " , " " , " " , " " ) ;
CAF_PDM_InitField ( & defaultAnnotationFontSize , " defaultAnnotationFontSize " , fontSize , " Annotation Font Size " , " " , " " , " " ) ;
CAF_PDM_InitField ( & defaultWellLabelFontSize , " wellLabelFontSize " , fontSize , " Well Label Font Size " , " " , " " , " " ) ;
CAF_PDM_InitField ( & defaultPlotFontSize , " defaultPlotFontSize " , fontSize , " Plot Font Size " , " " , " " , " " ) ;
2016-08-09 06:09:08 -05:00
2017-04-27 06:16:44 -05:00
CAF_PDM_InitField ( & showLasCurveWithoutTvdWarning , " showLasCurveWithoutTvdWarning " , true , " Show LAS Curve Without TVD Warning " , " " , " " , " " ) ;
2015-10-30 05:42:11 -05:00
showLasCurveWithoutTvdWarning . uiCapability ( ) - > setUiLabelPosition ( caf : : PdmUiItemInfo : : HIDDEN ) ;
2012-10-12 08:05:42 -05:00
2012-05-18 02:45:23 -05:00
CAF_PDM_InitField ( & useShaders , " useShaders " , true , " Use Shaders " , " " , " " , " " ) ;
2015-09-22 01:39:53 -05:00
useShaders . uiCapability ( ) - > setUiLabelPosition ( caf : : PdmUiItemInfo : : HIDDEN ) ;
2012-10-23 01:27:49 -05:00
CAF_PDM_InitField ( & showHud , " showHud " , false , " Show 3D Information " , " " , " " , " " ) ;
2015-09-22 01:39:53 -05:00
showHud . uiCapability ( ) - > setUiLabelPosition ( caf : : PdmUiItemInfo : : HIDDEN ) ;
2018-09-19 07:43:06 -05:00
CAF_PDM_InitField ( & m_appendClassNameToUiText , " appendClassNameToUiText " , false , " Show Class Names " , " " , " " , " " ) ;
m_appendClassNameToUiText . uiCapability ( ) - > setUiLabelPosition ( caf : : PdmUiItemInfo : : HIDDEN ) ;
CAF_PDM_InitField ( & m_appendFieldKeywordToToolTipText , " appendFieldKeywordToToolTipText " , false , " Show Field Keyword in ToolTip " , " " , " " , " " ) ;
m_appendFieldKeywordToToolTipText . uiCapability ( ) - > setUiLabelPosition ( caf : : PdmUiItemInfo : : HIDDEN ) ;
CAF_PDM_InitField ( & m_showTestToolbar , " showTestToolbar " , false , " Enable Test Toolbar " , " " , " " , " " ) ;
m_showTestToolbar . uiCapability ( ) - > setUiLabelPosition ( caf : : PdmUiItemInfo : : HIDDEN ) ;
CAF_PDM_InitField ( & m_includeFractureDebugInfoFile , " includeFractureDebugInfoFile " , false , " Include Fracture Debug Info for Completion Export " , " " , " " , " " ) ;
m_includeFractureDebugInfoFile . uiCapability ( ) - > setUiLabelPosition ( caf : : PdmUiItemInfo : : HIDDEN ) ;
2012-05-18 02:45:23 -05:00
2019-04-10 05:49:20 -05:00
CAF_PDM_InitField ( & showLegendBackground , " showLegendBackground " , true , " Show Box around Legends " , " " , " " , " " ) ;
showLegendBackground . uiCapability ( ) - > setUiLabelPosition ( caf : : PdmUiItemInfo : : HIDDEN ) ;
2018-03-08 09:15:45 -06:00
2012-05-18 02:45:23 -05:00
CAF_PDM_InitFieldNoDefault ( & lastUsedProjectFileName , " lastUsedProjectFileName " , " Last Used Project File " , " " , " " , " " ) ;
2015-08-05 06:27:36 -05:00
lastUsedProjectFileName . uiCapability ( ) - > setUiHidden ( true ) ;
2012-08-31 12:12:47 -05:00
2017-04-27 06:16:44 -05:00
CAF_PDM_InitField ( & autocomputeDepthRelatedProperties , " autocomputeDepth " , true , " Compute DEPTH Related Properties " , " " , " DEPTH, DX, DY, DZ, TOP, BOTTOM " , " " ) ;
2015-08-05 06:27:36 -05:00
autocomputeDepthRelatedProperties . uiCapability ( ) - > setUiLabelPosition ( caf : : PdmUiItemInfo : : HIDDEN ) ;
2014-10-24 04:38:47 -05:00
2017-04-27 06:16:44 -05:00
CAF_PDM_InitField ( & loadAndShowSoil , " loadAndShowSoil " , true , " Load and Show SOIL " , " " , " " , " " ) ;
2015-08-05 06:27:36 -05:00
loadAndShowSoil . uiCapability ( ) - > setUiLabelPosition ( caf : : PdmUiItemInfo : : HIDDEN ) ;
2014-07-30 02:13:47 -05:00
2018-04-09 06:21:48 -05:00
CAF_PDM_InitFieldNoDefault ( & summaryRestartFilesShowImportDialog , " summaryRestartFilesShowImportDialog " , " Show Import Dialog " , " " , " " , " " ) ;
2018-04-13 08:44:28 -05:00
CAF_PDM_InitField ( & summaryImportMode , " summaryImportMode " , SummaryRestartFilesImportModeType ( RiaPreferences : : IMPORT ) , " Default Summary Import Option " , " " , " " , " " ) ;
CAF_PDM_InitField ( & gridImportMode , " gridImportMode " , SummaryRestartFilesImportModeType ( RiaPreferences : : NOT_IMPORT ) , " Default Grid Import Option " , " " , " " , " " ) ;
2019-06-21 02:11:10 -05:00
CAF_PDM_InitField ( & summaryEnsembleImportMode , " summaryEnsembleImportMode " , SummaryRestartFilesImportModeType ( RiaPreferences : : IMPORT ) , " Default Ensemble Summary Import Option " , " " , " " , " " ) ;
2018-03-19 07:35:56 -05:00
2018-10-25 02:25:53 -05:00
CAF_PDM_InitFieldNoDefault ( & m_holoLensExportFolder , " holoLensExportFolder " , " HoloLens Export Folder " , " " , " " , " " ) ;
m_holoLensExportFolder . uiCapability ( ) - > setUiLabelPosition ( caf : : PdmUiItemInfo : : TOP ) ;
m_holoLensExportFolder . uiCapability ( ) - > setUiEditorTypeName ( caf : : PdmUiFilePathEditor : : uiEditorTypeName ( ) ) ;
2019-01-15 03:01:01 -06:00
CAF_PDM_InitField ( & holoLensDisableCertificateVerification , " holoLensDisableCertificateVerification " , false , " Disable SSL Certificate Verification (HoloLens) " , " " , " " , " " ) ;
holoLensDisableCertificateVerification . uiCapability ( ) - > setUiLabelPosition ( caf : : PdmUiItemInfo : : HIDDEN ) ;
2019-02-15 02:07:13 -06:00
CAF_PDM_InitField ( & m_showProjectChangedDialog , " showProjectChangedDialog " , true , " Show 'Project has changed' dialog " , " " , " " , " " ) ;
m_showProjectChangedDialog . uiCapability ( ) - > setUiLabelPosition ( caf : : PdmUiItemInfo : : HIDDEN ) ;
2017-08-29 01:27:42 -05:00
CAF_PDM_InitFieldNoDefault ( & m_readerSettings , " readerSettings " , " Reader Settings " , " " , " " , " " ) ;
m_readerSettings = new RifReaderSettings ;
2016-08-09 06:09:08 -05:00
m_tabNames < < " General " ;
2017-04-27 06:16:44 -05:00
m_tabNames < < " Eclipse " ;
2019-05-20 06:21:02 -05:00
m_tabNames < < " Scripting " ;
2018-09-19 07:43:06 -05:00
if ( RiaApplication : : enableDevelopmentFeatures ( ) )
{
m_tabNames < < " System " ;
}
2012-05-18 02:45:23 -05:00
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
2013-03-22 09:50:44 -05:00
RiaPreferences : : ~ RiaPreferences ( void )
2012-05-18 02:45:23 -05:00
{
2017-08-29 01:27:42 -05:00
delete m_readerSettings ;
2012-05-18 02:45:23 -05:00
}
2012-06-26 09:10:41 -05:00
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
2013-03-22 09:50:44 -05:00
void RiaPreferences : : defineEditorAttribute ( const caf : : PdmFieldHandle * field , QString uiConfigName , caf : : PdmUiEditorAttribute * attribute )
2012-06-26 09:10:41 -05:00
{
2017-08-29 01:27:42 -05:00
m_readerSettings - > defineEditorAttribute ( field , uiConfigName , attribute ) ;
2014-07-30 02:13:47 -05:00
2013-04-24 00:35:31 -05:00
if ( field = = & scriptDirectories )
2012-06-26 09:10:41 -05:00
{
2017-04-25 03:31:37 -05:00
caf : : PdmUiFilePathEditorAttribute * myAttr = dynamic_cast < caf : : PdmUiFilePathEditorAttribute * > ( attribute ) ;
2012-06-26 09:10:41 -05:00
if ( myAttr )
{
myAttr - > m_selectDirectory = true ;
2013-04-24 00:35:31 -05:00
myAttr - > m_appendUiSelectedFolderToText = true ;
2012-06-26 09:10:41 -05:00
}
}
2014-07-30 02:13:47 -05:00
else if ( field = = & octaveShowHeaderInfoWhenExecutingScripts | |
2014-10-24 04:38:47 -05:00
field = = & autocomputeDepthRelatedProperties | |
2015-09-22 01:39:53 -05:00
field = = & loadAndShowSoil | |
field = = & useShaders | |
field = = & showHud | |
2018-09-19 07:43:06 -05:00
field = = & m_appendClassNameToUiText | |
field = = & m_appendFieldKeywordToToolTipText | |
field = = & m_showTestToolbar | |
field = = & m_includeFractureDebugInfoFile | |
2019-01-15 03:01:01 -06:00
field = = & showLasCurveWithoutTvdWarning | |
2019-02-15 02:07:13 -06:00
field = = & holoLensDisableCertificateVerification | |
field = = & m_showProjectChangedDialog | |
2019-04-10 05:49:20 -05:00
field = = & showLegendBackground )
2014-07-22 05:10:51 -05:00
{
2017-04-25 03:31:37 -05:00
caf : : PdmUiCheckBoxEditorAttribute * myAttr = dynamic_cast < caf : : PdmUiCheckBoxEditorAttribute * > ( attribute ) ;
2014-07-22 05:10:51 -05:00
if ( myAttr )
{
myAttr - > m_useNativeCheckBoxLabel = true ;
}
}
2018-10-25 02:25:53 -05:00
else if ( field = = & m_holoLensExportFolder )
{
caf : : PdmUiFilePathEditorAttribute * myAttr = dynamic_cast < caf : : PdmUiFilePathEditorAttribute * > ( attribute ) ;
if ( myAttr )
{
myAttr - > m_selectDirectory = true ;
}
}
2019-04-14 08:40:37 -05:00
if ( field = = & defaultSceneFontSize | | field = = & defaultWellLabelFontSize | |
field = = & defaultAnnotationFontSize | | field = = & defaultPlotFontSize )
{
caf : : PdmUiComboBoxEditorAttribute * myAttr = dynamic_cast < caf : : PdmUiComboBoxEditorAttribute * > ( attribute ) ;
myAttr - > minimumContentsLength = 2 ;
}
2012-06-26 09:10:41 -05:00
}
2012-10-12 08:05:42 -05:00
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
2013-04-08 05:16:38 -05:00
void RiaPreferences : : defineUiOrdering ( QString uiConfigName , caf : : PdmUiOrdering & uiOrdering )
2012-10-12 08:05:42 -05:00
{
2016-08-09 06:09:08 -05:00
if ( uiConfigName = = m_tabNames [ 0 ] )
{
2019-04-10 05:49:20 -05:00
caf : : PdmUiGroup * colorGroup = uiOrdering . addNewGroup ( " Default Colors " ) ;
colorGroup - > add ( & defaultViewerBackgroundColor ) ;
2019-04-14 08:40:37 -05:00
colorGroup - > add ( & defaultGridLineColors , false ) ;
2019-04-10 05:49:20 -05:00
colorGroup - > add ( & defaultFaultGridLineColors ) ;
2019-04-14 08:40:37 -05:00
colorGroup - > add ( & defaultWellLabelColor , false ) ;
2019-04-10 05:49:20 -05:00
caf : : PdmUiGroup * fontGroup = uiOrdering . addNewGroup ( " Default Font Sizes " ) ;
2019-04-10 09:13:40 -05:00
fontGroup - > add ( & defaultSceneFontSize ) ;
2019-04-10 05:49:20 -05:00
fontGroup - > add ( & defaultAnnotationFontSize , false ) ;
fontGroup - > add ( & defaultWellLabelFontSize ) ;
fontGroup - > add ( & defaultPlotFontSize , false ) ;
2019-04-14 08:40:37 -05:00
2019-04-10 05:49:20 -05:00
caf : : PdmUiGroup * viewsGroup = uiOrdering . addNewGroup ( " 3d Views " ) ;
viewsGroup - > add ( & defaultMeshModeType ) ;
2016-08-09 06:21:59 -05:00
viewsGroup - > add ( & navigationPolicy ) ;
2019-04-10 05:49:20 -05:00
viewsGroup - > add ( & defaultScaleFactorZ ) ;
viewsGroup - > add ( & showLegendBackground ) ;
2016-08-09 06:21:59 -05:00
viewsGroup - > add ( & useShaders ) ;
viewsGroup - > add ( & showHud ) ;
2019-04-10 05:49:20 -05:00
2017-04-27 06:16:44 -05:00
caf : : PdmUiGroup * otherGroup = uiOrdering . addNewGroup ( " Other " ) ;
otherGroup - > add ( & ssihubAddress ) ;
otherGroup - > add ( & showLasCurveWithoutTvdWarning ) ;
2019-01-15 03:01:01 -06:00
otherGroup - > add ( & holoLensDisableCertificateVerification ) ;
2017-04-27 06:16:44 -05:00
}
else if ( uiConfigName = = m_tabNames [ 1 ] )
{
caf : : PdmUiGroup * newCaseBehaviourGroup = uiOrdering . addNewGroup ( " Behavior When Loading Data " ) ;
2016-08-09 06:21:59 -05:00
newCaseBehaviourGroup - > add ( & autocomputeDepthRelatedProperties ) ;
newCaseBehaviourGroup - > add ( & loadAndShowSoil ) ;
2014-07-30 02:13:47 -05:00
2017-08-29 01:27:42 -05:00
m_readerSettings - > defineUiOrdering ( uiConfigName , * newCaseBehaviourGroup ) ;
2019-04-14 08:40:37 -05:00
2018-05-15 08:08:02 -05:00
caf : : PdmUiGroup * restartBehaviourGroup = uiOrdering . addNewGroup ( " Origin Files " ) ;
2018-04-09 06:21:48 -05:00
restartBehaviourGroup - > add ( & summaryRestartFilesShowImportDialog ) ;
2019-06-21 02:11:10 -05:00
{
caf : : PdmUiGroup * group = restartBehaviourGroup - > addNewGroup ( " Origin Summary Files " ) ;
group - > add ( & summaryImportMode ) ;
}
{
caf : : PdmUiGroup * group = restartBehaviourGroup - > addNewGroup ( " Origin Grid Files " ) ;
group - > add ( & gridImportMode ) ;
}
{
caf : : PdmUiGroup * group = restartBehaviourGroup - > addNewGroup ( " Origin Ensemble Summary Files " ) ;
group - > add ( & summaryEnsembleImportMode ) ;
}
2016-08-09 06:09:08 -05:00
}
2017-04-27 06:16:44 -05:00
else if ( uiConfigName = = m_tabNames [ 2 ] )
2014-07-30 02:13:47 -05:00
{
2019-05-20 06:21:02 -05:00
# ifdef ENABLE_GRPC
caf : : PdmUiGroup * grpcGroup = uiOrdering . addNewGroup ( " gRPC Server " ) ;
grpcGroup - > add ( & enableGrpcServer ) ;
grpcGroup - > add ( & defaultGrpcPortNumber ) ;
# endif
2016-08-09 06:21:59 -05:00
caf : : PdmUiGroup * octaveGroup = uiOrdering . addNewGroup ( " Octave " ) ;
octaveGroup - > add ( & octaveExecutable ) ;
octaveGroup - > add ( & octaveShowHeaderInfoWhenExecutingScripts ) ;
caf : : PdmUiGroup * scriptGroup = uiOrdering . addNewGroup ( " Script files " ) ;
scriptGroup - > add ( & scriptDirectories ) ;
scriptGroup - > add ( & scriptEditorExecutable ) ;
2014-07-30 02:13:47 -05:00
}
2018-09-19 07:43:06 -05:00
else if ( RiaApplication : : enableDevelopmentFeatures ( ) & & uiConfigName = = m_tabNames [ 3 ] )
2017-09-21 05:05:45 -05:00
{
2018-09-19 07:43:06 -05:00
uiOrdering . add ( & m_appendClassNameToUiText ) ;
uiOrdering . add ( & m_appendFieldKeywordToToolTipText ) ;
2019-02-15 02:07:13 -06:00
uiOrdering . add ( & m_showProjectChangedDialog ) ;
2018-09-19 07:43:06 -05:00
uiOrdering . add ( & m_showTestToolbar ) ;
uiOrdering . add ( & m_includeFractureDebugInfoFile ) ;
2018-10-25 02:25:53 -05:00
uiOrdering . add ( & m_holoLensExportFolder ) ;
2017-09-21 05:05:45 -05:00
}
2016-08-09 06:09:08 -05:00
2017-03-21 07:47:53 -05:00
uiOrdering . skipRemainingFields ( true ) ;
2016-08-09 06:09:08 -05:00
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QList < caf : : PdmOptionItemInfo > RiaPreferences : : calculateValueOptions ( const caf : : PdmFieldHandle * fieldNeedingOptions , bool * useOptionsOnly )
{
QList < caf : : PdmOptionItemInfo > options ;
* useOptionsOnly = true ;
2019-02-04 07:23:16 -06:00
if ( fieldNeedingOptions = = & gridImportMode )
2018-04-13 08:44:28 -05:00
{
// Manual option handling in order to one only a subset of the enum values
SummaryRestartFilesImportModeType skip ( RiaPreferences : : NOT_IMPORT ) ;
SummaryRestartFilesImportModeType separate ( RiaPreferences : : SEPARATE_CASES ) ;
options . push_back ( caf : : PdmOptionItemInfo ( skip . uiText ( ) , RiaPreferences : : NOT_IMPORT ) ) ;
options . push_back ( caf : : PdmOptionItemInfo ( separate . uiText ( ) , RiaPreferences : : SEPARATE_CASES ) ) ;
}
2019-06-21 02:11:10 -05:00
else if ( fieldNeedingOptions = = & summaryEnsembleImportMode )
{
// Manual option handling in order to one only a subset of the enum values
SummaryRestartFilesImportModeType skip ( RiaPreferences : : NOT_IMPORT ) ;
SummaryRestartFilesImportModeType allowImport ( RiaPreferences : : IMPORT ) ;
options . push_back ( caf : : PdmOptionItemInfo ( skip . uiText ( ) , RiaPreferences : : NOT_IMPORT ) ) ;
options . push_back ( caf : : PdmOptionItemInfo ( allowImport . uiText ( ) , RiaPreferences : : IMPORT ) ) ;
}
2016-08-09 06:09:08 -05:00
return options ;
2012-10-12 08:05:42 -05:00
}
2019-05-13 06:47:03 -05:00
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaPreferences : : initAfterRead ( )
{
// If the stored font size is larger than the maximum enum value, the stored font size is actually point size
int defaultSceneFontEnumValue = static_cast < int > ( defaultSceneFontSize . v ( ) ) ;
if ( defaultSceneFontEnumValue > ( int ) RiaFontCache : : MAX_FONT_SIZE )
{
defaultSceneFontSize = RiaFontCache : : fontSizeEnumFromPointSize ( defaultSceneFontEnumValue ) ;
}
}
2016-08-09 06:09:08 -05:00
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QStringList RiaPreferences : : tabNames ( )
{
return m_tabNames ;
}
2017-08-29 01:27:42 -05:00
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const RifReaderSettings * RiaPreferences : : readerSettings ( ) const
{
return m_readerSettings ;
}
2018-09-19 07:43:06 -05:00
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RiaPreferences : : appendClassNameToUiText ( ) const
{
return RiaApplication : : enableDevelopmentFeatures ( ) & & m_appendClassNameToUiText ( ) ;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RiaPreferences : : appendFieldKeywordToToolTipText ( ) const
{
return RiaApplication : : enableDevelopmentFeatures ( ) & & m_appendFieldKeywordToToolTipText ( ) ;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RiaPreferences : : showTestToolbar ( ) const
{
return RiaApplication : : enableDevelopmentFeatures ( ) & & m_showTestToolbar ( ) ;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RiaPreferences : : includeFractureDebugInfoFile ( ) const
{
return RiaApplication : : enableDevelopmentFeatures ( ) & & m_includeFractureDebugInfoFile ( ) ;
}
2019-02-15 02:07:13 -06:00
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RiaPreferences : : showProjectChangedDialog ( ) const
{
if ( ! RiaApplication : : enableDevelopmentFeatures ( ) )
{
return true ;
}
return m_showProjectChangedDialog ( ) ;
}
2018-10-25 02:25:53 -05:00
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RiaPreferences : : holoLensExportFolder ( ) const
{
return m_holoLensExportFolder ( ) ;
}
2019-04-10 09:13:40 -05:00
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std : : map < RiaDefines : : FontSettingType , RiaFontCache : : FontSize > RiaPreferences : : defaultFontSizes ( ) const
{
std : : map < RiaDefines : : FontSettingType , RiaFontCache : : FontSize > fontSizes ;
fontSizes [ RiaDefines : : SCENE_FONT ] = defaultSceneFontSize ( ) ;
fontSizes [ RiaDefines : : ANNOTATION_FONT ] = defaultAnnotationFontSize ( ) ;
fontSizes [ RiaDefines : : WELL_LABEL_FONT ] = defaultWellLabelFontSize ( ) ;
fontSizes [ RiaDefines : : PLOT_FONT ] = defaultPlotFontSize ( ) ;
return fontSizes ;
}