diff --git a/.gitignore b/.gitignore index 24e6943a911bebee7001917c76a8216eb39669b5..a8f3c8c2c0bebe67bcb6a4cc172c727e572f6777 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,8 @@ .DS_Store -ui/*.db -ui/*.qtds -ui/*.db-shm -ui/*.db-wal -ui/share.qrc +src/ui/*.db +src/ui/*.qtds +src/ui/*.db-shm +src/ui/*.db-wal +src/ui/share.qrc logcat.txt output.junit.xml diff --git a/src/backend/backend.cpp b/src/backend/backend.cpp index 35afbe21ab5161e273a71385b722c3ac3a160c76..79a35b82f7ef4d4ceb831f17f81e5f87b21de830 100644 --- a/src/backend/backend.cpp +++ b/src/backend/backend.cpp @@ -57,18 +57,6 @@ Backend::Backend(QObject *parent) m_backgroundTimer.setInterval(1000 * 10); enableBackgroundUpdate(updateInBackground()); -#ifdef QT_DEBUG - const QString buildType = "Debug"; -#else - const QString buildType = "Release"; -#endif - m_buildInfo = QCoreApplication::applicationVersion() + "\nTechnology Preview - " - + QString(CMAKE_VAR_GIT_VERSION) + "\nQt " + QString(QT_VERSION_STR) + " - " - + buildType + " Build" + "\nQt Quick Components " - + QString(CMAKE_VAR_QT_QUICK_COMPONENTS_VERSION) - + "\nZXing-Cpp: " + QString(CMAKE_VAR_ZXING_VERSION) - + "\nOpenSSL support: " + QVariant(QSslSocket::supportsSsl()).toString(); - const QRect screenGeometry = QGuiApplication::primaryScreen()->geometry(); qDebug() << "Qt Design Viewer"; qDebug() << "System information:"; @@ -78,6 +66,20 @@ Backend::Backend(QObject *parent) qDebug() << "-- Screen width: " << QString::number(screenGeometry.width()); } +QString Backend::buildInfo() const +{ +#ifdef QT_DEBUG + const QString buildType = "Debug"; +#else + const QString buildType = "Release"; +#endif + return {QCoreApplication::applicationVersion() + "\nTechnology Preview - " + + QString(CMAKE_VAR_GIT_VERSION) + "\nQt " + QString(QT_VERSION_STR) + " - " + buildType + + " Build" + "\nQt Quick Components " + QString(CMAKE_VAR_QT_QUICK_COMPONENTS_VERSION) + + "\nZXing-Cpp: " + QString(CMAKE_VAR_ZXING_VERSION) + + "\nOpenSSL support: " + QVariant(QSslSocket::supportsSsl()).toString()}; +} + void Backend::enableBackgroundUpdate(const bool &enabled) { if (enabled) { diff --git a/src/backend/backend.h b/src/backend/backend.h index c7f209032a72f06c5e3567aa049301a79742759d..dd8b563f66af7d6766028be8e872d9a8e57e08d0 100644 --- a/src/backend/backend.h +++ b/src/backend/backend.h @@ -52,7 +52,6 @@ public: private: // UI data QString m_logs; - QString m_buildInfo; QJsonArray m_projectList; // Other members @@ -77,9 +76,6 @@ signals: // UI signals - Logs page void logsChanged(QString); - // UI signals - About page - void buildInfoChanged(QString); - // UI signals - Popup void downloadProgress(float); void popupProgressIndeterminateChanged(bool indeterminate); @@ -91,7 +87,7 @@ signals: void networkUpdated(QString); public slots: - QString buildInfo() const { return m_buildInfo; } + QString buildInfo() const; void scanQrCode(); void runOnlineProject(const QString &url); diff --git a/src/ui/AboutHeader.qml b/src/ui/AboutHeader.qml index e07e5c3e195cc80de0f3431d553d99ee3bf39587..1a18df5971d59357c47f76fe6a9823fe24453c42 100644 --- a/src/ui/AboutHeader.qml +++ b/src/ui/AboutHeader.qml @@ -4,14 +4,13 @@ import QtQuick.Layouts Item { - id: header + id: headerPage ColumnLayout { anchors.fill: parent Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter Item { - id: item2 width: 200 height: 200 Layout.preferredHeight: 10 @@ -19,23 +18,15 @@ Item { } Label { - id: logs Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter horizontalAlignment: "AlignHCenter" text: backend.buildInfo() } + Item { - id: item1 Layout.fillHeight: true Layout.fillWidth: true } - - Connections { - target: backend - function onBuildInfoChanged(buildInfo){ - logs.text = buildInfo; - } - } } } diff --git a/src/ui/main.qml b/src/ui/main.qml index 47f54808fa2b99759ca32b0ba8d4f0e4b1e95891..bd782663f6485d7ae737c616f32cf57d0750d7e5 100644 --- a/src/ui/main.qml +++ b/src/ui/main.qml @@ -35,7 +35,7 @@ Rectangle { } Popup { - property var popupCloseReceived : false + property bool popupCloseReceived : false id: popup anchors.centerIn: parent width: 300 @@ -114,10 +114,10 @@ Rectangle { Layout.fillWidth: true } - // Network { - // id: networkPage - // Layout.fillWidth: true - // } + Network { + id: networkPage + Layout.fillWidth: true + } SettingsPage { id: settingsPage @@ -213,18 +213,18 @@ Rectangle { } } - // TabButton { - // id: network - // text: qsTr("Network") - // Layout.fillWidth: true - // checkable: true - // autoExclusive: true - // visible: true; - // onClicked: { - // stackLayout.currentIndex = 3 - // drawer.close() - // } - // } + TabButton { + id: network + text: qsTr("Network") + Layout.fillWidth: true + checkable: true + autoExclusive: true + visible: false; + onClicked: { + stackLayout.currentIndex = 3 + drawer.close() + } + } TabButton { id: settings