From bb674e7504f5df79bf58a68e8e5af7105f28241f Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 25 Oct 2018 09:25:53 +0200 Subject: [PATCH] #3557 HoloLens : Add export folder to preferences --- .../Application/RiaPreferences.cpp | 21 +++++++++++++++++++ ApplicationCode/Application/RiaPreferences.h | 2 ++ 2 files changed, 23 insertions(+) diff --git a/ApplicationCode/Application/RiaPreferences.cpp b/ApplicationCode/Application/RiaPreferences.cpp index 30fe04bb27..5431f8f102 100644 --- a/ApplicationCode/Application/RiaPreferences.cpp +++ b/ApplicationCode/Application/RiaPreferences.cpp @@ -105,6 +105,10 @@ RiaPreferences::RiaPreferences(void) 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", "", "", ""); + 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_InitFieldNoDefault(&m_readerSettings, "readerSettings", "Reader Settings", "", "", ""); m_readerSettings = new RifReaderSettings; @@ -158,6 +162,14 @@ void RiaPreferences::defineEditorAttribute(const caf::PdmFieldHandle* field, QSt myAttr->m_useNativeCheckBoxLabel = true; } } + else if (field == &m_holoLensExportFolder) + { + caf::PdmUiFilePathEditorAttribute* myAttr = dynamic_cast(attribute); + if (myAttr) + { + myAttr->m_selectDirectory = true; + } + } } //-------------------------------------------------------------------------------------------------- @@ -219,6 +231,7 @@ void RiaPreferences::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering.add(&m_appendFieldKeywordToToolTipText); uiOrdering.add(&m_showTestToolbar); uiOrdering.add(&m_includeFractureDebugInfoFile); + uiOrdering.add(&m_holoLensExportFolder); } uiOrdering.skipRemainingFields(true); @@ -307,3 +320,11 @@ bool RiaPreferences::includeFractureDebugInfoFile() const return RiaApplication::enableDevelopmentFeatures() && m_includeFractureDebugInfoFile(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RiaPreferences::holoLensExportFolder() const +{ + return m_holoLensExportFolder(); +} + diff --git a/ApplicationCode/Application/RiaPreferences.h b/ApplicationCode/Application/RiaPreferences.h index df2eac9e04..eba31f902e 100644 --- a/ApplicationCode/Application/RiaPreferences.h +++ b/ApplicationCode/Application/RiaPreferences.h @@ -52,6 +52,7 @@ public: bool appendFieldKeywordToToolTipText() const; bool showTestToolbar() const; bool includeFractureDebugInfoFile() const; + QString holoLensExportFolder() const; public: // Pdm Fields caf::PdmField > navigationPolicy; @@ -97,5 +98,6 @@ private: caf::PdmField m_appendFieldKeywordToToolTipText; caf::PdmField m_showTestToolbar; caf::PdmField m_includeFractureDebugInfoFile; + caf::PdmField m_holoLensExportFolder; QStringList m_tabNames; };