@@ -33,52 +33,6 @@ class NMWirelessCapabilities: public QObject {
3333 Q_ENUM (Enum);
3434};
3535
36- // In sync with https://networkmanager.dev/docs/api/latest/nm-dbus-types.html#NMDeviceState.
37- class NMDeviceState : public QObject {
38- Q_OBJECT;
39- QML_ELEMENT;
40- QML_SINGLETON;
41-
42- public:
43- enum Enum : quint8 {
44- Unknown = 0 ,
45- Unmanaged = 10 ,
46- Unavailable = 20 ,
47- Disconnected = 30 ,
48- Prepare = 40 ,
49- Config = 50 ,
50- NeedAuth = 60 ,
51- IPConfig = 70 ,
52- IPCheck = 80 ,
53- Secondaries = 90 ,
54- Activated = 100 ,
55- Deactivating = 110 ,
56- Failed = 120 ,
57- };
58- Q_ENUM (Enum);
59- Q_INVOKABLE static QString toString (NMDeviceState::Enum state) {
60- switch (state) {
61- case Unknown: return QStringLiteral (" Unknown" );
62- case Unmanaged: return QStringLiteral (" Not managed by NetworkManager" );
63- case Unavailable: return QStringLiteral (" Unavailable" );
64- case Disconnected: return QStringLiteral (" Disconnected" );
65- case Prepare: return QStringLiteral (" Preparing to connect" );
66- case Config: return QStringLiteral (" Connecting to a network" );
67- case NeedAuth: return QStringLiteral (" Waiting for authentication" );
68- case IPConfig: return QStringLiteral (" Requesting IPv4 and/or IPv6 addresses from the network" );
69- case IPCheck:
70- return QStringLiteral (
71- " Checking whether further action is required for the requested connection"
72- );
73- case Secondaries:
74- return QStringLiteral (" Waiting for a required secondary connection to activate" );
75- case Activated: return QStringLiteral (" Connected" );
76- case Deactivating: return QStringLiteral (" Disconnecting" );
77- case Failed: return QStringLiteral (" Failed to connect" );
78- };
79- };
80- };
81-
8236// Indicates the 802.11 mode an access point is currently in.
8337// In sync with https://networkmanager.dev/docs/api/latest/nm-dbus-types.html#NM80211Mode.
8438class NM80211Mode : public QObject {
@@ -142,8 +96,6 @@ class NM80211ApSecurityFlags: public QObject {
14296// In sync with https://networkmanager.dev/docs/api/latest/nm-dbus-types.html#NMActiveConnectionState.
14397class NMConnectionState : public QObject {
14498 Q_OBJECT;
145- QML_ELEMENT;
146- QML_SINGLETON;
14799
148100public:
149101 enum Enum : quint8 {
@@ -154,63 +106,6 @@ class NMConnectionState: public QObject {
154106 Deactivated = 4
155107 };
156108 Q_ENUM (Enum);
157- Q_INVOKABLE static QString toString (NMConnectionState::Enum state) {
158- switch (state) {
159- case Unknown: return " Unknown" ;
160- case Activating: return " Activating" ;
161- case Activated: return " Activated" ;
162- case Deactivating: return " Deactivating" ;
163- case Deactivated: return " Deactivated" ;
164- }
165- }
166- };
167-
168- // Active connection state reasons.
169- // In sync with https://networkmanager.dev/docs/api/latest/nm-dbus-types.html#NMActiveConnectionStateReason.
170- class NMConnectionStateReason : public QObject {
171- Q_OBJECT;
172- QML_ELEMENT;
173- QML_SINGLETON;
174-
175- public:
176- enum Enum : quint8 {
177- Unknown = 0 ,
178- None = 1 ,
179- UserDisconnected = 2 ,
180- DeviceDisconnected = 3 ,
181- ServiceStopped = 4 ,
182- IpConfigInvalid = 5 ,
183- ConnectTimeout = 6 ,
184- ServiceStartTimeout = 7 ,
185- ServiceStartFailed = 8 ,
186- NoSecrets = 9 ,
187- LoginFailed = 10 ,
188- ConnectionRemoved = 11 ,
189- DependencyFailed = 12 ,
190- DeviceRealizeFailed = 13 ,
191- DeviceRemoved = 14
192- };
193- Q_ENUM (Enum);
194- Q_INVOKABLE static QString toString (NMConnectionStateReason::Enum reason) {
195- switch (reason) {
196- case Unknown: return " Unknown" ;
197- case None: return " No reason" ;
198- case UserDisconnected: return " User disconnection" ;
199- case DeviceDisconnected: return " The device the connection was using was disconnected." ;
200- case ServiceStopped: return " The service providing the VPN connection was stopped." ;
201- case IpConfigInvalid: return " The IP config of the active connection was invalid." ;
202- case ConnectTimeout: return " The connection attempt to the VPN service timed out." ;
203- case ServiceStartTimeout:
204- return " A timeout occurred while starting the service providing the VPN connection." ;
205- case ServiceStartFailed: return " Starting the service providing the VPN connection failed." ;
206- case NoSecrets: return " Necessary secrets for the connection were not provided." ;
207- case LoginFailed: return " Authentication to the server failed." ;
208- case ConnectionRemoved: return " Necessary secrets for the connection were not provided." ;
209- case DependencyFailed: return " Master connection of this connection failed to activate." ;
210- case DeviceRealizeFailed: return " Could not create the software device link." ;
211- case DeviceRemoved: return " The device this connection depended on disappeared." ;
212- };
213- };
214109};
215110
216111} // namespace qs::network
0 commit comments