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

#ifndef UI_ABOUT_H
#define UI_ABOUT_H

// user interface for AboutWindow class


#include "compute.h"

#include <QDialog>
#include <QGridLayout>
#include <QGroupBox>
#include <QHBoxLayout>
#include <QIcon>
#include <QLabel>
#include <QPixmap>
#include <QPushButton>
#include <QVBoxLayout>

class Ui_AboutWindow {

    public:
        QVBoxLayout * verticalLayout_win;
        QGridLayout * gridLayout_1;
        QGridLayout * gridLayout_2;
        QHBoxLayout * horizontalLayout_5;

        QLabel * label_programDescription;

        QGroupBox * qtBox;
        QPixmap * pixmap_Qt;
        QLabel * label_pictureQt;
        QLabel * label_descriptionQt;
        QPixmap * pixmap_Mercurial;
        QLabel * label_pictureMercurial;
        QLabel * label_descriptionMercurial;

        QGroupBox * fsiBox;
        QPixmap * pixmap_FSI;
        QLabel * label_pictureFSI;
        QLabel * label_descriptionFSI;

        QLabel * label_year;
        QPushButton * pushButton_OK;
        QIcon * iconOK;

        void setupUi(QDialog * AboutWindow) {

            // properties of dialog window
            AboutWindow->setMinimumSize(360, 400);
            AboutWindow->setWindowTitle(QStringLiteral("About"));

            // first row - contents
            label_programDescription = new QLabel();
            label_programDescription->setTextFormat(Qt::RichText);
            label_programDescription->setText(format::loadRes("description"));

            // Qt description box
            qtBox = new QGroupBox(QStringLiteral("Programming environment"));

            // second row - contents
            pixmap_Qt = new QPixmap(":/images/qt-logo.png");
            label_pictureQt = new QLabel();
            label_pictureQt->setPixmap(*pixmap_Qt);
            label_descriptionQt = new QLabel();
            label_descriptionQt->setTextFormat(Qt::RichText);
            label_descriptionQt->setText(format::loadRes("qt"));

            // third row - contents
            pixmap_Mercurial = new QPixmap(":/images/mercurial-logo.png");
            label_pictureMercurial = new QLabel();
            label_pictureMercurial->setPixmap(*pixmap_Mercurial);
            label_descriptionMercurial = new QLabel();
            label_descriptionMercurial->setTextFormat(Qt::RichText);
            label_descriptionMercurial->setText(format::loadRes("mercurial"));

            // second and third row - layout
            gridLayout_1 = new QGridLayout(); // 2x2
            gridLayout_1->addWidget(label_pictureQt,0,0);
            gridLayout_1->addWidget(label_descriptionQt,0,1,Qt::AlignHCenter);
            gridLayout_1->addWidget(label_pictureMercurial,1,0);
            gridLayout_1->addWidget(label_descriptionMercurial,1,1,Qt::AlignHCenter);
            qtBox->setLayout(gridLayout_1);

            // FSI description box
            fsiBox = new QGroupBox(QStringLiteral("Development supported by"));

            // fourth row - contents
            pixmap_FSI = new QPixmap(":/images/fsi-logo.png");
            label_pictureFSI = new QLabel();
            label_pictureFSI->setPixmap(*pixmap_FSI);
            label_descriptionFSI = new QLabel();
            label_descriptionFSI->setTextFormat(Qt::RichText);
            label_descriptionFSI->setText(format::loadRes("fsi"));

            // fourth row - layout
            gridLayout_2 = new QGridLayout(); // 1x2
            gridLayout_2->addWidget(label_pictureFSI,0,0);
            gridLayout_2->addWidget(label_descriptionFSI,0,1,Qt::AlignHCenter);
            gridLayout_2->setColumnStretch(1,1);
            fsiBox->setLayout(gridLayout_2);

            // fifth row - contents
            label_year = new QLabel(QStringLiteral("Copyright &copy; 2016-17"));
            label_year->setTextFormat(Qt::RichText);
            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);

            // fifth row - layout
            horizontalLayout_5 = new QHBoxLayout();
            horizontalLayout_5->addWidget(label_year);
            horizontalLayout_5->addWidget(pushButton_OK);
            horizontalLayout_5->insertStretch(1,0);

            // vertical layout
            verticalLayout_win = new QVBoxLayout(AboutWindow);
            verticalLayout_win->addWidget(label_programDescription);
            verticalLayout_win->addWidget(qtBox);
            verticalLayout_win->addWidget(fsiBox);
            verticalLayout_win->addLayout(horizontalLayout_5);
            verticalLayout_win->insertSpacing(1,15);

            QMetaObject::connectSlotsByName(AboutWindow);
        }
};

#endif // UI_ABOUT_H
