~jonas-drange/ubuntu-system-settings/hotspots

« back to all changes in this revision

Viewing changes to plugins/cellular/Common.qml

  • Committer: jonas-drange
  • Date: 2015-07-31 15:03:10 UTC
  • mfrom: (1312.3.75 hotspots-binding)
  • Revision ID: jonas.drange@canonical.com-20150731150310-21t62nsd2zhd62jm
bzr merge lp:~jonas-drange/ubuntu-system-settings/hotspots-binding

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2015 Canonical Ltd
 
3
 *
 
4
 * This program is free software: you can redistribute it and/or modify
 
5
 * it under the terms of the GNU General Public License version 3 as
 
6
 * published by the Free Software Foundation.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful,
 
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
 * GNU General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU General Public License
 
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 *
 
16
 * Authors:
 
17
 * Jonas G. Drange <jonas.drange@canonical.com>
 
18
 *
 
19
*/
 
20
import QtQuick 2.0
 
21
 
 
22
Item {
 
23
    /*
 
24
        The mapping of code to string is taken from
 
25
        http://bazaar.launchpad.net/~vcs-imports/
 
26
            network-manager/trunk/view/head:/cli/src/common.c
 
27
 
 
28
        NetworkManager documentation: https://developer.gnome.org/
 
29
            NetworkManager/0.9/spec.html#type-NM_DEVICE_STATE_REASON
 
30
    */
 
31
    function reasonToString (reason) {
 
32
        switch (reason) {
 
33
            case 0:
 
34
                return i18n.tr("Unknown error");
 
35
            case 1:
 
36
                return i18n.tr("No reason given");
 
37
            case 2:
 
38
                return i18n.tr("Device is now managed");
 
39
            case 3:
 
40
                return i18n.tr("Device is now unmanaged");
 
41
            case 4:
 
42
                return i18n.tr("The device could not be readied for configuration");
 
43
            case 5:
 
44
                return i18n.tr("IP configuration could not be reserved (no available address, timeout, etc.)");
 
45
            case 6:
 
46
                return i18n.tr("The IP configuration is no longer valid");
 
47
            case 7:
 
48
                return i18n.tr("Your authentication details were incorrect");
 
49
            case 8:
 
50
                return i18n.tr("802.1X supplicant disconnected");
 
51
            case 9:
 
52
                return i18n.tr("802.1X supplicant configuration failed");
 
53
            case 10:
 
54
                return i18n.tr("802.1X supplicant failed");
 
55
            case 11:
 
56
                return i18n.tr("802.1X supplicant took too long to authenticate");
 
57
            case 15:
 
58
                return i18n.tr("DHCP client failed to start");
 
59
            case 16:
 
60
                return i18n.tr("DHCP client error");
 
61
            case 17:
 
62
                return i18n.tr("DHCP client failed");
 
63
            case 18:
 
64
                return i18n.tr("Shared connection service failed to start");
 
65
            case 19:
 
66
                return i18n.tr("Shared connection service failed");
 
67
            case 35:
 
68
                return i18n.tr("Necessary firmware for the device may be missing");
 
69
            case 36:
 
70
                return i18n.tr("The device was removed");
 
71
            case 37:
 
72
                return i18n.tr("NetworkManager went to sleep");
 
73
            case 38:
 
74
                return i18n.tr("The device's active connection disappeared");
 
75
            case 39:
 
76
                return i18n.tr("Device disconnected by user or client");
 
77
            case 41:
 
78
                return i18n.tr("The device's existing connection was assumed");
 
79
            case 42:
 
80
                return i18n.tr("The supplicant is now available");
 
81
            case 43:
 
82
                return i18n.tr("The modem could not be found");
 
83
            case 44:
 
84
                return i18n.tr("The Bluetooth connection failed or timed out");
 
85
            case 50:
 
86
                return i18n.tr("A dependency of the connection failed");
 
87
            case 52:
 
88
                return i18n.tr("ModemManager is unavailable");
 
89
            case 53:
 
90
                return i18n.tr("The Wi-Fi network could not be found");
 
91
            case 54:
 
92
                return i18n.tr("A secondary connection of the base connection failed");
 
93
            default:
 
94
                return i18n.tr("Unknown");
 
95
        }
 
96
    }
 
97
}