aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/modules/sonix/BootlogoModule.qml
blob: 5f744d103ad737af7ae7fdebfff104b461e429ae (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
// Copyright (C) 2026 Danilo M. <danix@danix.xyz>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
// published by the Free Software Foundation.
//
// 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.

import QtQuick
import "../.."

// The Sonix boot logo editor, in the settings window under Appearance.
// No draft: it edits no file. Save and Upload are in the header.
Module {
    name: "bootlogo"
    label: "Boot logo"
    icon: String.fromCodePoint(0xF075A)  // md-music
    settings: true
    group: "Appearance"
    keywords: ["boot", "logo", "sonix", "hiby", "splash", "player"]

    page: Component {
        Page {
            title: "Boot logo"
            actions: Component {
                Row {
                    spacing: 8
                    Text {
                        anchors.verticalCenter: parent.verticalCenter
                        width: Math.min(implicitWidth, 520)
                        elide: Text.ElideRight
                        text: tab.status
                        font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 4 }
                        color: tab.statusError ? Theme.yellow : Theme.green
                    }
                    Button {
                        text: tab.busy && !tab.waiting ? "Saving…" : "Save"
                        enabled: tab.canSave
                        onClicked: tab.save(null)
                    }
                    Button {
                        text: tab.waiting ? "Waiting for Wi-Fi transfer…" : "Upload"
                        enabled: tab.canSave && Sonix.present && !tab.waiting
                        onClicked: tab.upload()
                    }
                }
            }
            BootlogoTab { id: tab }
        }
    }
}