#ifndef DIALOGEXPORTSAMBA_H
#define DIALOGEXPORTSAMBA_H

#include <QDialog>

#include <QProcess>

#include <QTimer>

namespace Ui {
class DialogExportSamba;
}

class DialogExportSamba : public QDialog
{
    Q_OBJECT

public:
    explicit DialogExportSamba(QWidget *parent = 0);
    ~DialogExportSamba();

    int m_nTypeExport;

    int m_nStorageSize;
    int m_nStorageFreeSize;

    int m_nSyncCheckCount;

    QTimer m_TimerSync;
    QTimer m_TimerDeferred;

    //QProcess m_Process1;
    //QProcess m_Process2;

    void SetInfoString(QString strInfo);
    void SetExportEnable(bool bEnable);

    virtual void Mount();
    virtual void Umount();

    virtual void reject();

protected:
    QString m_strInfo;
    int m_bError;

public slots:
    void SetProgressExportFile(int nProgress, int nTotal);
    void SetProgressExportPercent(quint64 nProgress, quint64 nTotal);
    void SetProgressSync(bool bSync);

    void SyncUpdate();

    void SetExportComplete();
    void SetExportInit();

    void OnDeferredInit();

    //virtual void Process1Finish(int nRet);
    //virtual void Process1ReadyReadStandardOutput();
    //virtual void Process1ReadyReadStandardError();

    //virtual void Process2Finish(int nRet);
    //virtual void Process2ReadyReadStandardOutput();
    //virtual void Process2ReadyReadStandardError();

signals:
    void StartExport(int nType);
    void StopExport();

private slots:
    void on_pushButton_Cancel_clicked();

    void on_pushButton_Export_clicked();

    void on_pushButton_Retry_clicked();

private:
    Ui::DialogExportSamba *ui;
};

#endif // DIALOGEXPORTSAMBA_H
