#include "aboutdialog.h"
#include "ui_aboutdialog.h"

#include <QDesktopServices>
#include <QUrl>
#include <QDebug>

AboutDialog::AboutDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::AboutDialog)
{
    ui->setupUi(this);

    this->setFixedSize(this->width(), this->height());//设置窗口不可改变大小
    this->setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);// hide the "?" help button ont the title bar

    ui->label_version->setText(QString("PoleMaster %1, release on %2").arg(VERSION_STRING).arg(VER_RELEASE_DATE));
}

AboutDialog::~AboutDialog()
{
    delete ui;
}

void AboutDialog::on_label_logo_linkActivated(const QString &link)
{
    QDesktopServices::openUrl(QUrl(link));
}

void AboutDialog::on_pushButton_ok_clicked()
{
    this->close();
}

void AboutDialog::uiReset()
{
    ui->retranslateUi(this);

    ui->label_version->setText(QString("PoleMaster %1, release on %2").arg(VERSION_STRING).arg(VER_RELEASE_DATE));
}
