mirror of
https://github.com/FAUSheppy/speech-server-client-qt
synced 2025-12-06 00:41:35 +01:00
add more information to about
This commit is contained in:
25
about.cpp
25
about.cpp
@@ -9,6 +9,8 @@
|
||||
|
||||
#define Y_POS_VERSION 0
|
||||
#define Y_POS_SERVER_INFO 1
|
||||
#define Y_POS_BUILD_DATE 2
|
||||
#define Y_POS_BUILD_HOST 3
|
||||
|
||||
About::About(QWidget *parent, QSettings *settings) : QMainWindow(parent) {
|
||||
|
||||
@@ -19,7 +21,9 @@ About::About(QWidget *parent, QSettings *settings) : QMainWindow(parent) {
|
||||
QGridLayout *layoutLegal = new QGridLayout();
|
||||
QGroupBox *legalGroup = new QGroupBox();
|
||||
legalGroup->setTitle("Rechtliches");
|
||||
QLabel *licenseLabel = new QLabel("Diese Software wird unter der<a href=\"https://www.gnu.org/licenses/gpl-3.0-standalone.html\">GPLv3</a>verbreitet.<br>Code und Kompelierungsinstruktionen sind konform zur Lizenz<a href=\"https://github.com/FAUSheppy/speech-server-client-qt\">hier</a> zugänglich.");
|
||||
QLabel *licenseLabel = new QLabel("Diese Software wird unter der <a href=\"https://www.gnu.org/licenses/gpl-3.0-standalone.html\">GPLv3</a> verbreitet."
|
||||
"<br>Code und Kompelierungsinstruktionen sind konform zur Lizenz <a href=\"https://github.com/FAUSheppy/speech-server-client-qt\">hier</a> "
|
||||
"zugänglich.");
|
||||
licenseLabel->setOpenExternalLinks(true);
|
||||
layoutLegal->addWidget(licenseLabel, 0, 0);
|
||||
layoutLegal->addWidget(new QLabel("Author: Yannik Schmidt"), 1, 0);
|
||||
@@ -29,15 +33,25 @@ About::About(QWidget *parent, QSettings *settings) : QMainWindow(parent) {
|
||||
layoutSoftwareinfo = new QGridLayout();
|
||||
softwareInfoGroup = new QGroupBox();
|
||||
QString *version = getCurrentVersion();
|
||||
QLabel *versionLabelIdent = new QLabel("Version:");
|
||||
QLabel *versionLabelIdent = new QLabel("GUI Version:");
|
||||
QLabel *versionLabel = new QLabel();
|
||||
serverInfo = new QLabel("Wird ermittelt..");
|
||||
versionLabel->setText(*version);
|
||||
|
||||
QLabel *buildDateLabelIdent = new QLabel("Version gebaut:");
|
||||
QLabel *buildDateLabel = new QLabel(BUILD_DATE);
|
||||
layoutSoftwareinfo->addWidget(buildDateLabelIdent, Y_POS_BUILD_DATE, 0);
|
||||
layoutSoftwareinfo->addWidget(buildDateLabel, Y_POS_BUILD_DATE, 1);
|
||||
|
||||
QLabel *buildHostLabelIdent = new QLabel("Kompilations Host:");
|
||||
QLabel *buildHostLabel = new QLabel(BUILD_HOST);
|
||||
layoutSoftwareinfo->addWidget(buildHostLabelIdent, Y_POS_BUILD_HOST, 0);
|
||||
layoutSoftwareinfo->addWidget(buildHostLabel, Y_POS_BUILD_HOST, 1);
|
||||
|
||||
softwareInfoGroup->setTitle("Software Information");
|
||||
layoutSoftwareinfo->addWidget(versionLabelIdent, Y_POS_VERSION, 0);
|
||||
layoutSoftwareinfo->addWidget(versionLabel, Y_POS_VERSION, 1);
|
||||
layoutSoftwareinfo->addWidget(new QLabel("Server:"), Y_POS_SERVER_INFO, 0);
|
||||
layoutSoftwareinfo->addWidget(new QLabel("Server Version:"), Y_POS_SERVER_INFO, 0);
|
||||
layoutSoftwareinfo->addWidget(serverInfo, Y_POS_SERVER_INFO, 1);
|
||||
softwareInfoGroup->setLayout(layoutSoftwareinfo);
|
||||
|
||||
@@ -66,10 +80,11 @@ void About::handleServerVersion(QNetworkReply* reply){
|
||||
}else {
|
||||
QJsonDocument json = QJsonDocument::fromJson(reply->readAll());
|
||||
auto serverInfoValue = json["server-version"].toString();
|
||||
serverInfo->setText(serverInfoValue);
|
||||
serverInfo->setText(serverInfoValue + " (kompatibel)");
|
||||
}
|
||||
}
|
||||
|
||||
QString* About::getCurrentVersion(){
|
||||
return new QString(GIT_VERSION);
|
||||
QString *string = new QString(GIT_VERSION);
|
||||
return string;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
#-------------------------------------------------
|
||||
|
||||
GIT_STR_VERSION = $$system(git describe)
|
||||
DATE_STR = $$system(date)
|
||||
HOSTNAME_STR = $$system(hostname)
|
||||
|
||||
QT += core gui network
|
||||
|
||||
@@ -19,6 +21,8 @@ TEMPLATE = app
|
||||
# deprecated API in order to know how to port your code away from it.
|
||||
DEFINES += QT_DEPRECATED_WARNINGS
|
||||
DEFINES += "GIT_VERSION=\"\\\"$$GIT_STR_VERSION\\\"\""
|
||||
DEFINES += "BUILD_DATE=\"\\\"$$DATE_STR\\\"\""
|
||||
DEFINES += "BUILD_HOST=\"\\\"$$HOSTNAME_STR\\\"\""
|
||||
|
||||
# You can also make your code fail to compile if you use deprecated APIs.
|
||||
# In order to do so, uncomment the following line.
|
||||
|
||||
Reference in New Issue
Block a user