#include "qgaboutdialog.h" #include #include #include #include #include #include #include #include #include "qgrunsession.h" class QgAboutDialog::Implementation { public: QVBoxLayout* ly; QLabel* lblCustom; QHBoxLayout* btnLy; QPushButton* btnQtAbout; QPushButton* btnSessionAbout; QPushButton* btnLicenseAbout; QPushButton* btnOpenSession; QString sessionMsg; QString licenseMsg; QString customMessage; }; QgAboutDialog::QgAboutDialog(QWidget *parent): QgAboutDialog(QString(), parent) { } QgAboutDialog::QgAboutDialog(const QString& aCustomMessage, QWidget* parent): QDialog(parent), p_(*new Implementation) { p_.customMessage=aCustomMessage; p_.btnSessionAbout=new QPushButton("About Session..."); p_.btnLicenseAbout=new QPushButton("About License..."); p_.btnQtAbout=new QPushButton("About Qt..."); p_.btnOpenSession=new QPushButton("Explore session..."); p_.btnLy=new QHBoxLayout; p_.btnLy->addWidget(p_.btnSessionAbout); p_.btnLy->addWidget(p_.btnLicenseAbout); p_.btnLy->addWidget(p_.btnQtAbout); p_.lblCustom=new QLabel; p_.lblCustom->setText(p_.customMessage); p_.ly=new QVBoxLayout; p_.ly->addWidget(p_.lblCustom); p_.ly->addLayout(p_.btnLy); this->setLayout(p_.ly); { QString hostInfo= QString("

Host: %1 (%2) %3 %4

") .arg(QSysInfo::machineHostName()) .arg(QSysInfo::currentCpuArchitecture()) .arg(QSysInfo::productType()) .arg(QSysInfo::productVersion()); QgRunSession& s=QgRunSession::defaultSession(); QString sessionInfo= QString("

Session:

" "

Base path: %1

" "

Current Path: %2

" "

Output Path: %3

") .arg(s.workDirPath()) .arg(s.currentDirPath()) .arg(s.outDirPath()); p_.sessionMsg=QString("%1\n\%2").arg(sessionInfo).arg(hostInfo); } { p_.licenseMsg= "

Copyright Leonardo Company S.p.A

" "

This application:

" "
    " "
  • Is proprietaty software, copyright protected and not covered by any free linceces (as LGPL).
  • " "
  • Is meant for internal use only and it is not deliverable or sell in any form
  • " "
  • Use a dynamic linked Qt Open Source version. According with the LGPL, this is a work that uses the library and therefore it is not required compliance to the Qt LGPL lincence
  • " "
" "

Third-part SW:

" "
    " "
  • Qt Advanced Docking System v3.0.0, License LGPL-2.1-only (https://marketplace.qt.io/products/advanced-docking-system)
  • " "
" "

At your risk, without any warranty, this application can be execute with other version of Qt dynamic library, providing binary compatibiliy with the original Qt version (see 'About Qt...'

"; #if 0 "

This applicaiton is proprietaty software, copyright protected and not covered by any free linceces (as LGPL).

" "

This applicaiton use a dynamic linked Qt Open Source version. According with the LGPL, this is a work that uses the library and therefore it is not required compliance to the Qt LGPL lincence

" "

At your risk, without any warranty, this application can be execute with other version of Qt dynamic library, providing binary compatibiliy with the original Qt version (see 'About Qt...'

"; #endif } connect(p_.btnQtAbout, &QPushButton::clicked, this, [this]() { QString title="About Qt"; QMessageBox::aboutQt(0, title); }); connect(p_.btnSessionAbout, &QPushButton::clicked, this, [this]() { QString title="About Session"; QMessageBox::about(0, title, p_.sessionMsg); #if 0 QMessageBox::StandardButton r=QMessageBox::question(0, "Open working directory?", p_.sessionMsg); if (r==QMessageBox::Yes) { QDesktopServices::openUrl(QUrl(QString("file:///")+QgRunSession::defaultSession().currentDirPath())); } #endif }); connect(p_.btnLicenseAbout, &QPushButton::clicked, this, [this]() { QString title="About Licnese"; QMessageBox::about(0, title, p_.licenseMsg); }); connect(p_.btnOpenSession, &QPushButton::clicked, this, [this]() { QDesktopServices::openUrl(QUrl(QString("file:///")+QgRunSession::defaultSession().currentDirPath())); }); } QgAboutDialog::~QgAboutDialog() { delete &p_; }