#ifndef XLRUCONNECTIONDIALOG_H
#define XLRUCONNECTIONDIALOG_H

#include "connectioninfo.h"

#include <QDialog>

namespace Ui {
class XLruConnectionDialog;
}

class XLruConnectionDialog : public QDialog
{
    Q_OBJECT

    Q_PROPERTY(QString psmPort MEMBER m_psmPort STORED true)
    Q_PROPERTY(QString ppsPort MEMBER m_ppsPort STORED true)
    Q_PROPERTY(QString lcuPort MEMBER m_lcuPort STORED true)

    Q_PROPERTY(QString psmBridge MEMBER m_psmBridge STORED true)
    Q_PROPERTY(QString ppsBridge MEMBER m_ppsBridge STORED true)
    Q_PROPERTY(QString lcuBridge MEMBER m_lcuBridge STORED true)

    Q_PROPERTY(int masterSpeed MEMBER m_masterSpeed STORED true)
    Q_PROPERTY(int psmSpeed MEMBER m_psmSpeed STORED true)
    Q_PROPERTY(int ppsSpeed MEMBER m_ppsSpeed STORED true)
    Q_PROPERTY(int lcuSpeed MEMBER m_lcuSpeed STORED true)

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

    XLruConnectionInfo connectionInfo() const;

public slots:
    void refreshPorts();
    void validateConfig();

private slots:
    void on_tbRefresh_clicked();

    void on_tbSave_clicked();

private:
    Ui::XLruConnectionDialog *ui;

    class Implementation;
    Implementation& p_;

    QString m_psmPort;
    QString m_ppsPort;
    QString m_lcuPort;

    QString m_psmBridge;
    QString m_ppsBridge;
    QString m_lcuBridge;

    int m_psmSpeed;
    int m_ppsSpeed;
    int m_lcuSpeed;
    int m_masterSpeed;
};

#endif // XLRUCONNECTIONDIALOG_H
