diff --git a/ApplicationCode/Application/RiaApplication.cpp b/ApplicationCode/Application/RiaApplication.cpp index 3583f4138a..7c00c062e9 100644 --- a/ApplicationCode/Application/RiaApplication.cpp +++ b/ApplicationCode/Application/RiaApplication.cpp @@ -1205,6 +1205,8 @@ void RiaApplication::applyPreferences() this->project()->updateConnectedEditors(); } + caf::ProgressInfoStatic::setEnabled( m_preferences->showProgressBar() ); + m_preferences->writePreferencesToApplicationStore(); } diff --git a/ApplicationCode/Application/RiaPreferences.cpp b/ApplicationCode/Application/RiaPreferences.cpp index a41b7d44ee..1173295fe4 100644 --- a/ApplicationCode/Application/RiaPreferences.cpp +++ b/ApplicationCode/Application/RiaPreferences.cpp @@ -338,6 +338,9 @@ RiaPreferences::RiaPreferences( void ) m_timeFormat.uiCapability()->setUiEditorTypeName( caf::PdmUiComboBoxEditor::uiEditorTypeName() ); m_timeFormat = RiaQDateTimeTools::supportedTimeFormats().front(); + CAF_PDM_InitField( &m_showProgressBar, "showProgressBar", true, "Show Progress Bar", "", "", "" ); + m_showProgressBar.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN ); + CAF_PDM_InitFieldNoDefault( &m_plotTemplateFolders, "plotTemplateFolders", "Plot Template Folder(s)", "", "", "" ); m_plotTemplateFolders.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() ); CAF_PDM_InitField( &m_searchPlotTemplateFoldersRecursively, @@ -439,7 +442,7 @@ void RiaPreferences::defineEditorAttribute( const caf::PdmFieldHandle* field, field == &m_showProjectChangedDialog || field == &m_searchPlotTemplateFoldersRecursively || field == &m_showLegendBackground || field == &m_showSummaryTimeAsLongString || field == &m_showViewIdInProjectTree || field == &m_useMultipleThreadsWhenLoadingSummaryData || - field == &m_enableFaultsByDefault ) + field == &m_enableFaultsByDefault || field == &m_showProgressBar ) { caf::PdmUiCheckBoxEditorAttribute* myAttr = dynamic_cast( attribute ); if ( myAttr ) @@ -588,6 +591,7 @@ void RiaPreferences::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& group->add( &m_showHud ); } + uiOrdering.add( &m_showProgressBar ); uiOrdering.add( &m_showProjectChangedDialog ); uiOrdering.add( &m_showTestToolbar ); uiOrdering.add( &m_includeFractureDebugInfoFile ); @@ -961,6 +965,14 @@ bool RiaPreferences::useMultipleThreadsWhenReadingSummaryData() const return m_useMultipleThreadsWhenLoadingSummaryData; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RiaPreferences::showProgressBar() const +{ + return m_showProgressBar; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/Application/RiaPreferences.h b/ApplicationCode/Application/RiaPreferences.h index f408f6794b..a4b77ad949 100644 --- a/ApplicationCode/Application/RiaPreferences.h +++ b/ApplicationCode/Application/RiaPreferences.h @@ -102,6 +102,7 @@ public: void setDefaultPlotTemplatePath( const QString& templatePath ); bool showSummaryTimeAsLongString() const; bool useMultipleThreadsWhenReadingSummaryData() const; + bool showProgressBar() const; std::map defaultFontSizes() const; @@ -197,6 +198,7 @@ private: caf::PdmField m_timeFormat; caf::PdmField m_showSummaryTimeAsLongString; caf::PdmField m_useMultipleThreadsWhenLoadingSummaryData; + caf::PdmField m_showProgressBar; caf::PdmField m_pageSize; caf::PdmField m_pageOrientation; diff --git a/Fwk/AppFwk/cafUserInterface/cafProgressInfo.cpp b/Fwk/AppFwk/cafUserInterface/cafProgressInfo.cpp index 872b48430a..fc3409d5d7 100644 --- a/Fwk/AppFwk/cafUserInterface/cafProgressInfo.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafProgressInfo.cpp @@ -672,6 +672,14 @@ namespace caf { } } + //-------------------------------------------------------------------------------------------------- + /// + //-------------------------------------------------------------------------------------------------- + void ProgressInfoStatic::setEnabled(bool enable) + { + s_disabled = !enable; + } + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/Fwk/AppFwk/cafUserInterface/cafProgressInfo.h b/Fwk/AppFwk/cafUserInterface/cafProgressInfo.h index 63e093d20f..514ad651b6 100644 --- a/Fwk/AppFwk/cafUserInterface/cafProgressInfo.h +++ b/Fwk/AppFwk/cafUserInterface/cafProgressInfo.h @@ -87,6 +87,7 @@ public: static void setNextProgressIncrement(size_t nextStepSize); static bool isRunning(); static void finished(); + static void setEnabled(bool enable); private: static bool isUpdatePossible();