#pragma once #include #include #include #include #include "modplatform/helpers/HashUtils.h" #include "tasks/ConcurrentTask.h" struct BlockedMod { QString name; QString websiteUrl; QString hash; bool matched; QString localPath; }; QT_BEGIN_NAMESPACE namespace Ui { class BlockedModsDialog; } QT_END_NAMESPACE class BlockedModsDialog : public QDialog { Q_OBJECT public: BlockedModsDialog(QWidget *parent, const QString &title, const QString &text, QList &mods); ~BlockedModsDialog() override; private: Ui::BlockedModsDialog *ui; QList &mods; QFileSystemWatcher watcher; shared_qobject_ptr hashing_task; QSet checked_paths; void openAll(); void update(); void directoryChanged(QString path); void setupWatch(); void scanPaths(bool init); void scanPath(QString path, bool init); void checkMatchHash(QString hash, QString path); bool checkValidPath(QString path); bool allModsMatched(); };