# HG changeset patch # User František Kučera # Date 1567464192 -7200 # Node ID 7323a89c15e9714c8b7cb27f662ee6cf210869a5 # Parent d37c6dd9aa20fd1c5e36026ad206ed5003c6b47a clickable links in About panel diff -r d37c6dd9aa20 -r 7323a89c15e9 cadMousePro-gui/src/MouseMainWindow.cpp --- a/cadMousePro-gui/src/MouseMainWindow.cpp Mon Sep 02 00:23:37 2019 +0200 +++ b/cadMousePro-gui/src/MouseMainWindow.cpp Tue Sep 03 00:43:12 2019 +0200 @@ -81,29 +81,28 @@ tabs->addTab(panel, "Configuration"); } +void MouseMainWindow::appendAboutLine(QFormLayout* layout, const QString& label, const QString& value, QWidget* parent) { + QLabel* labelWidget = new QLabel(label, parent); + QLabel* textWidget = new QLabel(value, parent); + + textWidget->setTextInteractionFlags(Qt::TextInteractionFlag::TextSelectableByMouse | Qt::TextInteractionFlag::TextBrowserInteraction); + textWidget->setOpenExternalLinks(true); + + layout->addRow(labelWidget, textWidget); +} + void MouseMainWindow::initAboutPanel() { QWidget* panel = new QWidget(this); QFormLayout* layout = new QFormLayout(panel); - - int f = 0; - - layout->setWidget(f, QFormLayout::LabelRole, new QLabel("Program name:", panel)); - layout->setWidget(f++, QFormLayout::FieldRole, new QLabel("cadMousePro", panel)); - - layout->setWidget(f, QFormLayout::LabelRole, new QLabel("Description:", panel)); - layout->setWidget(f++, QFormLayout::FieldRole, new QLabel("configuration tool for 3DConnexion CadMouse Pro Wireless", panel)); - - layout->setWidget(f, QFormLayout::LabelRole, new QLabel("Author:", panel)); - layout->setWidget(f++, QFormLayout::FieldRole, new QLabel("Ing. František Kučera, Frantovo.cz, GlobalCode.info", panel)); - - layout->setWidget(f, QFormLayout::LabelRole, new QLabel("License:", panel)); - layout->setWidget(f++, QFormLayout::FieldRole, new QLabel("GNU GPLv3+", panel)); - - layout->setWidget(f, QFormLayout::LabelRole, new QLabel("Contact and support:", panel)); - layout->setWidget(f++, QFormLayout::FieldRole, new QLabel("https://mouse.globalcode.info/", panel)); - + + appendAboutLine(layout, "Program name:", "cadMousePro", panel); + appendAboutLine(layout, "Description:", "configuration tool for 3DConnexion CadMouse Pro Wireless", panel); + appendAboutLine(layout, "Author:", "Ing. František Kučera (Frantovo.cz, GlobalCode.info)", panel); + appendAboutLine(layout, "License:", "GNU GPLv3+", panel); + appendAboutLine(layout, "Contact and support:", "https://mouse.globalcode.info/", panel); + appendAboutLine(layout, "BTC:", "bc1qmt3qgzcf3a0f0tvnm70zjr0vhlchfyrjtnleqm", panel); + tabs->addTab(panel, "About"); - } void MouseMainWindow::refresh() { @@ -114,7 +113,7 @@ void MouseMainWindow::configure() { message->setText("…"); - + int frequency; // TODO: get value from the group if (configureFrequency125->isChecked()) frequency = 125; else if (configureFrequency250->isChecked()) frequency = 250; diff -r d37c6dd9aa20 -r 7323a89c15e9 cadMousePro-gui/src/MouseMainWindow.h --- a/cadMousePro-gui/src/MouseMainWindow.h Mon Sep 02 00:23:37 2019 +0200 +++ b/cadMousePro-gui/src/MouseMainWindow.h Tue Sep 03 00:43:12 2019 +0200 @@ -40,7 +40,7 @@ QTabWidget* tabs = new QTabWidget(this); QCheckBox* statusProxy = new QCheckBox("connected to Daemon", this); QCheckBox* statusUPower = new QCheckBox("connected to UPower", this); - QCheckBox* statusDevice = new QCheckBox("present", this); + QCheckBox* statusDevice = new QCheckBox("mouse found", this); QCheckBox* configureSmartScrolling = new QCheckBox("smart scrolling (free wheel)", this); QCheckBox* configureLiftOffDetection = new QCheckBox("lift-off detection", this); @@ -57,6 +57,8 @@ void initStatusPanel(); void initConfigurationPanel(); void initAboutPanel(); + + void appendAboutLine(QFormLayout* layout, const QString& label, const QString& value, QWidget* parent); private slots: void refresh();