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

Method warnChangedKnobs

Engine/Settings.cpp:1759–1807  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1757} // setDefaultValues
1758
1759void
1760Settings::warnChangedKnobs(const std::vector<KnobI*>& knobs)
1761{
1762 bool didFontWarn = false;
1763 bool didOCIOWarn = false;
1764 bool didOFXCacheWarn = false;
1765
1766 for (U32 i = 0; i < knobs.size(); ++i) {
1767 if ( ( ( knobs[i] == _fontSize.get() ) ||
1768 ( knobs[i] == _systemFontChoice.get() ) )
1769 && !didFontWarn ) {
1770 didFontWarn = true;
1771 Dialogs::warningDialog( tr("Font change").toStdString(),
1772 tr("Changing the font requires a restart of %1.").arg( QString::fromUtf8(NATRON_APPLICATION_NAME) ).toStdString() );
1773 } else if ( ( ( knobs[i] == _ocioConfigKnob.get() ) ||
1774 ( knobs[i] == _customOcioConfigFile.get() ) )
1775 && !didOCIOWarn ) {
1776 didOCIOWarn = true;
1777 bool warnOcioChanged = _warnOcioConfigKnobChanged->getValue();
1778 if (warnOcioChanged) {
1779 bool stopAsking = false;
1780 Dialogs::warningDialog(tr("OCIO config changed").toStdString(),
1781 tr("The OpenColorIO config change requires a restart of %1 to be effective.").arg( QString::fromUtf8(NATRON_APPLICATION_NAME) ).toStdString(), &stopAsking);
1782 if (stopAsking) {
1783 _warnOcioConfigKnobChanged->setValue(false);
1784 saveSetting( _warnOcioConfigKnobChanged.get() );
1785 }
1786 }
1787 } else if ( knobs[i] == _texturesMode.get() ) {
1788 AppInstanceVec apps = appPTR->getAppInstances();
1789 for (AppInstanceVec::iterator it = apps.begin(); it != apps.end(); ++it) {
1790 std::list<ViewerInstance*> allViewers;
1791 (*it)->getProject()->getViewers(&allViewers);
1792 for (std::list<ViewerInstance*>::iterator it = allViewers.begin(); it != allViewers.end(); ++it) {
1793 (*it)->renderCurrentFrame(true);
1794 }
1795 }
1796 } else if ( ( ( knobs[i] == _loadBundledPlugins.get() ) ||
1797 ( knobs[i] == _preferBundledPlugins.get() ) ||
1798 ( knobs[i] == _useStdOFXPluginsLocation.get() ) ||
1799 ( knobs[i] == _extraPluginPaths.get() ) )
1800 && !didOFXCacheWarn ) {
1801 didOFXCacheWarn = true;
1802 appPTR->clearPluginsLoadedCache(); // clear the cache for next restart
1803 Dialogs::warningDialog( tr("OpenFX plugins path changed").toStdString(),
1804 tr("The OpenFX plugins path change requires a restart of %1 to be effective.").arg( QString::fromUtf8(NATRON_APPLICATION_NAME) ).toStdString() );
1805 }
1806 }
1807} // Settings::warnChangedKnobs
1808
1809void
1810Settings::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