| 59 | #define THIRD_PARTY_LICENSE_DIR_PATH ":" |
| 60 | |
| 61 | NATRON_NAMESPACE_ENTER |
| 62 | |
| 63 | AboutWindow::AboutWindow(QWidget* parent) |
| 64 | : QDialog(parent) |
| 65 | { |
| 66 | _scale = 1.; |
| 67 | #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) |
| 68 | #if defined(Q_OS_WIN) |
| 69 | // code from Gui::devicePixelRatio() |
| 70 | HDC wscreen = GetDC(winId()); |
| 71 | FLOAT horizontalDPI = GetDeviceCaps(wscreen, LOGPIXELSX); |
| 72 | ReleaseDC(0, wscreen); |
| 73 | _scale = static_cast<qreal>(horizontalDPI) / 96.; |
| 74 | #endif |
| 75 | #endif |
| 76 | |
| 77 | setWindowTitle( tr("About %1").arg( QString::fromUtf8(NATRON_APPLICATION_NAME) ) ); |
| 78 | _mainLayout = new QVBoxLayout(this); |
| 79 | setLayout(_mainLayout); |
| 80 | |
| 81 | _iconLabel = new Label(this); |
| 82 | _iconLabel->setPixmap( QPixmap( QString::fromUtf8(NATRON_APPLICATION_ICON_PATH) ).scaled(128 * _scale, 128 * _scale) ); |
| 83 | _mainLayout->addWidget(_iconLabel); |
| 84 | |
| 85 | _tabWidget = new QTabWidget(this); |
| 86 | _mainLayout->addWidget(_tabWidget); |
| 87 | |
| 88 | _buttonContainer = new QWidget(this); |
| 89 | _buttonLayout = new QHBoxLayout(_buttonContainer); |
| 90 | _buttonLayout->addStretch(); |
| 91 | |
| 92 | _closeButton = new Button(tr("Close"), _buttonContainer); |
| 93 | QObject::connect( _closeButton, SIGNAL(clicked()), this, SLOT(accept()) ); |
| 94 | _buttonLayout->addWidget(_closeButton); |
| 95 | |
| 96 | _mainLayout->addWidget(_buttonContainer); |
| 97 | |
| 98 | ///filling tabs now |
| 99 | |
| 100 | _aboutText = new QTextBrowser(_tabWidget); |
| 101 | _aboutText->setOpenExternalLinks(true); |
| 102 | QString aboutText; |
| 103 | { |
| 104 | QString customBuild( QString::fromUtf8(NATRON_CUSTOM_BUILD_USER_NAME) ); |
| 105 | if ( !customBuild.isEmpty() ) { |
| 106 | aboutText = QString::fromUtf8("<p>%1 custom build for %2 %3.</p>") |
| 107 | .arg( QString::fromUtf8(NATRON_APPLICATION_NAME) ) |
| 108 | .arg(customBuild) |
| 109 | #ifdef DEBUG |
| 110 | .arg( QString::fromUtf8("(debug)") ); |
| 111 | #else |
| 112 | #ifdef NDEBUG |
| 113 | // release with asserts disabled (should be the *real* release) |
| 114 | .arg( QString() ); |
| 115 | #else |
| 116 | // release with asserts enabled |
| 117 | .arg( QString::fromUtf8("(opt)") ); |
| 118 | #endif |
nothing calls this directly
no test coverage detected