/*******************************************************************************
 Copyright 2017 Daniel Neuwirth
 This program is distributed under the terms of the GNU General Public License.
*******************************************************************************/

#ifndef UI_STEPS_H
#define UI_STEPS_H

// user interface for StepsWindow class


#include <QDialog>
#include <QFont>
#include <QHBoxLayout>
#include <QIcon>
#include <QPushButton>
#include <QTextEdit>
#include <QVBoxLayout>

class Ui_StepsWindow {

    public:
        QVBoxLayout * verticalLayout_win;
        QHBoxLayout * horizontalLayout_2;

        QTextEdit * textEdit_ComputationSteps;

        QPushButton * pushButton_FundamentalMatrix;
        QIcon * iconMatrix;
        QPushButton * pushButton_CopyToClipboard;
        QIcon * iconClipboard;
        QPushButton * pushButton_OK;
        QIcon * iconOK;

        void setupUi(QDialog * StepsWindow, const QString & inText,
                     const bool showMatrix) {

            // properties of dialog window
            StepsWindow->setMinimumSize(800, 300);
            StepsWindow->resize(800, 500);
            StepsWindow->setWindowTitle(
                QStringLiteral("Computation - individual steps"));

            // first row - contents
            textEdit_ComputationSteps = new QTextEdit();
            textEdit_ComputationSteps->setReadOnly(true);
            textEdit_ComputationSteps->setLineWrapMode(QTextEdit::NoWrap);
            textEdit_ComputationSteps->setFont(QFont("Times", 16));
            textEdit_ComputationSteps->setHtml(
                "<div style=\"line-height:125%;\">"+inText+"</div>");

            // second row - contents
            pushButton_FundamentalMatrix =
                new QPushButton(QStringLiteral("Show &fundamental matrix"));
            iconMatrix = new QIcon();
            iconMatrix->addFile(QStringLiteral(":/icons/icons/matrix.ico"),
                                QSize(), QIcon::Normal, QIcon::Off);
            pushButton_FundamentalMatrix->setIcon(*iconMatrix);
            pushButton_FundamentalMatrix->setVisible(showMatrix);
            pushButton_CopyToClipboard =
                new QPushButton(QStringLiteral("&Copy contents to clipboard"));
            iconClipboard = new QIcon();
            iconClipboard->addFile(QStringLiteral(":/icons/icons/copyclbd.ico"),
                                   QSize(), QIcon::Normal, QIcon::Off);
            pushButton_CopyToClipboard->setIcon(*iconClipboard);
            pushButton_OK = new QPushButton(QStringLiteral("&OK"));
            pushButton_OK->setDefault(true);
            iconOK = new QIcon();
            iconOK->addFile(QStringLiteral(":/icons/icons/ok.ico"), QSize(),
                            QIcon::Normal, QIcon::Off);
            pushButton_OK->setIcon(*iconOK);

            // second row - layout
            horizontalLayout_2 = new QHBoxLayout();
            horizontalLayout_2->addWidget(pushButton_FundamentalMatrix);
            horizontalLayout_2->insertStretch(1);
            horizontalLayout_2->addWidget(pushButton_CopyToClipboard);
            horizontalLayout_2->addWidget(pushButton_OK);

            // vertical layout
            verticalLayout_win = new QVBoxLayout(StepsWindow);
            verticalLayout_win->addWidget(textEdit_ComputationSteps);
            verticalLayout_win->addLayout(horizontalLayout_2);

            QMetaObject::connectSlotsByName(StepsWindow);
    }
};

#endif // UI_STEPS_H
