-
Notifications
You must be signed in to change notification settings - Fork 152
/
MainPage.qml
98 lines (87 loc) · 3.16 KB
/
MainPage.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
/*
* Fedora Media Writer
* Copyright (C) 2021-2022 Evžen Gasta <evzen.ml@seznam.cz>
*
* 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 2
* 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, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import QtQuick 6.2
import QtQuick.Controls 6.2
import QtQuick.Window 6.2
import QtQuick.Layouts 6.2
import QtQml 6.2
import QtQuick.Dialogs 6.2
Page {
id: mainPage
ColumnLayout {
anchors.fill: parent
spacing: units.gridUnit
Image {
source: "qrc:/mainPageImage"
Layout.fillHeight: true
Layout.fillWidth: true
fillMode: Image.PreserveAspectFit
sourceSize.width: parent.width
sourceSize.height: parent.height
smooth: true
antialiasing: true
}
Heading {
Layout.alignment: Qt.AlignHCenter
text: qsTr("Select Image Source")
level: 5
}
ButtonGroup {
id: radioGroup
}
ColumnLayout {
id: radioColumn
Layout.bottomMargin: drives.lastRestoreable ? 0 : restoreRadio.height + 5
RadioButton {
checked: mainWindow.selectedOption == Units.MainSelect.Download
text: qsTr("Download automatically")
onClicked: {
selectedOption = Units.MainSelect.Download
}
ButtonGroup.group: radioGroup
}
RadioButton {
text: qsTr("Select .iso file")
onClicked: {
selectedOption = Units.MainSelect.Write
releases.selectLocalFile("")
}
ButtonGroup.group: radioGroup
}
RadioButton {
id: restoreRadio
visible: drives.lastRestoreable
text: drives.lastRestoreable ? qsTr("Restore <b>%1</b>").arg(drives.lastRestoreable.name) : ""
onClicked: {
selectedOption = Units.MainSelect.Restore
}
ButtonGroup.group: radioGroup
Connections {
target: drives
function onLastRestoreableChanged() {
if (drives.lastRestoreable != null && !restoreRadio.visible)
restoreRadio.visible = true
if (!drives.lastRestoreable)
restoreRadio.visible = false
}
}
}
}
}
}