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

Method onSelectionChanged

Gui/SequenceFileDialog.cpp:939–976  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

937}
938
939void
940SequenceFileDialog::onSelectionChanged()
941{
942 QStringList allFiles;
943 QModelIndexList indexes = _view->selectionModel()->selectedRows();
944
945 assert(indexes.size() <= 1);
946 ///if a parsed sequence exists with the
947 if ( indexes.empty() ) {
948 return;
949 }
950
951 QModelIndex mappedIndex = indexes[0];
952 FileSystemItem* item = _model->getFileSystemItem(mappedIndex);
953 assert(item);
954
955 ///if the selected item is a directory, just set the line edit accordingly
956 QString absolutePath = item->absoluteFilePath();
957
958 proxyAndSetLineEditText(absolutePath);
959
960 if ( !item->isDir() ) {
961 if (_dialogMode == eFileDialogModeSave) {
962 QString extension = item->fileExtension();
963 for (int i = 0; i < _fileExtensionCombo->count(); ++i) {
964 if (_fileExtensionCombo->itemText(i) == extension) {
965 _fileExtensionCombo->setCurrentIndex_no_emit(i);
966 break;
967 }
968 }
969 }
970 }
971
972 ///refrsh preview if any
973 if ( _preview && _preview->viewerUI && _preview->viewerUI->isVisible() ) {
974 refreshPreviewAfterSelectionChange();
975 }
976} // onSelectionChanged
977
978void
979SequenceFileDialog::enterDirectory(const QModelIndex & index)

Callers

nothing calls this directly

Calls 8

emptyMethod · 0.80
getFileSystemItemMethod · 0.80
isDirMethod · 0.80
itemTextMethod · 0.80
sizeMethod · 0.45
countMethod · 0.45
isVisibleMethod · 0.45

Tested by

no test coverage detected