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

Method updateGUI

Gui/KnobGuiFile.cpp:202–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200}
201
202void
203KnobGuiFile::updateGUI(int /*dimension*/)
204{
205 KnobFilePtr knob = _knob.lock();
206
207 _lineEdit->setText( QString::fromUtf8( knob->getValue().c_str() ) );
208
209 bool useNotifications = appPTR->getCurrentSettings()->notifyOnFileChange();
210 if ( useNotifications && knob->getHolder() && knob->getEvaluateOnChange() ) {
211 std::string newValue = knob->getFileName( knob->getCurrentTime(), ViewIdx(0) );
212 if ( knob->getHolder()->getApp() ) {
213 knob->getHolder()->getApp()->getProject()->canonicalizePath(newValue);
214 }
215 QString file( QString::fromUtf8( newValue.c_str() ) );
216
217 //The sequence probably changed, clear modification dates
218 _lastModificationDates.clear();
219
220 if ( QFile::exists(file) ) {
221 //If the file exists at the current time, set the modification date in the tooltip
222 QFileInfo info(file);
223 QDateTime dateTime = info.lastModified();
224
225 _lastModificationDates[newValue] = dateTime;
226
227 QString tt = toolTip();
228 tt.append( QString::fromUtf8("\n\nLast modified: ") );
229 tt.append( dateTime.toString(Qt::SystemLocaleShortDate) );
230 _lineEdit->setToolTip(tt);
231 }
232 }
233}
234
235void
236KnobGuiFile::onTimelineFrameChanged(SequenceTime time,

Callers

nothing calls this directly

Calls 15

toolTipFunction · 0.85
notifyOnFileChangeMethod · 0.80
getCurrentSettingsMethod · 0.80
getFileNameMethod · 0.80
canonicalizePathMethod · 0.80
getProjectMethod · 0.80
appendMethod · 0.80
isMultiPathMethod · 0.80
ViewIdxClass · 0.50
lockMethod · 0.45
setTextMethod · 0.45
getValueMethod · 0.45

Tested by

no test coverage detected