Newer
Older
/** This file is part of Nootka (http://nootka.sf.net) *
* Copyright (C) 2021 by Tomasz Bojczuk (seelook@gmail.com) *
* on the terms of GNU GPLv3 license (http://www.gnu.org/licenses) */
property string titleText: NOO.isAndroid() ? "" : qsTr("Updates")
width: parent.width
height: parent.height
Connections {
target: dialogObj
function onUpdateSummary(version: string, changes: string, rules: var) : void {
console.log(version);
updateIt.version = version;
updateIt.changes = changes;
}
}
Column {
anchors.horizontalCenter: parent.horizontalCenter
spacing: NOO.factor() * (NOO.isAndroid() ? 0.25 : 1)
Item {
width: height
height: NOO.isAndroid() ? 0 : NOO.factor()
}
LinkText {
id: headText
visible: onlineIsNewer
width: updateIt.width - NOO.factor()
text: onlineIsNewer ? qsTr("New Nootka %1 is available.").arg(version) + "<br>" + qsTr("To get it, visit %1 Nootka site").arg("<a href=\"https://nootka.sourceforge.io/index.php/download/\">") + "</a>." : ""
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter
font {
pixelSize: NOO.factor() * (NOO.isAndroid() ? 1 : 1.5)
bold: true
}
GlowRect {
width: updateIt.width - NOO.factor() * 2
height: updateIt.height - upCol.height - (onlineIsNewer ? headText.height : 0) - NOO.factor() * (NOO.isAndroid() ? 1 : 4)
anchors.horizontalCenter: parent.horizontalCenter
color: activPal.base
Tflickable {
anchors.fill: parent
contentWidth: width
contentHeight: chText.height + NOO.factor()
LinkText {
id: chText
padding: NOO.factor() / 2
width: updateIt.width - NOO.factor() * 2
textFormat: Text.StyledText
text: changes
wrapMode: Text.WordWrap
horizontalAlignment: onlineIsNewer ? Text.AlignLeft : Text.AlignHCenter
}
}
Column {
id: upCol
anchors.horizontalCenter: parent.horizontalCenter
spacing: NOO.factor() * (NOO.isAndroid() ? 0.5 : 1)
id: checkChB
anchors.horizontalCenter: parent.horizontalCenter
text: qsTranslate("TupdateRulesWdg", "check for Nootka updates")
checked: updateCheck
onToggled: updateCheck = checked
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
Tile {
enabled: checkChB.checked
width: checkRow.width + NOO.factor() * 2
Row {
id: checkRow
anchors.horizontalCenter: parent.horizontalCenter
spacing: NOO.factor() * (NOO.isAndroid() ? 2 : 4)
ButtonGroup {
buttons: periodCol.children
}
Column {
id: periodCol
spacing: NOO.factor() * (NOO.isAndroid() ? 0.5 : 1)
TcheckBox {
id: dailyChB
text: qsTranslate("TupdateRulesWdg", "daily")
checked: rules.width === 0
onToggled: rules = Qt.size(0, rules.height)
}
TcheckBox {
id: weeklyChB
text: qsTranslate("TupdateRulesWdg", "weekly")
checked: rules.width === 1
onToggled: rules = Qt.size(1, rules.height)
}
TcheckBox {
id: monthlyChB
text: qsTranslate("TupdateRulesWdg", "monthly")
checked: rules.width > 1
onToggled: rules = Qt.size(2, rules.height)
}
}
ButtonGroup {
buttons: versionCol.children
}
Column {
id: versionCol
anchors.verticalCenter: parent.verticalCenter
spacing: NOO.factor() * (NOO.isAndroid() ? 0.5 : 1)
TcheckBox {
id: allChB
text: qsTranslate("TupdateRulesWdg", "all new versions")
checked: rules.height === 0
onToggled: rules = Qt.size(rules.width, 0)
}
TcheckBox {
id: stableChB
text: qsTranslate("TupdateRulesWdg", "stable versions only")
checked: rules.height !== 0
onToggled: rules = Qt.size(rules.width, 1)
}
}
}