| 937 | } |
| 938 | |
| 939 | void |
| 940 | SequenceFileDialog::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 | |
| 978 | void |
| 979 | SequenceFileDialog::enterDirectory(const QModelIndex & index) |
nothing calls this directly
no test coverage detected