Merge PR #174: Improve ConnectingPage a bit

This commit is contained in:
Jenkins 2019-03-25 15:17:35 +01:00
commit c71bb4e348
4 changed files with 50 additions and 33 deletions

View File

@ -178,5 +178,6 @@
<file>ui/system/GeneralSettingsPage.qml</file>
<file>ui/components/Imprint.qml</file>
<file>ui/appsettings/LookAndFeelSettingsPage.qml</file>
<file>ui/appsettings/AppLogPage.qml</file>
</qresource>
</RCC>

View File

@ -0,0 +1,33 @@
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import Nymea 1.0
import "../components"
Page {
header: GuhHeader {
text: qsTr("App log")
backButtonVisible: true
onBackPressed: pageStack.pop()
HeaderButton {
imageSource: "../images/edit-copy.svg"
onClicked: AppLogController.toClipboard()
}
}
ListView {
anchors.fill: parent
ScrollBar.vertical: ScrollBar {}
model: AppLogController
delegate: Text {
width: parent.width
maximumLineCount: 2
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
text: model.text
color: model.type === AppLogController.TypeWarning ? "red" : app.foregroundColor
font.pixelSize: app.smallFont
}
}
}

View File

@ -43,7 +43,7 @@ Page {
MeaListItemDelegate {
Layout.fillWidth: true
text: qsTr("View log")
onClicked: pageStack.push(appLogComponent)
onClicked: pageStack.push(Qt.resolvedUrl("../appsettings/AppLogPage.qml"))
enabled: AppLogController.enabled
}
@ -64,35 +64,4 @@ Page {
}
}
}
Component {
id: appLogComponent
Page {
header: GuhHeader {
text: qsTr("App log")
backButtonVisible: true
onBackPressed: pageStack.pop()
HeaderButton {
imageSource: "../images/edit-copy.svg"
onClicked: AppLogController.toClipboard()
}
}
ListView {
anchors.fill: parent
ScrollBar.vertical: ScrollBar {}
model: AppLogController
delegate: Text {
width: parent.width
maximumLineCount: 2
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
text: model.text
color: model.type === AppLogController.TypeWarning ? "red" : app.foregroundColor
font.pixelSize: app.smallFont
}
}
}
}
}

View File

@ -11,6 +11,20 @@ Page {
signal cancel()
ColorIcon {
anchors { top: parent.top; right: parent.right; margins: app.margins }
height: app.iconSize
width: height
name: "../images/logs.svg"
visible: settings.showHiddenOptions
MouseArea {
anchors.fill: parent
onClicked: {
onClicked: pageStack.push(Qt.resolvedUrl("../appsettings/AppLogPage.qml"))
}
}
}
ColumnLayout {
id: columnLayout
anchors { left: parent.left; right: parent.right; verticalCenter: parent.verticalCenter; margins: app.margins }
@ -28,7 +42,7 @@ Page {
}
Label {
Layout.fillWidth: true
text: engine.connection.currentHost.uuid
text: engine.connection.currentHost.name.length > 0 ? engine.connection.currentHost.name : engine.connection.currentHost.uuid
font.pixelSize: app.smallFont
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
horizontalAlignment: Text.AlignHCenter