summaryrefslogtreecommitdiff
path: root/raveos-calamares-module/wifi-onallo/qml/Onallo.qml
blob: eea0e794eb4763c41b870673f8a1aefa262e5a3d (plain)
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
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import QtQuick.Window 2.15
import RaveOS 1.0

Window {
    id: ablak
    visible: true
    x: 0
    y: 0
    width: Screen.width
    height: Screen.height
    visibility: Window.FullScreen
    color: Stilus.hatter
    title: "RaveOS Wi-Fi"

    readonly property bool magyar: systemLocale.startsWith("hu")

    function kilep(kod) {
        Qt.exit(kod)
    }

    Timer {
        id: tovabbIdozito
        interval: 1500
        onTriggered: ablak.kilep(0)
    }

    Component.onCompleted: {
        if (nm.connected)
            tovabbIdozito.restart()
    }

    Connections {
        target: nm
        function onConnectionChanged() {
            if (nm.connected)
                tovabbIdozito.restart()
            else
                tovabbIdozito.stop()
        }
    }

    Shortcut {
        sequence: "Esc"
        onActivated: ablak.kilep(1)
    }

    component KeretesGomb: Button {
        id: gomb
        Layout.preferredHeight: 44
        leftPadding: 20
        rightPadding: 20
        background: Rectangle {
            color: gomb.hovered ? Stilus.aktiv : "transparent"
            border.width: 1
            border.color: Stilus.keretErosebb
        }
        contentItem: Text {
            text: gomb.text
            color: Stilus.szoveg
            font.family: Stilus.font
            font.pixelSize: 14
            font.weight: Font.Medium
            verticalAlignment: Text.AlignVCenter
        }
    }

    component ZoldGomb: Button {
        id: gomb
        Layout.preferredHeight: 44
        leftPadding: 24
        rightPadding: 24
        background: Rectangle {
            color: !gomb.enabled ? "transparent" : (gomb.hovered ? Stilus.zoldHover : Stilus.zold)
            border.width: gomb.enabled ? 0 : 1
            border.color: Stilus.keret
        }
        contentItem: Text {
            text: gomb.text
            color: gomb.enabled ? Stilus.zoldonSzoveg : Stilus.szovegHalvany
            font.family: Stilus.font
            font.pixelSize: 14
            font.weight: Font.DemiBold
            verticalAlignment: Text.AlignVCenter
        }
    }

    ColumnLayout {
        anchors.fill: parent
        spacing: 0

        Loader {
            Layout.fillWidth: true
            Layout.fillHeight: true
            source: wifiOldal
            onStatusChanged: {
                if (status === Loader.Error)
                    ablak.kilep(2)
            }
        }

        Rectangle {
            Layout.fillWidth: true
            Layout.preferredHeight: 73
            color: Stilus.hatter

            Rectangle {
                anchors.top: parent.top
                anchors.left: parent.left
                anchors.right: parent.right
                height: 1
                color: Stilus.keret
            }

            RowLayout {
                anchors.fill: parent
                anchors.topMargin: 15
                anchors.bottomMargin: 14
                anchors.leftMargin: 56
                anchors.rightMargin: 56
                spacing: 12

                Text {
                    Layout.fillWidth: true
                    text: ablak.magyar
                          ? "A KAPCSOLAT UTÁN A TELEPÍTŐ FRISSÍTI MAGÁT"
                          : "THE INSTALLER UPDATES ITSELF ONCE CONNECTED"
                    elide: Text.ElideRight
                    color: Stilus.szovegHalvany
                    font.family: Stilus.mono
                    font.pixelSize: 12
                    font.letterSpacing: 1
                }

                KeretesGomb {
                    text: ablak.magyar ? "Kihagyás" : "Skip"
                    onClicked: ablak.kilep(1)
                }

                ZoldGomb {
                    text: ablak.magyar ? "Tovább" : "Continue"
                    enabled: nm.connected
                    onClicked: ablak.kilep(0)
                }
            }
        }
    }
}