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

Method updateGUI

Gui/KnobGuiFile.cpp:201–232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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