#ifndef LEFTWIDGET_H
#define LEFTWIDGET_H

#include <QWidget>
#include <QDockWidget>
#include <qmenu.h>
#include <qtreewidget.h>
#include <QTreeWidgetItem>
#include <QMenu>
#include <QAction>

#include "global.h"

class LeftWidget:public QDockWidget
{
    Q_OBJECT
public:
    LeftWidget(QWidget *parent = nullptr);

    void reloadFileName();

    QString filePathCheck(const QString fileName,const QString folderPath);
signals:
    void sigSendAnalysisFileName(const QString&);
private:
    void initData();
    void initFileName(QTreeWidgetItem*,const QString &folderPath);
    void expandAll(QTreeWidgetItem* item);
    void clearAllChildItems(QTreeWidgetItem* parentItem);
    void removeFile(const QString& filePath);
private slots:
    void slotTreeWidgetItemClicked(QTreeWidgetItem *item, int column);
    void slotShowContextMenu(const QPoint &pos);
private:
    QTreeWidget *_treeWidget;
    
    QTreeWidgetItem *_analysisStateItem,
    *_baseLineItem,
    *_sampleDataItem;

    QMenu *_contextMenu;
    QAction *_deleteAction;
};

#endif // LEFTWIDGET_H
