diff --git a/cspell.json b/cspell.json
index 166551cea..5160873bb 100644
--- a/cspell.json
+++ b/cspell.json
@@ -12,6 +12,7 @@
"Compat",
"contribs",
"Daun",
+ "Devs",
"Deskflow",
"distro",
"distros",
diff --git a/res/gui/app.qrc b/res/gui/app.qrc
index af963aed5..95067fc9b 100644
--- a/res/gui/app.qrc
+++ b/res/gui/app.qrc
@@ -10,6 +10,8 @@
icons/128x128/tray.png
image/welcome.png
icons/64x64/folder.png
+ icons/64x64/copy-light.png
+ icons/64x64/copy-dark.png
image/placeholder.png
diff --git a/res/gui/icons/64x64/copy-dark.png b/res/gui/icons/64x64/copy-dark.png
new file mode 100644
index 000000000..65aa86057
Binary files /dev/null and b/res/gui/icons/64x64/copy-dark.png differ
diff --git a/res/gui/icons/64x64/copy-light.png b/res/gui/icons/64x64/copy-light.png
new file mode 100644
index 000000000..690386905
Binary files /dev/null and b/res/gui/icons/64x64/copy-light.png differ
diff --git a/src/gui/src/dialogs/AboutDialog.cpp b/src/gui/src/dialogs/AboutDialog.cpp
index 362cf4b09..a6eadf639 100644
--- a/src/gui/src/dialogs/AboutDialog.cpp
+++ b/src/gui/src/dialogs/AboutDialog.cpp
@@ -1,5 +1,6 @@
/*
* Deskflow -- mouse and keyboard sharing utility
+ * Copyright (C) 2024 Chris Rizzitello
* Copyright (C) 2012 Symless Ltd.
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
@@ -22,123 +23,61 @@
#include "common/version.h"
#include "gui/style_utils.h"
+#include
#include
-#include
+#include
+#include
+#include
+#include
-using namespace deskflow::gui;
-
-//
-// AboutDialog::Deps
-//
-
-bool AboutDialog::Deps::isDarkMode() const
+AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent)
{
- return ::isDarkMode();
-}
-
-//
-// AboutDialog
-//
-
-AboutDialog::AboutDialog(QMainWindow *parent, std::shared_ptr deps)
- : QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
- Ui::AboutDialogBase(),
- m_pDeps(deps)
-{
-
- setupUi(this);
-
- this->setFixedSize(this->size());
+ setWindowTitle(tr("About Deskflow"));
QString version = QString::fromStdString(deskflow::version());
- m_pLabelDeskflowVersion->setTextInteractionFlags(Qt::TextSelectableByMouse);
- m_pLabelDeskflowVersion->setText(version);
- QString buildDateString = QString::fromLocal8Bit(BUILD_DATE).simplified();
- QDate buildDate = QLocale("en_US").toDate(buildDateString, "yyyy-MM-dd");
- m_pLabelBuildDate->setTextInteractionFlags(Qt::TextSelectableByMouse);
- m_pLabelBuildDate->setText(buildDate.toString(QLocale::system().dateFormat(QLocale::LongFormat)));
+ auto copyIcon = QIcon::fromTheme(
+ QIcon::ThemeIcon::EditCopy, deskflow::gui::isDarkMode() ? QIcon(s_darkCopy) : QIcon(s_lightCopy)
+ );
- this->setWindowTitle(QString("About %1").arg(DESKFLOW_APP_NAME));
-}
-
-int AboutDialog::exec()
-{
- m_pDevelopersLabel->setText(importantDevelopers());
- m_pCopyrightLabel->setText(QString::fromStdString(deskflow::copyright()));
- updateLogo();
-
- return QDialog::exec();
-}
-
-void AboutDialog::setLogo(const char *const &filename) const
-{
- QPixmap logo(filename);
- if (!logo.isNull()) {
- m_pLabel_Logo->setPixmap(logo);
- } else {
- qCritical("logo file not found: %s", qPrintable(filename));
- }
-}
-
-void AboutDialog::updateLogo() const
-{
- if (m_pDeps->isDarkMode()) {
- qDebug("showing dark logo");
- setLogo(":/image/logo-dark.png");
- } else {
- qDebug("showing light logo");
- setLogo(":/image/logo-light.png");
- }
-}
-
-QString AboutDialog::importantDevelopers() const
-{
- QStringList awesomePeople;
- awesomePeople
-
- // Chris is the ultimate creator, and the one who started it all in 2001.
- << "Chris Schoeneman"
-
- // Richard and Adam developed CosmoDeskflow, the 90's predecessor project.
- << "Richard Lee"
- << "Adam Feder"
-
- // Nick continued the legacy in 2009 started by Chris.
- << "Nick Bolton"
-
- // Volker wrote the first version of the GUI (QSynergy) in 2008.
- << "Volker Lanz"
-
- // Re-ignited the project in 2008 and rebuilt the community.
- << "Sorin Sbârnea"
-
- // Contributors of bug fixes in the early days.
- << "Ryan Breen"
- << "Guido Poschta"
- << "Bertrand Landry Hetu"
- << "Tom Chadwick"
- << "Brent Priddy"
- << "Jason Axelson"
- << "Jake Petroules"
-
- // Implemented Wayland support (libei and libportal).
- << "Peter Hutterer"
- << "Olivier Fourdan"
-
- // Symless employees (in order of joining).
- << "Kyle Bloom"
- << "Daun Chung"
- << "Serhii Hadzhylov"
- << "Oleksandr Lysytsia"
- << "Olena Kutytska"
- << "Owen Phillips"
- << "Daniel Evenson";
-
- for (auto &person : awesomePeople) {
- // prevent names from breaking on the space when wrapped
- person = person.replace(" ", QString::fromUtf8(" "));
- }
-
- return awesomePeople.join(", ") + ".";
+ auto btnCopyVersion = new QPushButton(copyIcon, QString(), this);
+ btnCopyVersion->setFlat(true);
+ connect(btnCopyVersion, &QPushButton::clicked, this, [version] { qApp->clipboard()->setText(version); });
+
+ auto versionLayout = new QHBoxLayout();
+ versionLayout->addWidget(new QLabel(tr("Version:")));
+ versionLayout->addWidget(new QLabel(version));
+ versionLayout->addWidget(btnCopyVersion);
+ versionLayout->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Fixed));
+
+ auto lblLogo = new QLabel(this);
+ lblLogo->setPixmap(deskflow::gui::isDarkMode() ? s_darkLogo : s_lightLogo);
+
+ auto lblCopyright = new QLabel(QString::fromStdString(deskflow::kCopyright));
+
+ auto boldFont = font();
+ boldFont.setBold(true);
+
+ auto lblDevsTitle = new QLabel(tr("Important developers"));
+ lblDevsTitle->setFont(boldFont);
+
+ auto lblDevsBody = new QLabel(QStringLiteral("%1\n").arg(s_awesomeDevs.join(", ")));
+ lblDevsBody->setWordWrap(true);
+
+ auto btnOk = new QPushButton(tr("Ok"), this);
+ btnOk->setDefault(true);
+ connect(btnOk, &QPushButton::clicked, this, [this] { close(); });
+
+ auto mainLayout = new QVBoxLayout();
+ mainLayout->addWidget(lblLogo);
+ mainLayout->addLayout(versionLayout);
+ mainLayout->addWidget(new QLabel(tr("Keyboard and mouse sharing application"), this));
+ mainLayout->addWidget(lblCopyright);
+ mainLayout->addWidget(lblDevsTitle);
+ mainLayout->addWidget(lblDevsBody);
+ mainLayout->addWidget(btnOk);
+
+ setLayout(mainLayout);
+ adjustSize();
+ setFixedSize(size());
}
diff --git a/src/gui/src/dialogs/AboutDialog.h b/src/gui/src/dialogs/AboutDialog.h
index 045acd9ba..3e8a92791 100644
--- a/src/gui/src/dialogs/AboutDialog.h
+++ b/src/gui/src/dialogs/AboutDialog.h
@@ -1,5 +1,6 @@
/*
* Deskflow -- mouse and keyboard sharing utility
+ * Copyright (C) 2024 Chris Rizzitello
* Copyright (C) 2012 Symless Ltd.
* Copyright (C) 2008 Volker Lanz (vl@fidra.de)
*
@@ -18,32 +19,60 @@
#pragma once
-#include "ui_AboutDialogBase.h"
-
#include
-#include
-class QWidget;
-class QString;
-
-class AboutDialog : public QDialog, public Ui::AboutDialogBase
+class AboutDialog : public QDialog
{
Q_OBJECT
-
public:
- struct Deps
- {
- virtual ~Deps() = default;
- virtual bool isDarkMode() const;
- };
-
- explicit AboutDialog(QMainWindow *parent, std::shared_ptr deps = std::make_shared());
- int exec() override;
+ explicit AboutDialog(QWidget *parent = nullptr);
+ ~AboutDialog() = default;
private:
- std::shared_ptr m_pDeps;
+ inline static const auto s_lightCopy = QStringLiteral(":/icons/64x64/copy-light.png");
+ inline static const auto s_darkCopy = QStringLiteral(":/icons/64x64/copy-dark.png");
+ inline static const auto s_lightLogo = QStringLiteral(":/image/logo-light.png");
+ inline static const auto s_darkLogo = QStringLiteral(":/image/logo-dark.png");
+ inline static const auto s_awesomeDevs = QStringList{
+ // Chris is the ultimate creator, and the one who started it all in 2001.
+ QStringLiteral("Chris Schoeneman"),
- void updateLogo() const;
- void setLogo(const char *const &filename) const;
- QString importantDevelopers() const;
+ // Richard and Adam developed CosmoSynergy, the 90's predecessor project.
+ QStringLiteral("Richard Lee"),
+ QStringLiteral("Adam Feder"),
+
+ // Nick continued the legacy in 2009 started by Chris.
+ QStringLiteral("Nick Bolton"),
+
+ // Volker wrote the first version of the GUI (QSynergy) in 2008.
+ QStringLiteral("Volker Lanz"),
+
+ // Re-ignited the project in 2008 and rebuilt the community.
+ QStringLiteral("Sorin Sbârnea"),
+
+ // Contributors of bug fixes in the early days.
+ QStringLiteral("Ryan Breen"),
+ QStringLiteral("Guido Poschta"),
+ QStringLiteral("Bertrand Landry Hetu"),
+ QStringLiteral("Tom Chadwick"),
+ QStringLiteral("Brent Priddy"),
+ QStringLiteral("Jason Axelson"),
+ QStringLiteral("Jake Petroules"),
+
+ // Implemented Wayland support (libei and libportal).
+ QStringLiteral("Peter Hutterer"),
+ QStringLiteral("Olivier Fourdan"),
+
+ // Symless employees (in order of joining).
+ QStringLiteral("Kyle Bloom"),
+ QStringLiteral("Daun Chung"),
+ QStringLiteral("Serhii Hadzhylov"),
+ QStringLiteral("Oleksandr Lysytsia"),
+ QStringLiteral("Olena Kutytska"),
+ QStringLiteral("Owen Phillips"),
+ QStringLiteral("Daniel Evenson"),
+
+ // Prominent Deskflow development community members
+ QStringLiteral("Chris Rizzitello"),
+ };
};
diff --git a/src/gui/src/dialogs/AboutDialogBase.ui b/src/gui/src/dialogs/AboutDialogBase.ui
deleted file mode 100644
index 1af5ea6c7..000000000
--- a/src/gui/src/dialogs/AboutDialogBase.ui
+++ /dev/null
@@ -1,255 +0,0 @@
-
-
- AboutDialogBase
-
-
- Qt::ApplicationModal
-
-
- true
-
-
-
- 0
- 0
- 600
- 400
-
-
-
- About Deskflow
-
-
- true
-
-
- -
-
-
- Copyright
-
-
-
- -
-
-
-
-
-
- Build Date:
-
-
-
- -
-
-
- Unknown
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
- &Ok
-
-
-
-
-
- -
-
-
-
- true
-
-
-
- Important developers
-
-
-
- -
-
-
- Keyboard and mouse sharing application.
-
-
-
- -
-
-
- Qt::Vertical
-
-
- QSizePolicy::Fixed
-
-
-
- 20
- 5
-
-
-
-
- -
-
-
-
-
-
- :/image/placeholder.png
-
-
- 0
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Developers
-
-
- Qt::RichText
-
-
- true
-
-
- 1
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 40
-
-
-
-
- -
-
-
-
-
-
-
- 0
- 0
-
-
-
- Version:
-
-
- 1
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Unknown
-
-
- 1
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
-
-
- -
-
-
- Qt::Vertical
-
-
- QSizePolicy::Fixed
-
-
-
- 20
- 5
-
-
-
-
- -
-
-
- Qt::Vertical
-
-
- QSizePolicy::Fixed
-
-
-
- 20
- 5
-
-
-
-
-
-
-
-
- buttonOk
- clicked()
- AboutDialogBase
- accept()
-
-
- 315
- 374
-
-
- 301
- 3
-
-
-
-
-
diff --git a/src/lib/common/copyright.h b/src/lib/common/copyright.h
index 0865155a0..6ae10d2fb 100644
--- a/src/lib/common/copyright.h
+++ b/src/lib/common/copyright.h
@@ -17,27 +17,11 @@
#pragma once
-#include
-#include
-#include
-
namespace deskflow {
-const auto kCopyrightFormat = //
- "Copyright (C) 2012-%s Symless Ltd.\n"
+const auto kCopyright = //
+ "Copyright (C) 2024 Deskflow Developers\n"
+ "Copyright (C) 2012-2024 Symless Ltd.\n"
"Copyright (C) 2009-2012 Nick Bolton\n"
"Copyright (C) 2002-2009 Chris Schoeneman";
-
-inline std::string copyright()
-{
- const std::string date = BUILD_DATE;
- const auto year = date.substr(0, 4);
- const auto kBufferLength = 256;
- std::vector buffer(kBufferLength);
- std::snprintf( // NOSONAR
- buffer.data(), kBufferLength, kCopyrightFormat, year.c_str()
- );
- return std::string(buffer.data());
-}
-
} // namespace deskflow
diff --git a/src/lib/deskflow/App.cpp b/src/lib/deskflow/App.cpp
index 512b99664..24775749e 100644
--- a/src/lib/deskflow/App.cpp
+++ b/src/lib/deskflow/App.cpp
@@ -94,13 +94,12 @@ App::~App()
void App::version()
{
const auto version = deskflow::version();
- const auto copyright = deskflow::copyright();
const auto kBufferLength = 1024;
std::vector buffer(kBufferLength);
std::snprintf( // NOSONAR
buffer.data(), kBufferLength, "%s v%s, protocol v%d.%d\n%s", //
- argsBase().m_pname, version.c_str(), kProtocolMajorVersion, kProtocolMinorVersion, copyright.c_str()
+ argsBase().m_pname, version.c_str(), kProtocolMajorVersion, kProtocolMinorVersion, deskflow::kCopyright
);
std::cout << std::string(buffer.data()) << std::endl;