#ifndef HUBMAINWIDGET_H
#define HUBMAINWIDGET_H

#include <QWidget>
#include <QTime>
#include <QTimer>
#include <QLibrary>
#include <QUrl>
#include <QLabel>
#include <QDesktopServices>
#include "QtNetwork/QNetworkAccessManager"

QT_BEGIN_NAMESPACE
namespace Ui { class HubMainWidget; }
QT_END_NAMESPACE

class HubMainWidget : public QWidget
{
    Q_OBJECT

public:
    HubMainWidget(QWidget *parent = nullptr);
    ~HubMainWidget();

private slots:
    void on_openOrDownloadButton_clicked();

    void on_appBox_currentIndexChanged(int index);

private:
    QTimer sysTimer;

    struct dllInfo
    {
        QWidget* widget = nullptr;
        QString libName;
        QString fileName;
        QString initFuncName;
        QUrl adr;
        QUrl downloadAdr;
    };

    QVector<dllInfo>connectedModules;

    bool getModules();
    bool connectLibrary(dllInfo modul);

    Ui::HubMainWidget *ui;
};
#endif // HUBMAINWIDGET_H
