* \brief Page for the 'General' settings of the Labplot settings dialog. */
| 20 | * \brief Page for the 'General' settings of the Labplot settings dialog. |
| 21 | */ |
| 22 | SettingsDatasetsPage::SettingsDatasetsPage(QWidget* parent) |
| 23 | : SettingsPage(parent) { |
| 24 | ui.setupUi(this); |
| 25 | |
| 26 | ui.bClearCache->setIcon(QIcon::fromTheme(QLatin1String("edit-clear"))); |
| 27 | ui.bClearCache->setToolTip(i18n("Clear downloaded files")); |
| 28 | ui.bClearCache->setEnabled(false); |
| 29 | |
| 30 | ui.lKaggleUrl->setText(QStringLiteral("(<a href=\"https://www.kaggle.com/docs/api\">") + i18n("How to Use Kaggle") + QStringLiteral("</a>)")); |
| 31 | ui.lKaggleUrl->setTextFormat(Qt::RichText); |
| 32 | ui.lKaggleUrl->setTextInteractionFlags(Qt::TextBrowserInteraction); |
| 33 | ui.lKaggleUrl->setOpenExternalLinks(true); |
| 34 | |
| 35 | connect(ui.bClearCache, &QPushButton::clicked, this, &SettingsDatasetsPage::clearCache); |
| 36 | connect(ui.leKagglePath, &QLineEdit::textChanged, [&] { |
| 37 | m_changed = true; |
| 38 | const QString& kagglePath = ui.leKagglePath->text(); |
| 39 | bool invalid = (!kagglePath.isEmpty() && !QFile::exists(kagglePath)); |
| 40 | GuiTools::highlight(ui.leKagglePath, invalid); |
| 41 | Q_EMIT settingsChanged(); |
| 42 | }); |
| 43 | |
| 44 | loadSettings(); |
| 45 | } |
| 46 | |
| 47 | QList<Settings::Type> SettingsDatasetsPage::applySettings() { |
| 48 | QList<Settings::Type> changes; |
nothing calls this directly
no test coverage detected