deskflow/src/gui/src/AboutDialog.cpp

97 lines
3 KiB
C++
Raw Normal View History

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)
*
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
* found in the file LICENSE that should have accompanied this file.
*
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/>.
*/
#include "AboutDialog.h"
#include "OSXHelpers.h"
AboutDialog::AboutDialog(MainWindow *parent, const AppConfig &config)
: QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
Ui::AboutDialogBase() {
setupUi(this);
Implement safer memory use, improve dev env, fixed GUI bugs (#7407) * Improve dev script for daemon * Ignore `.user` files created by Qt * Add `FORCE_DESKTOP_PROCESS` option * Catch errors related to getting profile dir * Disable IPC entirely if forced desktop * Use in-class init for AppConfig members * Refactor config to use safer memory management * Improve launch config to make OS-specific debugger usage clearer * Re-enable MainWindowTests on Windows, further refactor for memory safety, fixed some include orders * Remove dead singleton code * Swap order of tests * Use HTTPs for URLs * Fixed compile errors for `SYNERGY_ENABLE_LICENSING` compile path * Restore exec function call * Remove extra link in cancel dialog * Fixed broken link on activation cancel UI * Close dialog if activated * Fixed macOS enum ref to kCurrentProcess * Improve wording on cancel activation dialog * WIP - Test timeout (compile error) * Finished timeout logic (with smart pointer) * Include string_view * Switch to thread from jthread (maybe not supported by macOS compiler?) * Improve comment * Disable test on Windows * Add TODO related to jthread on macOS * Refactor settings and paths on Windows * Launch in desktop mode on Windows * Remove arg quote wraps which break desktop mode * Fixed qFatal on Linux * Remove test value * Follow original `AppConfig` accessor convention * Disable service checkbox if not Windows * Simplify TLS control enable logic * Update command and Git ignore * Fixed code style * Fixed include consistency * Fixed includes in validator * Fixed lint errors * Update ChangeLog * Use smart pointer for core process * Remove unneccesary default operators * Don't halt on stderr
2024-07-22 16:48:02 +00:00
m_versionChecker.setApp(parent->appPath(config.coreClientName()));
QString version = SYNERGY_VERSION;
#ifdef GIT_SHA_SHORT
version += " (" GIT_SHA_SHORT ")";
#endif
m_pLabelSynergyVersion->setText(version);
QString buildDateString = QString::fromLocal8Bit(__DATE__).simplified();
QDate buildDate = QLocale("en_US").toDate(buildDateString, "MMM d yyyy");
m_pLabelBuildDate->setText(
buildDate.toString(QLocale::system().dateFormat(QLocale::LongFormat)));
}
int AboutDialog::exec() {
m_pDevelopersLabel->setText(getImportantDevelopers());
m_pCopyrightLabel->setText(getCopyright());
resizeWindow();
updateLogo();
return QDialog::exec();
}
void AboutDialog::resizeWindow() {
QSize size(600, 310);
setMaximumSize(size);
setMinimumSize(size);
resize(size);
}
void AboutDialog::updateLogo() const {
#if defined(Q_OS_MAC)
if (isOSXInterfaceStyleDark()) {
QPixmap logo(":/res/image/about-dark.png");
if (!logo.isNull()) {
m_pLabel_Logo->setPixmap(logo);
}
}
#endif
2012-06-10 16:50:54 +00:00
}
QString AboutDialog::getImportantDevelopers() const {
return QString(
// The ultimate creator
"Chris Schoeneman, "
// Precursor developers
"Richard Lee, Adam Feder, "
// Contributors
"Nick Bolton, Volker Lanz, Ryan Breen, Guido Poschta, "
"Bertrand Landry Hetu, Tom Chadwick, Brent Priddy, Jason Axelson, "
"Jake Petroules, Sorin Sbârnea, "
// Symless employees
"Kyle Bloom, Daun Chung, Serhii Hadzhylov, "
"Oleksandr Lysytsia, Olena Kutytska, Francisco Magalhães.");
}
QString AboutDialog::getCopyright() const {
QString buildDateString = QString::fromLocal8Bit(__DATE__).simplified();
QDate buildDate = QLocale("en_US").toDate(buildDateString, "MMM d yyyy");
QString copyright("Copyright © 2012-%%YEAR%% Symless Ltd.\n"
"Copyright © 2009-2012 Nick Bolton\n"
"Copyright © 2002-2009 Chris Schoeneman");
return copyright.replace(
QString("%%YEAR%%"), QString::number(buildDate.year()));
}