MCPcopy Create free account
hub / github.com/MrKepzie/Natron / warnChangedKnobs

Method warnChangedKnobs

Engine/Settings.cpp:1719–1767  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1717} // setDefaultValues
1718
1719void
1720Settings::warnChangedKnobs(const std::vector<KnobI*>& knobs)
1721{
1722 bool didFontWarn = false;
1723 bool didOCIOWarn = false;
1724 bool didOFXCacheWarn = false;
1725
1726 for (U32 i = 0; i < knobs.size(); ++i) {
1727 if ( ( ( knobs[i] == _fontSize.get() ) ||
1728 ( knobs[i] == _systemFontChoice.get() ) )
1729 && !didFontWarn ) {
1730 didFontWarn = true;
1731 Dialogs::warningDialog( tr("Font change").toStdString(),
1732 tr("Changing the font requires a restart of %1.").arg( QString::fromUtf8(NATRON_APPLICATION_NAME) ).toStdString() );
1733 } else if ( ( ( knobs[i] == _ocioConfigKnob.get() ) ||
1734 ( knobs[i] == _customOcioConfigFile.get() ) )
1735 && !didOCIOWarn ) {
1736 didOCIOWarn = true;
1737 bool warnOcioChanged = _warnOcioConfigKnobChanged->getValue();
1738 if (warnOcioChanged) {
1739 bool stopAsking = false;
1740 Dialogs::warningDialog(tr("OCIO config changed").toStdString(),
1741 tr("The OpenColorIO config change requires a restart of %1 to be effective.").arg( QString::fromUtf8(NATRON_APPLICATION_NAME) ).toStdString(), &stopAsking);
1742 if (stopAsking) {
1743 _warnOcioConfigKnobChanged->setValue(false);
1744 saveSetting( _warnOcioConfigKnobChanged.get() );
1745 }
1746 }
1747 } else if ( knobs[i] == _texturesMode.get() ) {
1748 AppInstanceVec apps = appPTR->getAppInstances();
1749 for (AppInstanceVec::iterator it = apps.begin(); it != apps.end(); ++it) {
1750 std::list<ViewerInstance*> allViewers;
1751 (*it)->getProject()->getViewers(&allViewers);
1752 for (std::list<ViewerInstance*>::iterator it = allViewers.begin(); it != allViewers.end(); ++it) {
1753 (*it)->renderCurrentFrame(true);
1754 }
1755 }
1756 } else if ( ( ( knobs[i] == _loadBundledPlugins.get() ) ||
1757 ( knobs[i] == _preferBundledPlugins.get() ) ||
1758 ( knobs[i] == _useStdOFXPluginsLocation.get() ) ||
1759 ( knobs[i] == _extraPluginPaths.get() ) )
1760 && !didOFXCacheWarn ) {
1761 didOFXCacheWarn = true;
1762 appPTR->clearPluginsLoadedCache(); // clear the cache for next restart
1763 Dialogs::warningDialog( tr("OpenFX plugins path changed").toStdString(),
1764 tr("The OpenFX plugins path change requires a restart of %1 to be effective.").arg( QString::fromUtf8(NATRON_APPLICATION_NAME) ).toStdString() );
1765 }
1766 }
1767} // Settings::warnChangedKnobs
1768
1769void
1770Settings::saveAllSettings()

Callers

nothing calls this directly

Calls 12

saveSettingFunction · 0.85
toStdStringMethod · 0.80
getViewersMethod · 0.80
getProjectMethod · 0.80
sizeMethod · 0.45
getMethod · 0.45
getValueMethod · 0.45
setValueMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
renderCurrentFrameMethod · 0.45

Tested by

no test coverage detected