Commit 4be000f0 authored by Lamarque Souza's avatar Lamarque Souza
Browse files

Use NetworkManager 0.9.8 API to distinguish between user deactivation and

activation error.
parent 3d5dac17
project(plasma-networkmanagement)
option(INSTALL_KNM_AUTOSTART "Install the autostart file for knetworkmanager. Warning: This prevents the plasmoid from working properly")
set (MINIMUM_NM_VERSION_REQUIRED "0.9.4")
set (MINIMUM_NM_VERSION_REQUIRED "0.9.8")
find_package(KDE4 REQUIRED)
include (KDE4Defaults)
......
......@@ -88,6 +88,10 @@ void NMDBusActiveConnectionProxy::setState(uint nmState)
aState = Knm::InterfaceConnection::Activated;
break;
case NM_ACTIVE_CONNECTION_STATE_DEACTIVATING:
aState = Knm::InterfaceConnection::Deactivating;
break;
case NM_ACTIVE_CONNECTION_STATE_DEACTIVATED:
aState = Knm::InterfaceConnection::Deactivated;
break;
default:
kDebug() << "Unhandled activation state" << nmState;
......
......@@ -117,13 +117,16 @@ void InterfaceNotificationHost::interfaceConnectionActivationStateChanged(Knm::I
m_activating.remove(ic);
KNotification::event(Event::Connected, m_interfaceNameLabel, i18nc("@info:status Notification text when a connection has been activated","%1 activated", ic->connectionName()), KIcon(Knm::Connection::iconName(ic->connectionType())).pixmap(QSize(iconSize,iconSize)), 0, KNotification::CloseOnTimeout, m_manager->componentData());
break;
case Knm::InterfaceConnection::Deactivated:
m_activating.remove(ic);
KNotification::event(Event::Disconnected, m_interfaceNameLabel, i18nc("@info:status Notification text when deactivating a connection","%1 deactivated", ic->connectionName()), KIcon(Knm::Connection::iconName(ic->connectionType())).pixmap(QSize(iconSize,iconSize)), 0, KNotification::CloseOnTimeout, m_manager->componentData());
break;
case Knm::InterfaceConnection::Unknown:
m_activating.remove(ic);
if (ic->connectionType() != Knm::Connection::Wireless || Solid::Control::NetworkManagerNm09::isWirelessHardwareEnabled()) {
if (ic->oldActivationState() == Knm::InterfaceConnection::Activating)
if (ic->oldActivationState() == Knm::InterfaceConnection::Activating) {
KNotification::event(Event::ConnectFailed, m_interfaceNameLabel, i18nc("@info:status Notification text when connection has failed","Connection %1 failed", ic->connectionName()), KIcon(Knm::Connection::iconName(ic->connectionType())).pixmap(QSize(iconSize,iconSize)), 0, KNotification::CloseOnTimeout, m_manager->componentData());
else
KNotification::event(Event::Disconnected, m_interfaceNameLabel, i18nc("@info:status Notification text when deactivating a connection","%1 deactivated", ic->connectionName()), KIcon(Knm::Connection::iconName(ic->connectionType())).pixmap(QSize(iconSize,iconSize)), 0, KNotification::CloseOnTimeout, m_manager->componentData());
}
}
break;
}
......
#ifndef PLASMA_NM_VERSION_H
#define PLASMA_NM_VERSION_H
static const char * plasmaNmVersion = "0.9.0.9 (nm09 20130610)";
static const char * plasmaNmVersion = "0.9.0.9 (nm09 20130615)";
#endif
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment