Commit 553ee49d authored by Jan Grulich's avatar Jan Grulich
Browse files

Merge branch 'mm1port'

parents aa431a92 7efa456e
......@@ -29,7 +29,10 @@ endif (NOT NETWORKMANAGERQT_FOUND)
set(KDE_NETWORK_VERSION "0.9.3.1")
set(PLASMA_NM_VERSION "0.9.3.1")
set(MODEMMANAGERQT_VERSION ${MODEMMANAGERQT_VERSION})
if (${MODEMMANAGERQT_VERSION} VERSION_GREATER 0.7.990)
set(MODEMMANAGERQT_ONE 1)
endif()
configure_file(config.h.cmake
${CMAKE_CURRENT_BINARY_DIR}/config.h )
......@@ -55,6 +58,7 @@ include_directories(${CMAKE_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/lib
${CMAKE_CURRENT_SOURCE_DIR}/lib/editor
${QTNETWORK_INCLUDE_DIRS}
${MODEMMANAGER_INCLUDE_DIRS}
if (MODEMMANAGERQT_FOUND)
${MODEMMANAGERQT_INCLUDE_DIRS}
endif()
......
#cmakedefine KDE_NETWORK_VERSION "@KDE_NETWORK_VERSION@"
#cmakedefine PLASMA_NM_VERSION "@PLASMA_NM_VERSION@"
#cmakedefine MODEMMANAGERQT_VERSION "@MODEMMANAGERQT_VERSION@"
#cmakedefine MODEMMANAGERQT_ONE "@MODEMMANAGERQT_ONE@"
......@@ -21,8 +21,8 @@ set(plasma_networkmanagement_qml_plugins_SRCS
kde4_add_library(plasmanetworkmanagementplugins SHARED ${plasma_networkmanagement_qml_plugins_SRCS})
target_link_libraries(plasmanetworkmanagementplugins
NetworkManagerQt
ModemManagerQt
${NETWORKMANAGERQT_LDFLAGS}
${MODEMMANAGERQT_LDFLAGS}
plasmanetworkmanagement-internal
plasmanetworkmanagement-editor
${KDE4_PLASMA_LIBS}
......
......@@ -312,6 +312,20 @@ void ConnectionIcon::setModemIcon(const NetworkManager::Device::Ptr & device)
return;
}
#ifdef MODEMMANAGERQT_ONE
m_modemNetwork = modemDevice->getModemNetworkIface();
if (m_modemNetwork) {
connect(m_modemNetwork.data(), SIGNAL(signalQualityChanged(uint)),
SLOT(modemSignalChanged(uint)), Qt::UniqueConnection);
connect(m_modemNetwork.data(), SIGNAL(accessTechnologyChanged(ModemManager::Modem::AccessTechnologies)),
SLOT(setIconForModem()), Qt::UniqueConnection);
connect(m_modemNetwork.data(), SIGNAL(destroyed(QObject*)),
SLOT(modemNetworkRemoved()));
m_signal = m_modemNetwork->signalQuality().signal;
setIconForModem();
#else
m_modemNetwork = modemDevice->getModemNetworkIface().objectCast<ModemManager::ModemGsmNetworkInterface>();
if (m_modemNetwork) {
......@@ -324,6 +338,7 @@ void ConnectionIcon::setModemIcon(const NetworkManager::Device::Ptr & device)
m_signal = m_modemNetwork->getSignalQuality();
setIconForModem();
#endif
} else {
NMAppletDebug() << "Emit signal setConnectionIcon(network-mobile)";
Q_EMIT setConnectionIcon("network-mobile-0");
......@@ -352,7 +367,11 @@ void ConnectionIcon::modemSignalChanged(uint signal)
void ConnectionIcon::setIconForModem()
{
if (!m_signal) {
#ifdef MODEMMANAGERQT_ONE
m_signal = m_modemNetwork->signalQuality().signal;
#else
m_signal = m_modemNetwork->getSignalQuality();
#endif
}
QString strength = "00";
......@@ -372,6 +391,39 @@ void ConnectionIcon::setIconForModem()
QString result;;
#ifdef MODEMMANAGERQT_ONE
switch(m_modemNetwork->accessTechnologies()) {
case MM_MODEM_ACCESS_TECHNOLOGY_GSM:
case MM_MODEM_ACCESS_TECHNOLOGY_GSM_COMPACT:
result = "network-mobile-%1";
break;
case MM_MODEM_ACCESS_TECHNOLOGY_GPRS:
result = "network-mobile-%1-gprs";
break;
case MM_MODEM_ACCESS_TECHNOLOGY_EDGE:
result = "network-mobile-%1-edge";
break;
case MM_MODEM_ACCESS_TECHNOLOGY_UMTS:
result = "network-mobile-%1-umts";
break;
case MM_MODEM_ACCESS_TECHNOLOGY_HSDPA:
result = "network-mobile-%1-hsdpa";
break;
case MM_MODEM_ACCESS_TECHNOLOGY_HSUPA:
result = "network-mobile-%1-hsupa";
break;
case MM_MODEM_ACCESS_TECHNOLOGY_HSPA:
case MM_MODEM_ACCESS_TECHNOLOGY_HSPA_PLUS:
result = "network-mobile-%1-hspa";
break;
case MM_MODEM_ACCESS_TECHNOLOGY_LTE:
result = "network-mobile-%1-lte";
break;
default:
result = "network-mobile-%1";
break;
}
#else
switch(m_modemNetwork->getAccessTechnology()) {
case ModemManager::ModemInterface::UnknownTechnology:
case ModemManager::ModemInterface::Gsm:
......@@ -404,7 +456,7 @@ void ConnectionIcon::setIconForModem()
result = "network-mobile-%1";
break;
}
#endif
NMAppletDebug() << "Emit signal setConnectionIcon(" << QString(result).arg(strength) << ")";
Q_EMIT setConnectionIcon(QString(result).arg(strength));
Q_EMIT setTooltipIcon("phone");
......
......@@ -21,12 +21,19 @@
#ifndef PLASMA_NM_CONNECTION_ICON_H
#define PLASMA_NM_CONNECTION_ICON_H
#include "config.h"
#include <NetworkManagerQt/Manager>
#include <NetworkManagerQt/ActiveConnection>
#include <NetworkManagerQt/WirelessNetwork>
#if WITH_MODEMMANAGER_SUPPORT
#ifdef MODEMMANAGERQT_ONE
#include <ModemManagerQt/modem.h>
#else
#include <ModemManagerQt/modemgsmnetworkinterface.h>
#endif
#endif
class ConnectionIcon : public QObject
{
Q_OBJECT
......@@ -59,13 +66,17 @@ Q_SIGNALS:
void unsetHoverIcon();
private:
int m_signal;
uint m_signal;
NetworkManager::WirelessNetwork::Ptr m_wirelessNetwork;
void setDisconnectedIcon();
void setWirelessIcon(const NetworkManager::Device::Ptr & device, const QString & ssid);
#if WITH_MODEMMANAGER_SUPPORT
#ifdef MODEMMANAGERQT_ONE
ModemManager::Modem::Ptr m_modemNetwork;
#else
ModemManager::ModemGsmNetworkInterface::Ptr m_modemNetwork;
#endif
void setModemIcon(const NetworkManager::Device::Ptr & device);
#endif
};
......
......@@ -71,7 +71,7 @@ Model::Model(QObject* parent):
connect(m_monitor, SIGNAL(modemSignalQualityChanged(uint, QString)),
SLOT(modemSignalQualityChanged(uint, QString)));
#endif
connect(m_monitor, SIGNAL(removeActiveConnection(uint, QString)),
connect(m_monitor, SIGNAL(removeActiveConnection(QString)),
SLOT(removeActiveConnection(QString)));
connect(m_monitor, SIGNAL(removeAvailableConnection(QString,QString)),
SLOT(removeAvailableConnection(QString,QString)));
......
......@@ -37,7 +37,12 @@
#include <KGlobal>
#include <KLocale>
#if WITH_MODEMMANAGER_SUPPORT
#ifdef MODEMMANAGERQT_ONE
#include <ModemManagerQt/manager.h>
#include <ModemManagerQt/modem.h>
#endif
#endif
#include "model.h"
#include "uiutils.h"
#include "applet/globalconfig.h"
......@@ -366,6 +371,20 @@ void ModelItem::setDevice(const QString& device)
m_device = dev->ipInterfaceName();
}
m_devicePath = dev->uni();
#if WITH_MODEMMANAGER_SUPPORT
#ifdef MODEMMANAGERQT_ONE
if (dev->type() == NetworkManager::Device::Modem) {
ModemManager::ModemDevice::Ptr modemDevice = ModemManager::findModemDevice(dev->udi());
if (modemDevice) {
ModemManager::Modem::Ptr modemInterface = modemDevice->interface(ModemManager::ModemDevice::ModemInterface).objectCast<ModemManager::Modem>();
if (modemInterface) {
updateSignalStrenght(modemInterface->signalQuality().signal);
}
}
}
#endif
#endif
updateDetails();
} else {
m_devicePath.clear();
......
......@@ -148,6 +148,17 @@ void Monitor::addDevice(const NetworkManager::Device::Ptr& device)
NMMonitorDebug() << "Available modem device " << device->interfaceName();
NetworkManager::ModemDevice::Ptr modemDev = device.objectCast<NetworkManager::ModemDevice>();
#if WITH_MODEMMANAGER_SUPPORT
#ifdef MODEMMANAGERQT_ONE
ModemManager::Modem::Ptr modemNetwork = modemDev->getModemNetworkIface();
if (modemDev->isValid()) {
connect(modemNetwork.data(), SIGNAL(signalQualityChanged(uint)),
SLOT(gsmNetworkSignalQualityChanged(uint)), Qt::UniqueConnection);
connect(modemNetwork.data(), SIGNAL(accessTechnologyChanged(ModemManager::Modem::AccessTechnologies)),
SLOT(gsmNetworkAccessTechnologyChanged(ModemManager::Modem::AccessTechnologies)), Qt::UniqueConnection);
connect(modemNetwork.data(), SIGNAL(currentModesChanged()),
SLOT(gsmNetworkCurrentModesChanged()), Qt::UniqueConnection);
}
#else
ModemManager::ModemGsmNetworkInterface::Ptr modemNetwork = modemDev->getModemNetworkIface().objectCast<ModemManager::ModemGsmNetworkInterface>();
if (modemNetwork) {
connect(modemNetwork.data(), SIGNAL(signalQualityChanged(uint)),
......@@ -157,6 +168,7 @@ void Monitor::addDevice(const NetworkManager::Device::Ptr& device)
connect(modemNetwork.data(), SIGNAL(allowedModeChanged(ModemManager::ModemInterface::AllowedMode)),
SLOT(gsmNetworkAllowedModeChanged(ModemManager::ModemInterface::AllowedMode)), Qt::UniqueConnection);
}
#endif
#endif
}
......@@ -353,10 +365,19 @@ void Monitor::deviceRemoved(const QString& device)
NMMonitorDebug() << "Device " << device << " removed";
Q_EMIT removeConnectionsByDevice(device);
}
#if WITH_MODEMMANAGER_SUPPORT
#ifdef MODEMMANAGERQT_ONE
void Monitor::gsmNetworkAccessTechnologyChanged(ModemManager::Modem::AccessTechnologies technology)
#else
void Monitor::gsmNetworkAccessTechnologyChanged(ModemManager::ModemInterface::AccessTechnology technology)
#endif
{
#ifdef MODEMMANAGERQT_ONE
ModemManager::Modem * gsmNetwork = qobject_cast<ModemManager::Modem*>(sender());
#else
ModemManager::ModemGsmNetworkInterface * gsmNetwork = qobject_cast<ModemManager::ModemGsmNetworkInterface*>(sender());
#endif
if (gsmNetwork) {
foreach (const NetworkManager::Device::Ptr & dev, NetworkManager::networkInterfaces()) {
......@@ -373,9 +394,17 @@ void Monitor::gsmNetworkAccessTechnologyChanged(ModemManager::ModemInterface::Ac
}
}
#ifdef MODEMMANAGERQT_ONE
void Monitor::gsmNetworkCurrentModesChanged()
#else
void Monitor::gsmNetworkAllowedModeChanged(ModemManager::ModemInterface::AllowedMode mode)
#endif
{
#ifdef MODEMMANAGERQT_ONE
ModemManager::Modem * gsmNetwork = qobject_cast<ModemManager::Modem*>(sender());
#else
ModemManager::ModemGsmNetworkInterface * gsmNetwork = qobject_cast<ModemManager::ModemGsmNetworkInterface*>(sender());
#endif
if (gsmNetwork) {
foreach (const NetworkManager::Device::Ptr & dev, NetworkManager::networkInterfaces()) {
......@@ -383,7 +412,7 @@ void Monitor::gsmNetworkAllowedModeChanged(ModemManager::ModemInterface::Allowed
NetworkManager::ModemDevice::Ptr modem = dev.objectCast<NetworkManager::ModemDevice>();
if (modem) {
if (modem->getModemNetworkIface()->device() == gsmNetwork->device()) {
NMMonitorDebug() << "Modem " << modem->udi() << " allowed mode changed to " << mode;
NMMonitorDebug() << "Modem " << modem->udi() << " allowed modes changed";
Q_EMIT modemAllowedModeChanged(modem->uni());
}
}
......@@ -394,7 +423,11 @@ void Monitor::gsmNetworkAllowedModeChanged(ModemManager::ModemInterface::Allowed
void Monitor::gsmNetworkSignalQualityChanged(uint signal)
{
#ifdef MODEMMANAGERQT_ONE
ModemManager::Modem * gsmNetwork = qobject_cast<ModemManager::Modem*>(sender());
#else
ModemManager::ModemGsmNetworkInterface * gsmNetwork = qobject_cast<ModemManager::ModemGsmNetworkInterface*>(sender());
#endif
if (gsmNetwork) {
foreach (const NetworkManager::Device::Ptr & dev, NetworkManager::networkInterfaces()) {
......@@ -403,7 +436,11 @@ void Monitor::gsmNetworkSignalQualityChanged(uint signal)
if (modem) {
if (modem->getModemNetworkIface()->device() == gsmNetwork->device()) {
NMMonitorDebug() << "Modem " << modem->udi() << " signal changed to " << signal;
#ifdef MODEMMANAGERQT_ONE
Q_EMIT modemSignalQualityChanged(gsmNetwork->signalQuality().signal, modem->uni());
#else
Q_EMIT modemSignalQualityChanged(gsmNetwork->getSignalQuality(), modem->uni());
#endif
}
}
}
......
......@@ -28,9 +28,17 @@
#include <NetworkManagerQt/VpnConnection>
#include <NetworkManagerQt/WirelessNetwork>
#include <NetworkManagerQt/WirelessDevice>
#include "config.h"
#if WITH_MODEMMANAGER_SUPPORT
#ifdef MODEMMANAGERQT_ONE
#include <ModemManagerQt/modem.h>
#else
#include <ModemManagerQt/modeminterface.h>
#endif
#endif
class Monitor : public QObject
{
Q_OBJECT
......@@ -54,8 +62,13 @@ private Q_SLOTS:
void deviceAdded(const QString& device);
void deviceRemoved(const QString& device);
#if WITH_MODEMMANAGER_SUPPORT
#ifdef MODEMMANAGERQT_ONE
void gsmNetworkAccessTechnologyChanged(ModemManager::Modem::AccessTechnologies technology);
void gsmNetworkCurrentModesChanged();
#else
void gsmNetworkAccessTechnologyChanged(ModemManager::ModemInterface::AccessTechnology technology);
void gsmNetworkAllowedModeChanged(ModemManager::ModemInterface::AllowedMode mode);
#endif
void gsmNetworkSignalQualityChanged(uint signal);
#endif
void statusChanged(NetworkManager::Status status);
......
......@@ -15,7 +15,7 @@ kde4_add_ui_files(connectioneditor_SRCS
kde4_add_executable(kde-nm-connection-editor ${connectioneditor_SRCS})
target_link_libraries(kde-nm-connection-editor plasmanetworkmanagement-internal plasmanetworkmanagement-editor NetworkManagerQt ${QT_QTCORE_LIBRARY} ${QT_QTDBUS_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS})
target_link_libraries(kde-nm-connection-editor plasmanetworkmanagement-internal plasmanetworkmanagement-editor ${NETWORKMANAGERQT_LDFLAGS} ${MODEMMANAGERQT_LDFLAGS} ${QT_QTCORE_LIBRARY} ${QT_QTDBUS_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS})
install(TARGETS kde-nm-connection-editor DESTINATION ${INSTALL_TARGETS_DEFAULT_ARGS})
install(PROGRAMS kde-nm-connection-editor.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
......
......@@ -29,8 +29,8 @@ endif()
kde4_add_plugin(kded_networkmanagement ${kded_networkmanagement_SRCS})
target_link_libraries(kded_networkmanagement
NetworkManagerQt
ModemManagerQt
${NETWORKMANAGERQT_LDFLAGS}
${MODEMMANAGERQT_LDFLAGS}
plasmanetworkmanagement-internal
${KDE4_KDECORE_LIBS}
${KDE4_KDEUI_LIBS}
......
......@@ -22,6 +22,7 @@
#include "bluetoothmonitor.h"
#include "connectiondetaileditor.h"
#include "config.h"
#include <QDBusInterface>
#include <QDBusReply>
......@@ -38,6 +39,11 @@
#include <NetworkManagerQt/Manager>
#include <NetworkManagerQt/Utils>
#ifdef MODEMMANAGERQT_ONE
#include <ModemManagerQt/modem.h>
#include <ModemManagerQt/modemdevice.h>
#endif
BluetoothMonitor::BluetoothMonitor(QObject * parent)
: QObject(parent)
{
......@@ -219,14 +225,23 @@ void BluetoothMonitor::modemAdded(const QString &udi)
{
qDebug() << "Modem added" << udi;
#ifdef MODEMMANAGERQT_ONE
ModemManager::ModemDevice::Ptr modemDevice = ModemManager::findModemDevice(udi);
ModemManager::Modem::Ptr modem = modemDevice->interface(ModemManager::ModemDevice::ModemInterface).objectCast<ModemManager::Modem>();
#else
ModemManager::ModemInterface::Ptr modem = ModemManager::findModemInterface(udi, ModemManager::ModemInterface::GsmCard);
if (!modem) {
// Try CDMA if no GSM device has been found.
modem = ModemManager::findModemInterface(udi, ModemManager::ModemInterface::NotGsm);
}
#endif
#ifdef MODEMMANAGERQT_ONE
qDebug() << "Found suitable modem:" << modemDevice->uni();
#else
qDebug() << "Found suitable modem:" << modem->udi();
#endif
qDebug() << "DUN device:" << mDunDevice;
QStringList temp = mDunDevice.split('/');
......@@ -235,6 +250,7 @@ void BluetoothMonitor::modemAdded(const QString &udi)
}
if (!modem || modem->device() != mDunDevice) {
if (modem) {
KMessageBox::error(0, i18n("Device %1 is not the one we want (%2)", modem->device(), mDunDevice));
} else {
......@@ -244,6 +260,14 @@ void BluetoothMonitor::modemAdded(const QString &udi)
}
NetworkManager::ConnectionSettings::ConnectionType type;
#ifdef MODEMMANAGERQT_ONE
if (modemDevice->isGsmModem())
type = NetworkManager::ConnectionSettings::Gsm;
else if (modemDevice->isCdmaModem())
type = NetworkManager::ConnectionSettings::Cdma;
else
type = NetworkManager::ConnectionSettings::Unknown;
#else
switch (modem->type()) {
case ModemManager::ModemInterface::GsmType:
type = NetworkManager::ConnectionSettings::Gsm;
......@@ -254,6 +278,7 @@ void BluetoothMonitor::modemAdded(const QString &udi)
default:
type = NetworkManager::ConnectionSettings::Unknown;
}
#endif
if (type == NetworkManager::ConnectionSettings::Unknown) {
return;
......
......@@ -29,7 +29,14 @@
#include <KDebug>
#include <ModemManagerQt/manager.h>
#ifdef MODEMMANAGERQT_ONE
#include <ModemManager/ModemManager.h>
#include <ModemManagerQt/modemdevice.h>
#include <ModemManagerQt/modem.h>
#include <ModemManagerQt/sim.h>
#else
#include <ModemManagerQt/modemgsmcardinterface.h>
#endif
#include "pindialog.h"
......@@ -45,13 +52,16 @@ ModemMonitor::ModemMonitor(QObject * parent)
Q_D(ModemMonitor);
d->dialog.clear();
QObject::connect(ModemManager::notifier(),
SIGNAL(modemAdded(QString)),
this, SLOT(modemAdded(QString)));
QObject::connect(ModemManager::notifier(), SIGNAL(modemAdded(QString)), SLOT(modemAdded(QString)));
#ifdef MODEMMANAGERQT_ONE
foreach (const ModemManager::ModemDevice::Ptr &iface, ModemManager::modemDevices()) {
modemAdded(iface->uni());
}
#else
foreach (const ModemManager::ModemInterface::Ptr &iface, ModemManager::modemInterfaces()) {
modemAdded(iface->udi());
}
#endif
}
ModemMonitor::~ModemMonitor()
......@@ -59,6 +69,93 @@ ModemMonitor::~ModemMonitor()
delete d_ptr;
}
#ifdef MODEMMANAGERQT_ONE
void ModemMonitor::modemAdded(const QString & udi)
{
Q_D(ModemMonitor);
ModemManager::ModemDevice::Ptr modemDevice = ModemManager::findModemDevice(udi);
ModemManager::Modem::Ptr modem;
if (modemDevice) {
modem = modemDevice->interface(ModemManager::ModemDevice::ModemInterface).objectCast<ModemManager::Modem>();
} else {
return;
}
connect(modem.data(), SIGNAL(unlockRequiredChanged(MMModemLock)), SLOT(requestPin(MMModemLock)));
if (d->dialog || (modem && modem->unlockRequired() == MM_MODEM_LOCK_NONE) || (modem && modem->unlockRequired() == MM_MODEM_LOCK_UNKNOWN)) {
return;
}
if (modem) {
// Using queued invocation to prevent kded stalling here until user enters the pin.
QMetaObject::invokeMethod(modem.data(), "unlockRequiredChanged", Qt::QueuedConnection,
Q_ARG(MMModemLock, modem->unlockRequired()));
}
}
void ModemMonitor::requestPin(MMModemLock lock)
{
Q_D(ModemMonitor);
kDebug() << "unlockRequired == " << lock;
if (lock == MM_MODEM_LOCK_NONE || lock == MM_MODEM_LOCK_UNKNOWN) {
return;
}
ModemManager::Modem *modem = qobject_cast<ModemManager::Modem *>(sender());
if (!modem) {
return;
}
if (d->dialog) {
kDebug() << "PinDialog already running";
return;
}
if (lock == MM_MODEM_LOCK_SIM_PIN) {
d->dialog = new PinDialog(modem, PinDialog::Pin);
} else if (lock == MM_MODEM_LOCK_SIM_PUK) {
d->dialog = new PinDialog(modem, PinDialog::PinPuk);
} else {
// TODO handle other lock types?
kWarning() << "Unhandled unlock request for '" << lock << "'";
return;
}
if (d->dialog.data()->exec() != QDialog::Accepted) {
goto OUT;
}
kDebug() << "Sending unlock code";
{
ModemManager::Sim::Ptr sim = ModemManager::findSim(modem->simPath());
if (!sim) {
return;
}
QDBusPendingCallWatcher *watcher = 0;
if (d->dialog.data()->type() == PinDialog::Pin) {
QDBusPendingCall reply = sim->sendPin(d->dialog.data()->pin());
watcher = new QDBusPendingCallWatcher(reply, sim.data());
} else if (d->dialog.data()->type() == PinDialog::PinPuk) {
QDBusPendingCall reply = sim->sendPuk(d->dialog.data()->puk(), d->dialog.data()->pin());
watcher = new QDBusPendingCallWatcher(reply, sim.data());
}
connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), SLOT(onSendPinArrived(QDBusPendingCallWatcher*)));
}
OUT:
if(d->dialog) {
d->dialog.data()->deleteLater();
}
d->dialog.clear();
}
#else
void ModemMonitor::modemAdded(const QString & udi)
{
Q_D(ModemMonitor);
......@@ -140,6 +237,7 @@ OUT:
}
d->dialog.clear();
}
#endif
void ModemMonitor::onSendPinArrived(QDBusPendingCallWatcher * watcher)
{
......@@ -155,4 +253,3 @@ void ModemMonitor::onSendPinArrived(QDBusPendingCallWatcher * watcher)
watcher->deleteLater();
}
......@@ -25,12 +25,18 @@
#include <QObject>
#include <QDBusPendingCallWatcher>
#include "config.h"
#ifdef MODEMMANAGERQT_ONE
#include <ModemManager/ModemManager.h>
#include <ModemManagerQt/modem.h>
#endif
#include <kdemacros.h>
class ModemMonitorPrivate;
/**
* Monitors network hardware and maintains NetworkInterfaceActivatableProviders for them
* Monitors modem hardware and provides a PIN unlock dialog
*/
class KDE_EXPORT ModemMonitor : public QObject
{
......@@ -39,9 +45,13 @@ class KDE_EXPORT ModemMonitor : public QObject
public:
explicit ModemMonitor(QObject * parent);
virtual ~ModemMonitor();
public Q_SLOTS:
private slots:
void modemAdded(const QString&);
#ifdef MODEMMANAGERQT_ONE
void requestPin(MMModemLock lock);
#else
void requestPin(const QString &);
#endif
void onSendPinArrived(QDBusPendingCallWatcher *);
private:
ModemMonitorPrivate * d_ptr;
......
......@@ -19,6 +19,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include "pindialog.h"