#5505 Progress Bar : Control visibility of progress bar in Preferences

This commit is contained in:
Magne Sjaastad 2020-02-11 07:39:43 +01:00
parent 36a3a7c0ed
commit c31e4cbaaf
5 changed files with 26 additions and 1 deletions

View File

@ -1205,6 +1205,8 @@ void RiaApplication::applyPreferences()
this->project()->updateConnectedEditors();
}
caf::ProgressInfoStatic::setEnabled( m_preferences->showProgressBar() );
m_preferences->writePreferencesToApplicationStore();
}

View File

@ -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<caf::PdmUiCheckBoxEditorAttribute*>( 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;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -102,6 +102,7 @@ public:
void setDefaultPlotTemplatePath( const QString& templatePath );
bool showSummaryTimeAsLongString() const;
bool useMultipleThreadsWhenReadingSummaryData() const;
bool showProgressBar() const;
std::map<RiaDefines::FontSettingType, RiaFontCache::FontSize> defaultFontSizes() const;
@ -197,6 +198,7 @@ private:
caf::PdmField<QString> m_timeFormat;
caf::PdmField<bool> m_showSummaryTimeAsLongString;
caf::PdmField<bool> m_useMultipleThreadsWhenLoadingSummaryData;
caf::PdmField<bool> m_showProgressBar;
caf::PdmField<PageSizeEnum> m_pageSize;
caf::PdmField<PageOrientationEnum> m_pageOrientation;

View File

@ -672,6 +672,14 @@ namespace caf {
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void ProgressInfoStatic::setEnabled(bool enable)
{
s_disabled = !enable;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -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();