Changeset View
Changeset View
Standalone View
Standalone View
libs/declarative/networkstatus.cpp
Show First 20 Lines • Show All 68 Lines • ▼ Show 20 Line(s) | 68 | default: | |||
---|---|---|---|---|---|
69 | return NetworkStatus::Other; | 69 | return NetworkStatus::Other; | ||
70 | break; | 70 | break; | ||
71 | } | 71 | } | ||
72 | } | 72 | } | ||
73 | 73 | | |||
74 | NetworkStatus::NetworkStatus(QObject* parent) | 74 | NetworkStatus::NetworkStatus(QObject* parent) | ||
75 | : QObject(parent) | 75 | : QObject(parent) | ||
76 | { | 76 | { | ||
77 | connect(NetworkManager::notifier(), &NetworkManager::Notifier::connectivityChanged, this, &NetworkStatus::changeActiveConnections); | ||||
77 | connect(NetworkManager::notifier(), &NetworkManager::Notifier::statusChanged, this, &NetworkStatus::statusChanged); | 78 | connect(NetworkManager::notifier(), &NetworkManager::Notifier::statusChanged, this, &NetworkStatus::statusChanged); | ||
78 | connect(NetworkManager::notifier(), &NetworkManager::Notifier::activeConnectionsChanged, this, QOverload<>::of(&NetworkStatus::activeConnectionsChanged)); | 79 | connect(NetworkManager::notifier(), &NetworkManager::Notifier::activeConnectionsChanged, this, QOverload<>::of(&NetworkStatus::activeConnectionsChanged)); | ||
79 | 80 | | |||
80 | activeConnectionsChanged(); | 81 | activeConnectionsChanged(); | ||
81 | statusChanged(NetworkManager::status()); | 82 | statusChanged(NetworkManager::status()); | ||
82 | } | 83 | } | ||
83 | 84 | | |||
84 | NetworkStatus::~NetworkStatus() | 85 | NetworkStatus::~NetworkStatus() | ||
▲ Show 20 Lines • Show All 125 Lines • ▼ Show 20 Line(s) | 210 | if (active->type() == NetworkManager::ConnectionSettings::ConnectionType::WireGuard) { | |||
210 | conType = i18n("WireGuard"); | 211 | conType = i18n("WireGuard"); | ||
211 | connected = true; | 212 | connected = true; | ||
212 | } | 213 | } | ||
213 | 214 | | |||
214 | NetworkManager::Connection::Ptr connection = active->connection(); | 215 | NetworkManager::Connection::Ptr connection = active->connection(); | ||
215 | if (connecting) { | 216 | if (connecting) { | ||
216 | status = i18n("Connecting to %1", connection->name()); | 217 | status = i18n("Connecting to %1", connection->name()); | ||
217 | } else if (connected) { | 218 | } else if (connected) { | ||
219 | switch (NetworkManager::connectivity()) { | ||||
220 | case NetworkManager::NoConnectivity: | ||||
221 | status = i18n("Connected to %1 (no connectivity)", connection->name()); | ||||
222 | break; | ||||
223 | case NetworkManager::Limited: | ||||
224 | status = i18n("Connected to %1 (limited connectivity)", connection->name()); | ||||
225 | break; | ||||
226 | case NetworkManager::Portal: | ||||
227 | status = i18n("Connected to %1 (log in required)", connection->name()); | ||||
broulik: I think this is bit too technical. Maybe something like "authentication required" or whatever… | |||||
228 | break; | ||||
229 | default: | ||||
218 | status = i18n("Connected to %1", connection->name()); | 230 | status = i18n("Connected to %1", connection->name()); | ||
231 | break; | ||||
232 | } | ||||
219 | } | 233 | } | ||
220 | 234 | | |||
221 | if (!activeConnections.isEmpty()) { | 235 | if (!activeConnections.isEmpty()) { | ||
222 | activeConnections += '\n'; | 236 | activeConnections += '\n'; | ||
223 | } | 237 | } | ||
224 | activeConnections += format.arg(conType, status); | 238 | activeConnections += format.arg(conType, status); | ||
225 | 239 | | |||
226 | connect(connection.data(), &NetworkManager::Connection::updated, this, &NetworkStatus::changeActiveConnections, Qt::UniqueConnection); | 240 | connect(connection.data(), &NetworkManager::Connection::updated, this, &NetworkStatus::changeActiveConnections, Qt::UniqueConnection); | ||
Show All 24 Lines |
I think this is bit too technical. Maybe something like "authentication required" or whatever we use in the captive portal notification is better wording