Show debug console only for "pre-release" builds.
[simple-x264-launcher.git] / src / win_about.cpp
blob705eed3d56201c9abf98bc7b93dd43ebfe6d26ac
1 ///////////////////////////////////////////////////////////////////////////////
2 // Simple x264 Launcher
3 // Copyright (C) 2004-2015 LoRd_MuldeR <MuldeR2@GMX.de>
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License along
16 // with this program; if not, write to the Free Software Foundation, Inc.,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 // http://www.gnu.org/licenses/gpl-2.0.txt
20 ///////////////////////////////////////////////////////////////////////////////
22 #include "win_about.h"
23 #include "UIC_win_about.h"
25 //Internal
26 #include "global.h"
28 //MUtils
29 #include <MUtils/Version.h>
31 //Qt
32 #include <QProcess>
33 #include <QScrollBar>
34 #include <QDate>
35 #include <QTimer>
36 #include <QMessageBox>
38 ///////////////////////////////////////////////////////////////////////////////
39 // Constructor & Destructor
40 ///////////////////////////////////////////////////////////////////////////////
42 AboutDialog::AboutDialog(QWidget *parent)
44 QDialog(parent),
45 ui(new Ui::AboutDialog())
47 //Init the dialog, from the .ui file
48 ui->setupUi(this);
49 setWindowFlags(windowFlags() | Qt::Tool);
51 //Fill in the template text
52 ui->labelAbout->setText(
53 ui->labelAbout->text().arg(
54 QString().sprintf("%u.%02u.%u", x264_version_major(),
55 x264_version_minor(),
56 x264_version_build()),
57 QString::number(qMax(MUtils::Version::app_build_date().year(),QDate::currentDate().year())),
58 MUtils::Version::app_build_date().toString(Qt::ISODate),
59 MUtils::Version::app_build_time().toString(Qt::ISODate),
60 MUtils::Version::compiler_version(),
61 MUtils::Version::compiler_arch(),
62 QString::fromLatin1(QT_VERSION_STR)
66 //Enable hover
67 ui->labelGPL->setAttribute(Qt::WA_Hover, true);
68 ((QWidget*)ui->labelGPL->parent())->setAttribute(Qt::WA_Hover, true);
69 ((QWidget*)ui->labelGPL->parent()->parent())->setAttribute(Qt::WA_Hover, true);
71 //Switch to first tab
72 ui->tabWidget->setCurrentIndex(ui->tabWidget->indexOf(ui->tabAbout));
74 //Connect button
75 connect(ui->aboutQtButton, SIGNAL(clicked()), this, SLOT(showAboutQt()));
78 AboutDialog::~AboutDialog(void)
80 delete ui;
83 ///////////////////////////////////////////////////////////////////////////////
84 // Public Functions
85 ///////////////////////////////////////////////////////////////////////////////
87 /*None*/
89 ///////////////////////////////////////////////////////////////////////////////
90 // Events
91 ///////////////////////////////////////////////////////////////////////////////
93 void AboutDialog::showEvent(QShowEvent *event)
95 QDialog::showEvent(event);
97 //Fix dialog size - need to do this in Show event
98 const QSize hint = sizeHint();
99 setFixedSize(hint.isValid() ? hint : size());
102 ///////////////////////////////////////////////////////////////////////////////
103 // Slots
104 ///////////////////////////////////////////////////////////////////////////////
106 void AboutDialog::showAboutQt(void)
108 QMessageBox::aboutQt(this);