MCPcopy Create free account
hub / github.com/KDE/labplot / filterChanged

Method filterChanged

src/frontend/datasources/ImportFileWidget.cpp:1725–1747  ·  view source on GitHub ↗

! * 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. */

Source from the content-addressed store, hash-verified

1723 * enables the options if the filter "custom" was chosen. Disables the options otherwise.
1724 */
1725void 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
1749inline void delay(int millisecondsWait)
1750{

Callers

nothing calls this directly

Calls 5

showMethod · 0.80
configMethod · 0.80
currentTextMethod · 0.80
setEnabledMethod · 0.45

Tested by

no test coverage detected