mirror of
https://github.com/OPM/ResInsight.git
synced 2026-08-02 09:39:37 -05:00
#8142 Preferences : Move system settings into separate file
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
#include "RiaColorTables.h"
|
||||
#include "RiaPreferencesGeoMech.h"
|
||||
#include "RiaPreferencesSummary.h"
|
||||
#include "RiaPreferencesSystem.h"
|
||||
#include "RiaValidRegExpValidator.h"
|
||||
|
||||
#include "RifReaderSettings.h"
|
||||
@@ -173,37 +174,6 @@ RiaPreferences::RiaPreferences()
|
||||
CAF_PDM_InitFieldNoDefault( &defaultWellLabelFontSize, "defaultWellLabelFontSizePt", "Well Label Font Size", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &defaultPlotFontSize, "defaultPlotFontSizePt", "Plot Font Size", "", "", "" );
|
||||
|
||||
CAF_PDM_InitField( &m_useShaders, "useShaders", true, "Use Shaders", "", "", "" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_useShaders );
|
||||
CAF_PDM_InitField( &m_showHud, "showHud", false, "Show 3D Information", "", "", "" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_showHud );
|
||||
CAF_PDM_InitField( &m_appendClassNameToUiText, "appendClassNameToUiText", false, "Show Class Names", "", "", "" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_appendClassNameToUiText );
|
||||
|
||||
CAF_PDM_InitField( &m_appendFieldKeywordToToolTipText,
|
||||
"appendFieldKeywordToToolTipText",
|
||||
false,
|
||||
"Show Field Keyword in ToolTip",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_appendFieldKeywordToToolTipText );
|
||||
|
||||
CAF_PDM_InitField( &m_showViewIdInProjectTree, "showViewIdInTree", false, "Show View Id in Project Tree", "", "", "" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_showViewIdInProjectTree );
|
||||
|
||||
CAF_PDM_InitField( &m_showTestToolbar, "showTestToolbar", false, "Enable Test Toolbar", "", "", "" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_showTestToolbar );
|
||||
|
||||
CAF_PDM_InitField( &m_includeFractureDebugInfoFile,
|
||||
"includeFractureDebugInfoFile",
|
||||
false,
|
||||
"Include Fracture Debug Info for Completion Export",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_includeFractureDebugInfoFile );
|
||||
|
||||
CAF_PDM_InitField( &m_showLegendBackground, "showLegendBackground", true, "Show Box around Legends", "", "", "" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_showLegendBackground );
|
||||
|
||||
@@ -231,10 +201,6 @@ RiaPreferences::RiaPreferences()
|
||||
CAF_PDM_InitField( &loadAndShowSoil, "loadAndShowSoil", true, "Load and Show SOIL", "", "", "" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &loadAndShowSoil );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_holoLensExportFolder, "holoLensExportFolder", "HoloLens Export Folder", "", "", "" );
|
||||
m_holoLensExportFolder.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::TOP );
|
||||
m_holoLensExportFolder.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() );
|
||||
|
||||
CAF_PDM_InitField( &holoLensDisableCertificateVerification,
|
||||
"holoLensDisableCertificateVerification",
|
||||
false,
|
||||
@@ -252,15 +218,6 @@ RiaPreferences::RiaPreferences()
|
||||
"",
|
||||
"" );
|
||||
|
||||
CAF_PDM_InitField( &m_showProjectChangedDialog,
|
||||
"showProjectChangedDialog",
|
||||
true,
|
||||
"Show 'Project has changed' dialog",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_showProjectChangedDialog );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_readerSettings, "readerSettings", "Reader Settings", "", "", "" );
|
||||
m_readerSettings = new RifReaderSettings;
|
||||
CAF_PDM_InitFieldNoDefault( &m_dateFormat, "dateFormat", "Date Format", "", "", "" );
|
||||
@@ -271,9 +228,6 @@ RiaPreferences::RiaPreferences()
|
||||
m_timeFormat.uiCapability()->setUiEditorTypeName( caf::PdmUiComboBoxEditor::uiEditorTypeName() );
|
||||
m_timeFormat = RiaQDateTimeTools::supportedTimeFormats().front();
|
||||
|
||||
CAF_PDM_InitField( &m_showProgressBar, "showProgressBar", true, "Show Progress Bar", "", "", "" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_showProgressBar );
|
||||
|
||||
CAF_PDM_InitField( &m_useUndoRedo, "useUndoRedo", true, "Enable Undo/Redo for Property Editor changes", "", "", "" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_useUndoRedo );
|
||||
|
||||
@@ -300,8 +254,6 @@ RiaPreferences::RiaPreferences()
|
||||
CAF_PDM_InitField( &m_openExportedPdfInViewer, "openExportedPdfInViewer", false, "Open Exported PDF in Viewer", "", "", "" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_openExportedPdfInViewer );
|
||||
|
||||
CAF_PDM_InitField( &m_gtestFilter, "gtestFilter", QString(), "Unit Test Filter (gtest)", "", "", "" );
|
||||
|
||||
CAF_PDM_InitField( &m_surfaceImportResamplingDistance,
|
||||
"SurfaceImportResamplingDistance",
|
||||
100.0,
|
||||
@@ -327,6 +279,9 @@ RiaPreferences::RiaPreferences()
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_geoMechPreferences, "geoMechPreferences", "geoMechPreferences", "", "", "" );
|
||||
m_geoMechPreferences = new RiaPreferencesGeoMech;
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_systemPreferences, "systemPreferences", "systemPreferences", "", "", "" );
|
||||
m_systemPreferences = new RiaPreferencesSystem;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -366,14 +321,6 @@ void RiaPreferences::defineEditorAttribute( const caf::PdmFieldHandle* field,
|
||||
}
|
||||
}
|
||||
|
||||
if ( field == &m_holoLensExportFolder )
|
||||
{
|
||||
caf::PdmUiFilePathEditorAttribute* myAttr = dynamic_cast<caf::PdmUiFilePathEditorAttribute*>( attribute );
|
||||
if ( myAttr )
|
||||
{
|
||||
myAttr->m_selectDirectory = true;
|
||||
}
|
||||
}
|
||||
if ( field == &defaultSceneFontSize || field == &defaultWellLabelFontSize || field == &defaultAnnotationFontSize ||
|
||||
field == &defaultPlotFontSize )
|
||||
{
|
||||
@@ -428,7 +375,6 @@ void RiaPreferences::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
|
||||
otherGroup->add( &ssihubAddress );
|
||||
otherGroup->add( &holoLensDisableCertificateVerification );
|
||||
otherGroup->add( &m_useUndoRedo );
|
||||
otherGroup->add( &m_showProgressBar );
|
||||
}
|
||||
else if ( uiConfigName == RiaPreferences::tabNameEclipseGrid() )
|
||||
{
|
||||
@@ -513,24 +459,7 @@ void RiaPreferences::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
|
||||
}
|
||||
else if ( RiaApplication::enableDevelopmentFeatures() && uiConfigName == RiaPreferences::tabNameSystem() )
|
||||
{
|
||||
{
|
||||
caf::PdmUiGroup* group = uiOrdering.addNewGroup( "Project Tree" );
|
||||
group->add( &m_appendClassNameToUiText );
|
||||
group->add( &m_appendFieldKeywordToToolTipText );
|
||||
group->add( &m_showViewIdInProjectTree );
|
||||
}
|
||||
|
||||
{
|
||||
caf::PdmUiGroup* group = uiOrdering.addNewGroup( "3D View" );
|
||||
group->add( &m_useShaders );
|
||||
group->add( &m_showHud );
|
||||
}
|
||||
|
||||
uiOrdering.add( &m_gtestFilter );
|
||||
uiOrdering.add( &m_showProjectChangedDialog );
|
||||
uiOrdering.add( &m_showTestToolbar );
|
||||
uiOrdering.add( &m_includeFractureDebugInfoFile );
|
||||
uiOrdering.add( &m_holoLensExportFolder );
|
||||
m_systemPreferences()->uiOrdering( uiConfigName, uiOrdering );
|
||||
}
|
||||
|
||||
uiOrdering.skipRemainingFields( true );
|
||||
@@ -723,96 +652,6 @@ const RifReaderSettings* RiaPreferences::readerSettings() const
|
||||
return m_readerSettings;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaPreferences::appendClassNameToUiText() const
|
||||
{
|
||||
return RiaApplication::enableDevelopmentFeatures() && m_appendClassNameToUiText();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaPreferences::appendFieldKeywordToToolTipText() const
|
||||
{
|
||||
return RiaApplication::enableDevelopmentFeatures() && m_appendFieldKeywordToToolTipText();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaPreferences::showViewIdInProjectTree() const
|
||||
{
|
||||
return RiaApplication::enableDevelopmentFeatures() && m_showViewIdInProjectTree();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaPreferences::showTestToolbar() const
|
||||
{
|
||||
return RiaApplication::enableDevelopmentFeatures() && m_showTestToolbar();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaPreferences::includeFractureDebugInfoFile() const
|
||||
{
|
||||
return RiaApplication::enableDevelopmentFeatures() && m_includeFractureDebugInfoFile();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaPreferences::showProjectChangedDialog() const
|
||||
{
|
||||
if ( !RiaApplication::enableDevelopmentFeatures() )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return m_showProjectChangedDialog();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaPreferences::holoLensExportFolder() const
|
||||
{
|
||||
return m_holoLensExportFolder();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaPreferences::useShaders() const
|
||||
{
|
||||
if ( !RiaApplication::enableDevelopmentFeatures() )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return m_useShaders();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaPreferences::show3dInformation() const
|
||||
{
|
||||
return RiaApplication::enableDevelopmentFeatures() && m_showHud();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaPreferences::gtestFilter() const
|
||||
{
|
||||
return m_gtestFilter();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -906,14 +745,6 @@ void RiaPreferences::setDefaultPlotTemplatePath( const QString& templatePath )
|
||||
m_defaultPlotTemplate = templatePath;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaPreferences::showProgressBar() const
|
||||
{
|
||||
return m_showProgressBar;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1066,6 +897,14 @@ RiaPreferencesSummary* RiaPreferences::summaryPreferences() const
|
||||
return m_summaryPreferences();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaPreferencesSystem* RiaPreferences::systemPreferences() const
|
||||
{
|
||||
return m_systemPreferences();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user