| 949 | } |
| 950 | |
| 951 | void |
| 952 | SequenceFileDialog::onSelectionChanged() |
| 953 | { |
| 954 | QStringList allFiles; |
| 955 | QModelIndexList indexes = _view->selectionModel()->selectedRows(); |
| 956 | |
| 957 | assert(indexes.size() <= 1); |
| 958 | ///if a parsed sequence exists with the |
| 959 | if ( indexes.empty() ) { |
| 960 | return; |
| 961 | } |
| 962 | |
| 963 | QModelIndex mappedIndex = indexes[0]; |
| 964 | FileSystemItem* item = _model->getFileSystemItem(mappedIndex); |
| 965 | assert(item); |
| 966 | |
| 967 | ///if the selected item is a directory, just set the line edit accordingly |
| 968 | QString absolutePath = item->absoluteFilePath(); |
| 969 | |
| 970 | proxyAndSetLineEditText(absolutePath); |
| 971 | |
| 972 | if ( !item->isDir() ) { |
| 973 | if (_dialogMode == eFileDialogModeSave) { |
| 974 | QString extension = item->fileExtension(); |
| 975 | for (int i = 0; i < _fileExtensionCombo->count(); ++i) { |
| 976 | if (_fileExtensionCombo->itemText(i) == extension) { |
| 977 | _fileExtensionCombo->setCurrentIndex_no_emit(i); |
| 978 | break; |
| 979 | } |
| 980 | } |
| 981 | } |
| 982 | } |
| 983 | |
| 984 | ///refrsh preview if any |
| 985 | if ( _preview && _preview->viewerUI && _preview->viewerUI->isVisible() ) { |
| 986 | refreshPreviewAfterSelectionChange(); |
| 987 | } |
| 988 | } // onSelectionChanged |
| 989 | |
| 990 | void |
| 991 | SequenceFileDialog::enterDirectory(const QModelIndex & index) |
nothing calls this directly
no test coverage detected