Skip to content

Commit

Permalink
[connectionagent] open connection selector when called from
Browse files Browse the repository at this point in the history
connectToType and not autoconnectable.
  • Loading branch information
Lorn Potter committed Apr 15, 2014
1 parent 26930f9 commit f42a928
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
23 changes: 23 additions & 0 deletions connd/qconnectionagent.cpp
Expand Up @@ -82,6 +82,7 @@ QConnectionAgent::QConnectionAgent(QObject *parent) :
qDebug() << "XXXXXXXXXXX could not register object XXXXXXXXXXXXXXXXXX";
}

connect(this,SIGNAL(configurationNeeded(QString)),this,SLOT(openConnectionDialog(QString)));
askForRoaming = askRoaming();

connect(netman,SIGNAL(servicesListChanged(QStringList)),this,SLOT(servicesListChanged(QStringList)));
Expand Down Expand Up @@ -707,3 +708,25 @@ void QConnectionAgent::removeAllTypes(const QString &type)
orderedServicesList.removeOne(path);
}
}

void QConnectionAgent::openConnectionDialog(const QString &type)
{
// open Connection Selector
QDBusInterface *connSelectorInterface = new QDBusInterface(QStringLiteral("com.jolla.lipstick.ConnectionSelector"),
QStringLiteral("/"),
QStringLiteral("com.jolla.lipstick.ConnectionSelectorIf"),
QDBusConnection::sessionBus(),
this);

connSelectorInterface->connection().connect(QStringLiteral("com.jolla.lipstick.ConnectionSelector"),
QStringLiteral("/"),
QStringLiteral("com.jolla.lipstick.ConnectionSelectorIf"),
QStringLiteral("connectionSelectorClosed"),
this,
SLOT(connectionSelectorClosed(bool)));

QList<QVariant> args;
args.append(type);
QDBusMessage reply = connSelectorInterface->callWithArgumentList(QDBus::NoBlock,
QStringLiteral("openConnection"), args);
}
2 changes: 2 additions & 0 deletions connd/qconnectionagent.h
Expand Up @@ -137,6 +137,8 @@ private slots:
void scanTimeout();
void techTetheringChanged(bool b);
void servicesChanged();

void openConnectionDialog(const QString &type);
};

#endif // QCONNECTIONAGENT_H

0 comments on commit f42a928

Please sign in to comment.