2012-06-10 16:50:54 +00:00
|
|
|
/*
|
|
|
|
|
* synergy -- mouse and keyboard sharing utility
|
2016-09-07 14:24:00 +00:00
|
|
|
* Copyright (C) 2012-2016 Symless Ltd.
|
2012-06-10 16:50:54 +00:00
|
|
|
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
|
2024-07-02 19:07:06 +00:00
|
|
|
*
|
2012-06-10 16:50:54 +00:00
|
|
|
* This package is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
2015-05-03 02:33:52 +00:00
|
|
|
* found in the file LICENSE that should have accompanied this file.
|
2024-07-02 19:07:06 +00:00
|
|
|
*
|
2012-06-10 16:50:54 +00:00
|
|
|
* This package is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
|
2022-09-13 15:31:45 +00:00
|
|
|
#include "AboutDialog.h"
|
2024-07-02 19:07:06 +00:00
|
|
|
#include "OSXHelpers.h"
|
2020-12-21 11:09:52 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
AboutDialog::AboutDialog(MainWindow *parent, const AppConfig &config)
|
|
|
|
|
: QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
|
|
|
|
|
Ui::AboutDialogBase() {
|
|
|
|
|
setupUi(this);
|
2020-08-18 12:55:25 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
m_versionChecker.setApp(parent->appPath(config.synergycName()));
|
2024-07-08 10:40:22 +00:00
|
|
|
|
|
|
|
|
QString version = SYNERGY_VERSION;
|
|
|
|
|
#ifdef GIT_SHA_SHORT
|
|
|
|
|
version += " (" GIT_SHA_SHORT ")";
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
m_pLabelSynergyVersion->setText(version);
|
2012-07-29 01:01:33 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
QString buildDateString = QString::fromLocal8Bit(__DATE__).simplified();
|
|
|
|
|
QDate buildDate = QLocale("en_US").toDate(buildDateString, "MMM d yyyy");
|
|
|
|
|
m_pLabelBuildDate->setText(buildDate.toString(Qt::SystemLocaleLongDate));
|
2015-10-19 23:06:02 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
textEliteBackers->hide();
|
|
|
|
|
labelEliteBackers->hide();
|
|
|
|
|
labelEliteBackerLink->hide();
|
|
|
|
|
labelCreditsLink->hide();
|
2022-09-13 15:31:45 +00:00
|
|
|
}
|
2020-08-18 12:55:25 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
int AboutDialog::exec() {
|
|
|
|
|
// Sets the current build year into the copyright text
|
|
|
|
|
label_3->setText(getCopyrights() + getKeyContributors());
|
|
|
|
|
resizeWindow();
|
|
|
|
|
updateLogo();
|
2022-09-13 15:31:45 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
return QDialog::exec();
|
2022-09-13 15:31:45 +00:00
|
|
|
}
|
2020-12-21 11:09:52 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
void AboutDialog::resizeWindow() {
|
|
|
|
|
QSize size(600, 310);
|
|
|
|
|
setMaximumSize(size);
|
|
|
|
|
setMinimumSize(size);
|
|
|
|
|
resize(size);
|
2022-09-13 15:31:45 +00:00
|
|
|
}
|
|
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
void AboutDialog::updateLogo() const {
|
2022-09-13 15:31:45 +00:00
|
|
|
#if defined(Q_OS_MAC)
|
2024-07-02 19:07:06 +00:00
|
|
|
if (isOSXInterfaceStyleDark()) {
|
|
|
|
|
QPixmap logo(":/res/image/about-dark.png");
|
|
|
|
|
if (!logo.isNull()) {
|
|
|
|
|
label_Logo->setPixmap(logo);
|
2020-12-21 11:09:52 +00:00
|
|
|
}
|
2024-07-02 19:07:06 +00:00
|
|
|
}
|
2012-07-29 01:01:33 +00:00
|
|
|
#endif
|
2012-06-10 16:50:54 +00:00
|
|
|
}
|
2022-06-30 11:48:26 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
QString AboutDialog::getKeyContributors() const {
|
|
|
|
|
return QString(R"(<p style="font-size: 14px">Key contributors<br>
|
2022-09-13 15:31:45 +00:00
|
|
|
<span style="font-size: 11px">Chris Schoeneman, Nick Bolton, Richard Lee, Adam Feder, Volker Lanz,
|
|
|
|
|
Ryan Breen, Guido Poschta, Bertrand Landry Hetu, Tom Chadwick, Brent Priddy, Kyle Bloom,
|
|
|
|
|
Daun Chung, Serhii Hadzhylov, Oleksandr Lysytsia, Olena Kutytska, Francisco Magalhães.</span>
|
|
|
|
|
</p>)");
|
2022-06-30 11:48:26 +00:00
|
|
|
}
|
|
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
QString AboutDialog::getCopyrights() const {
|
|
|
|
|
QString buildDateString = QString::fromLocal8Bit(__DATE__).simplified();
|
|
|
|
|
QDate buildDate = QLocale("en_US").toDate(buildDateString, "MMM d yyyy");
|
2022-09-13 15:31:45 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
QString copyrights(
|
|
|
|
|
R"(<p>Keyboard and mouse sharing application.<br /><br />Copyright © %%YEAR%% Symless Ltd.</p>)");
|
|
|
|
|
return copyrights.replace(QString("%%YEAR%%"),
|
|
|
|
|
QString::number(buildDate.year()));
|
2022-06-30 11:48:26 +00:00
|
|
|
}
|