1 ///////////////////////////////////////////////////////////////////////////////
2 // Simple x264 Launcher
3 // Copyright (C) 2004-2023 LoRd_MuldeR <MuldeR2@GMX.de>
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.
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"
29 #include <MUtils/Version.h>
36 #include <QMessageBox>
38 ///////////////////////////////////////////////////////////////////////////////
39 // Constructor & Destructor
40 ///////////////////////////////////////////////////////////////////////////////
42 AboutDialog::AboutDialog(QWidget
*parent
)
45 ui(new Ui::AboutDialog())
47 //Init the dialog, from the .ui file
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(),
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
)
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);
72 ui
->tabWidget
->setCurrentIndex(ui
->tabWidget
->indexOf(ui
->tabAbout
));
75 connect(ui
->aboutQtButton
, SIGNAL(clicked()), this, SLOT(showAboutQt()));
78 AboutDialog::~AboutDialog(void)
83 ///////////////////////////////////////////////////////////////////////////////
85 ///////////////////////////////////////////////////////////////////////////////
89 ///////////////////////////////////////////////////////////////////////////////
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 ///////////////////////////////////////////////////////////////////////////////
104 ///////////////////////////////////////////////////////////////////////////////
106 void AboutDialog::showAboutQt(void)
108 QMessageBox::aboutQt(this);