! * called when the filter settings type (custom, automatic, from a template) was changed. * enables the options if the filter "custom" was chosen. Disables the options otherwise. */
| 1723 | * enables the options if the filter "custom" was chosen. Disables the options otherwise. |
| 1724 | */ |
| 1725 | void ImportFileWidget::filterChanged(int index) { |
| 1726 | DEBUG(Q_FUNC_INFO) |
| 1727 | |
| 1728 | // filter settings are available for ASCII and Binary only, ignore for other file types |
| 1729 | auto fileType = currentFileType(); |
| 1730 | if (fileType != AbstractFileFilter::FileType::Ascii && fileType != AbstractFileFilter::FileType::Binary) { |
| 1731 | ui.swOptions->setEnabled(true); |
| 1732 | return; |
| 1733 | } |
| 1734 | |
| 1735 | if (index == FilterSettingsHandlingIndex::Automatic) { |
| 1736 | ui.swOptions->setEnabled(false); |
| 1737 | m_templateHandler->hide(); |
| 1738 | } else if (index == FilterSettingsHandlingIndex::Custom) { |
| 1739 | ui.swOptions->setEnabled(true); |
| 1740 | m_templateHandler->show(); |
| 1741 | } else { // templates |
| 1742 | ui.swOptions->setEnabled(false); |
| 1743 | m_templateHandler->hide(); |
| 1744 | auto config = m_templateHandler->config(ui.cbFilter->currentText()); |
| 1745 | this->loadConfigFromTemplate(config); |
| 1746 | } |
| 1747 | } |
| 1748 | |
| 1749 | inline void delay(int millisecondsWait) |
| 1750 | { |
nothing calls this directly
no test coverage detected