#ifndef VERSIONSELECTWIDGET_H
#define VERSIONSELECTWIDGET_H

#include <QListWidget>
#include <QWidget>

#include <Core/sendsystem.h>
#include <Core/streamingversiondata.h>
#include <newversionwidget.h>

namespace Ui {
class VersionSelectWidget;
}

class VersionSelectWidget : public QWidget
{
    Q_OBJECT

public:
    explicit VersionSelectWidget(QWidget *parent = nullptr);
    void initialize(SendSystem *sendSystem);
    void fillView(QList<StreamingVersionData*> *serverData);
    ~VersionSelectWidget();

    void fillCurrentVersionName(QString versionName);
    void sendCopyEmit(QString newName);
private slots:
    void on_verListView_itemDoubleClicked(QListWidgetItem *item);
    void on_createDuplicateButton_clicked();
    void on_DeleteVersionButton_clicked();
    void on_switchServerVersionButton_clicked();

signals:
    void sigSendDeleteVersion(StreamingVersionData *streaming);
    void sigSendSwitchVersion(StreamingVersionData *selectVersion);
    void sigSendCopyVersion(QString versionPair);

private:
    Ui::VersionSelectWidget *ui;
    SendSystem *sendSystem;
    QList<StreamingVersionData*> *serverDataList;
    StreamingVersionData *selectedVersion;
};

#endif // VERSIONSELECTWIDGET_H
