#ifndef PROGRESSESDLG_H
#define PROGRESSESDLG_H

#include "gutil/qgui.h"
#include <QDialog>
#include <QProgressBar>

class ProgressesItem;
class ProgressesDlg : public QDialog {
    Q_OBJECT
public:
    explicit ProgressesDlg(QWidget *parent = nullptr);

    QString filePath, fileId;
    TreeWidget *table;
};

class ProgressesItem : public TreeWidgetItem, public QObject {
public:
    using TreeWidgetItem::TreeWidgetItem;
    void setRes(const QString &tip, QColor color = Qt::green) {
        auto res = "res"**treeWidget();
        setText(res, tip);
        setToolTip(res, tip);
        setForeground(res, color);
    }
    void sendProgress(const QString &id);

    QProgressBar *fdProgress;
};

#endif // PROGRESSESDLG_H