///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2019- Equinor ASA // Copyright (C) 2011-2018 Statoil ASA // Copyright (C) 2013- Ceetron Solutions AS // Copyright (C) 2011-2012 Ceetron AS // // 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 // for more details. // ///////////////////////////////////////////////////////////////////////////////// #pragma once #include "RiaDefines.h" #include "RiaFontCache.h" #include "RiaGuiApplication.h" #include "RiaQDateTimeTools.h" #include "cafAppEnum.h" #include "cafPdmChildField.h" #include "cafPdmField.h" #include "cafPdmObject.h" // Include to make Pdm work for cvf::Color #include "cafPdmFieldCvfColor.h" #include #include #include #include class RifReaderSettings; //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- class RiaPreferences : public caf::PdmObject { CAF_PDM_HEADER_INIT; public: using DateFormatComponents = RiaQDateTimeTools::DateFormatComponents; using TimeFormatComponents = RiaQDateTimeTools::TimeFormatComponents; enum class SummaryRestartFilesImportMode { IMPORT, NOT_IMPORT, SEPARATE_CASES }; typedef caf::AppEnum SummaryRestartFilesImportModeType; typedef RiaFontCache::FontSizeEnum FontSizeEnum; enum class SummaryHistoryCurveStyleMode { SYMBOLS, LINES, SYMBOLS_AND_LINES }; typedef caf::AppEnum SummaryHistoryCurveStyleModeType; typedef caf::AppEnum PageSizeEnum; typedef caf::AppEnum PageOrientationEnum; bool enableFaultsByDefault() const; public: RiaPreferences( void ); ~RiaPreferences( void ) override; static RiaPreferences* current(); QStringList tabNames(); const RifReaderSettings* readerSettings() const; // Debug settings bool appendClassNameToUiText() const; bool appendFieldKeywordToToolTipText() const; bool showViewIdInProjectTree() const; bool showTestToolbar() const; bool includeFractureDebugInfoFile() const; bool showProjectChangedDialog() const; QString holoLensExportFolder() const; bool useShaders() const; bool show3dInformation() const; QString gtestFilter() const; const QString& dateFormat() const; const QString& timeFormat() const; QString dateTimeFormat( DateFormatComponents dateComponents = DateFormatComponents::DATE_FORMAT_YEAR_MONTH_DAY, TimeFormatComponents timeComponents = TimeFormatComponents::TIME_FORMAT_HOUR_MINUTE_SECOND ) const; bool searchPlotTemplateFoldersRecursively() const; QStringList plotTemplateFolders() const; void appendPlotTemplateFolders( const QString& folder ); QString defaultPlotTemplateAbsolutePath() const; void setDefaultPlotTemplatePath( const QString& templatePath ); bool showSummaryTimeAsLongString() const; bool useMultipleThreadsWhenReadingSummaryData() const; bool showProgressBar() const; bool openExportedPdfInViewer() const; RiaDefines::ThemeEnum guiTheme() const; std::map defaultFontSizes() const; void writePreferencesToApplicationStore(); QPageLayout defaultPageLayout() const; QMarginsF margins() const; double surfaceImportResamplingDistance() const; // 3D view RiaDefines::MeshModeType defaultMeshModeType() const; RiaGuiApplication::RINavigationPolicy navigationPolicy() const; int defaultScaleFactorZ() const; bool showLegendBackground() const; bool showInfoBox() const; bool showGridBox() const; public: // Pdm Fields caf::PdmField enableGrpcServer; caf::PdmField defaultGrpcPortNumber; caf::PdmField scriptDirectories; caf::PdmField scriptEditorExecutable; caf::PdmField octaveExecutable; caf::PdmField octaveShowHeaderInfoWhenExecutingScripts; caf::PdmField pythonExecutable; caf::PdmField showPythonDebugInfo; caf::PdmField ssihubAddress; caf::PdmField defaultGridLineColors; caf::PdmField defaultFaultGridLineColors; caf::PdmField defaultViewerBackgroundColor; caf::PdmField defaultWellLabelColor; caf::PdmField showLasCurveWithoutTvdWarning; caf::PdmField defaultSceneFontSize; caf::PdmField defaultWellLabelFontSize; caf::PdmField defaultAnnotationFontSize; caf::PdmField defaultPlotFontSize; caf::PdmField lastUsedProjectFileName; caf::PdmField autocomputeDepthRelatedProperties; caf::PdmField loadAndShowSoil; caf::PdmField summaryRestartFilesShowImportDialog; caf::PdmField summaryImportMode; caf::PdmField gridImportMode; caf::PdmField summaryEnsembleImportMode; caf::PdmField defaultSummaryCurvesTextFilter; caf::PdmField defaultSummaryHistoryCurveStyle; caf::PdmField holoLensDisableCertificateVerification; caf::PdmField csvTextExportFieldSeparator; protected: void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override; void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; QList calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly ) override; void initAfterRead() override; void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; private: static QString tabNameGeneral(); static QString tabNameEclipse(); static QString tabNamePlotting(); static QString tabNameScripting(); static QString tabNameExport(); static QString tabNameSystem(); static QString tabNameImport(); static double defaultMarginSize( QPageSize::PageSizeId pageSizeId ); private: caf::PdmChildField m_readerSettings; caf::PdmField m_appendClassNameToUiText; caf::PdmField m_appendFieldKeywordToToolTipText; caf::PdmField m_showViewIdInProjectTree; caf::PdmField m_useShaders; caf::PdmField m_showHud; caf::PdmField m_showProjectChangedDialog; caf::PdmField m_showTestToolbar; caf::PdmField m_includeFractureDebugInfoFile; caf::PdmField m_holoLensExportFolder; caf::PdmField m_dateFormat; caf::PdmField m_timeFormat; caf::PdmField m_showSummaryTimeAsLongString; caf::PdmField m_useMultipleThreadsWhenLoadingSummaryData; caf::PdmField m_showProgressBar; caf::PdmField m_gtestFilter; caf::PdmField> m_guiTheme; caf::PdmField m_pageSize; caf::PdmField m_pageOrientation; caf::PdmField m_pageLeftMargin; caf::PdmField m_pageRightMargin; caf::PdmField m_pageTopMargin; caf::PdmField m_pageBottomMargin; caf::PdmField m_openExportedPdfInViewer; caf::PdmField m_plotTemplateFolders; caf::PdmField m_searchPlotTemplateFoldersRecursively; caf::PdmField m_defaultPlotTemplate; // Surface Import caf::PdmField m_surfaceImportResamplingDistance; // 3d view caf::PdmField> m_defaultMeshModeType; caf::PdmField> m_navigationPolicy; caf::PdmField m_defaultScaleFactorZ; caf::PdmField m_showLegendBackground; caf::PdmField m_enableFaultsByDefault; caf::PdmField m_showInfoBox; caf::PdmField m_showGridBox; QStringList m_tabNames; };