-
-
Notifications
You must be signed in to change notification settings - Fork 210
/
BadLayerItem.qml
120 lines (98 loc) · 3.08 KB
/
BadLayerItem.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
import QtQuick 2.14
import QtQuick.Controls 2.14
import QtQuick.Layouts 1.14
import org.qfield 1.0
import Theme 1.0
Page {
id: badLayerPage
property alias model: table.model
padding: 5
width: mainWindow.width
height: mainWindow.height
header: QfPageHeader {
title: qsTr( 'Unable to load some layers' )
showBackButton: false
showApplyButton: false
showCancelButton: true
topMargin: mainWindow.sceneTopMargin
onFinished: badLayerPage.visible = false
}
ColumnLayout {
anchors.margins: 8
anchors.bottomMargin: 8 + mainWindow.sceneBottomMargin
anchors.fill: parent
Layout.margins: 0
spacing: 10
Label {
Layout.fillWidth: true
Layout.fillHeight: false
text: qsTr( "The following layers could not be loaded, please review those and reconfigure the QGIS project." )
font: Theme.defaultFont
color: Theme.mainTextColor
wrapMode: Text.WordWrap
}
Rectangle {
Layout.fillWidth: true
Layout.fillHeight: true
color: Theme.controlBackgroundColor
border.color: Theme.controlBorderColor
border.width: 1
ListView {
id: table
flickableDirection: Flickable.VerticalFlick
boundsBehavior: Flickable.StopAtBounds
clip: true
spacing: 2
anchors.fill: parent
model: BadLayerHandler {
project: qgisProject
onBadLayersFound: {
badLayerPage.visible = true
}
}
delegate: Rectangle {
id: rectangle
width: parent ? parent.width : undefined
height: line.height
color: "transparent"
Column {
id: line
width: parent.width
spacing: 0
Text {
id: name
width: rectangle.width - padding * 2
padding: 5
text: LayerName
font: Theme.strongTipFont
color: Theme.mainTextColor
wrapMode: Text.WordWrap
}
Text {
id: uri
width: rectangle.width - padding * 2
padding: 5
text: DataSource
font: Theme.tipFont
color: Theme.secondaryTextColor
wrapMode: Text.WordWrap
}
}
}
}
}
Label {
Layout.fillWidth: true
Layout.fillHeight: false
Layout.topMargin: 5
text: qsTr( 'You may check the %1Portable Project%2 documentation page for more help.')
.arg( "<a href=\"https://docs.qfield.org/how-to/movable-project\">" )
.arg( "</a>" )
textFormat: Text.RichText
font: Theme.tipFont
color: Theme.secondaryTextColor
wrapMode: Text.WordWrap
onLinkActivated: (link) => { Qt.openUrlExternally(link) }
}
}
}