Commit 147b7172 authored by Martin Straka's avatar Martin Straka

Added signal and slot from c++ to QML dialogue

parent 7a0718ea
......@@ -111,14 +111,15 @@ ApplicationWindow {
/* Exposes nested stack to code outside the page component. */
property var nestedStack: null
/* Password/OTP input dialog, emitted from C++ */
InputDialogue {
id: inputDialog
onFinished: {
isds.pwdResponse(userName, accountName, pwd)
isds.returnInputDialogText(userName, accountName, pwd)
}
Connections {
target: isds
onPwdRequest: {
onOpenDialogRequest: {
inputDialog.openInputDialog(userName, accountName, title, text, hidePwd)
}
}
......
......@@ -409,6 +409,13 @@ bool IsdsWrapper::changePassword(const QString &userName,
return true;
}
void IsdsWrapper::returnInputDialogText(const QString &userName,
const QString &accountName, const QString &pwd)
{
/* TODO - save password to isds context in future */
qDebug() << userName << accountName << pwd;
}
bool IsdsWrapper::isLoggedToIsdsOtp(const QString &userName)
{
qDebug("%s()", __func__);
......
......@@ -136,6 +136,17 @@ public:
bool changePassword(const QString &userName,
const QString &accountName);
/*!
* @brief Password string from QML input dialog.
*
* @param[in] userName Account username string.
* @param[in] accountName Account name string.
* @param[in] pwd Password or OTP code.
*/
Q_INVOKABLE
void returnInputDialogText(const QString &userName,
const QString &accountName, const QString &pwd);
/*!
* @brief Test if user is connected to databox via OTP.
*
......@@ -158,6 +169,19 @@ public:
void closeAllOtpConnections(void);
signals:
/*!
* @brief Send open QML input dialog request to QML.
*
* @param[in] userName Account username string.
* @param[in] accountName Account name string.
* @param[in] title Dialogue title.
* @param[in] text Dialogue text.
* @param[in] hidePwd True means the password will be hidden.
*/
void openDialogRequest(QString userName, QString accountName,
QString title, QString text, bool hidePwd);
/*!
* @brief Set new statusbar text and active busy indicator to QML.
*
......
Markdown is supported
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