summaryrefslogtreecommitdiff
path: root/gui/qml/logic.js
blob: 4fdbb995231893f56e7ded6bfae4bcf58288ae69 (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
let status = 'off';
let needsReconnect = false;

function setStatus(st) {
    status = st;
}

function getStatus() { 
    return status;
}

function setNeedsReconnect(val) {
    needsReconnect = val;
}

function getNeedsReconnect() {
    return needsReconnect;
}

function toHuman(st) {
    switch (st) {
    case "off":
        //: %1 -> application name
        return qsTr("%1 off").arg(ctx.appName)
    case "on":
        //: %1 -> application name
        return qsTr("%1 on").arg(ctx.appName)
    case "connecting":
        //: %1 -> application name
        return qsTr("Connecting to %1").arg(ctx.appName)
    case "stopping":
        //: %1 -> application name
        return qsTr("Stopping %1").arg(ctx.appName)
    case "failed":
        //: %1 -> application name
        return qsTr("%1 blocking internet").arg(
                    ctx.appName) // TODO failed is not handed yet
    }
}