File indexing completed on 2024-05-19 04:35:50

0001 // SPDX-FileCopyrightText: 2024 Carl Schwan <carlschwan@kde.org>
0002 // SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0003 
0004 #pragma once
0005 
0006 #include <QObject>
0007 #include <QtQml>
0008 
0009 class SetupCheck : public QObject
0010 {
0011     Q_OBJECT
0012     QML_ELEMENT
0013     Q_PROPERTY(bool isValidSetup READ isValidSetup NOTIFY isValidSetupChanged)
0014     Q_PROPERTY(QStringList missingPrograms READ missingPrograms NOTIFY missingProgramsChanged)
0015 
0016 public:
0017     explicit SetupCheck(QObject *parent = nullptr);
0018 
0019     bool isValidSetup() const;
0020     QStringList missingPrograms() const;
0021 
0022     Q_INVOKABLE void check();
0023 
0024 Q_SIGNALS:
0025     bool isValidSetupChanged();
0026     bool missingProgramsChanged();
0027 
0028 private:
0029     bool m_isValidSetup = true;
0030     QStringList m_missingPrograms;
0031 };