-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmain.qml
150 lines (139 loc) · 3.9 KB
/
main.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
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
/* Unvanquished Updater
* Copyright (C) Unvanquished Developers
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Controls.Material 2.0
import Fluid.Controls 1.0 as FluidControls
import Fluid.Material 1.0 as FluidMaterial
import "utils.js" as Utils
ApplicationWindow {
id: root
visible: true
width: 1024
height: 768
title: qsTr("Unvanquished Updater")
Material.theme: Material.Light
Material.primary: Material.DarkBlue
Material.accent: Material.Violet
property string selectedInstallPath: updaterSettings.installPath
Connections {
target: downloader
ignoreUnknownSignals: true
onStatusMessage: {
console.log("Download status: " + message);
infoBar.open(message);
}
onFatalMessage: {
console.log("Installation failed: " + message);
errorPopup.errorDetail = message;
errorPopup.open();
root.alert(0);
}
}
Image {
width: parent.width
height: parent.height
source: "qrc:/resources/background.png"
}
Rectangle {
anchors.bottom: header.top
width: header.width
height: 3
color: "#2F1E1E"
}
Image {
id: header
width: parent.width
height: logo.height * 2
anchors {
top: parent.top
topMargin: parent.height * 0.1
}
source: "qrc:/resources/header.png"
}
Rectangle {
anchors.top: header.bottom
width: header.width
height: 3
color: "#2F1E1E"
}
Image {
id: tyrant
anchors {
right: parent.right
verticalCenter: header.verticalCenter
verticalCenterOffset: height * 0.20
}
width: parent.width * 0.25
fillMode: Image.PreserveAspectFit
source: "qrc:/resources/tyrant.png"
}
Image {
id: logo
anchors {
left: parent.left
verticalCenter: header.verticalCenter
leftMargin: 25
}
width: parent.width * 0.65
fillMode: Image.PreserveAspectFit
source: "qrc:/resources/logo.png"
}
FluidMaterial.ActionButton {
id: settingsAction
scale: 0.55
anchors.top: parent.top
anchors.right: parent.right
iconName: "action/settings"
Material.elevation: 1
Material.background: Material.Teal
onClicked: settingsBottomSheet.open()
}
News {
id: newsContainer
}
DownloadInfo {
id: downloadInfo
}
FluidMaterial.BottomSheet {
id: settingsBottomSheet
width: parent.width
maxHeight: parent.height * 0.30
height: maxHeight
Settings {}
FluidMaterial.ActionButton {
scale: 0.55
anchors.top: parent.top
anchors.right: parent.right
iconName: "navigation/cancel"
Material.elevation: 1
Material.background: Material.Red
onClicked: settingsBottomSheet.close()
}
}
FluidControls.InfoBar {
id: infoBar
duration: 3000
onClicked: {
this.hide();
}
}
UpdateFailed {
id: errorPopup
failedOperation: 'Game installation'
}
}