Commit ad6e271b authored by Karel Slaný's avatar Karel Slaný

Merge branch 'change-account-username' into 'develop'

Allow to Change Account Username

See merge request !132
parents 7233124f 754b4199
......@@ -8,7 +8,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
......@@ -39,6 +39,7 @@ Item {
property bool isNewAccount: (userName == "")
property string sLoginMethod: "pwd"
property string oldUserName
Component.onCompleted: {
if (!isNewAccount) {
......@@ -95,14 +96,28 @@ Item {
isds.doIsdsAction("addNewAccount", userNameTextField.text.toString())
}
} else {
// Update account context data.
if (accounts.updateAccount(accountModel, sLoginMethod,
accountNameTextField.text.toString(),
userNameTextField.text.toString(),
passwordTextField.text.toString(),
testAccount.checked, rememberPassword.checked,
useLS.checked, certPathLabelId.text.toString())) {
settings.saveAllSettings(accountModel)
// Change account user name.
if (userNameTextField.text.toString() !== oldUserName) {
// Create temporary account with a new user name.
if (accounts.prepareChangeUserName(accountModel, sLoginMethod,
accountNameTextField.text.toString(),
userNameTextField.text.toString(),
passwordTextField.text.toString(),
testAccount.checked, rememberPassword.checked,
useLS.checked, certPathLabelId.text.toString(), oldUserName)) {
// Login to isds with the new user name.
isds.doIsdsAction("changeUserName", userNameTextField.text.toString())
}
} else {
// Update account context data.
if (accounts.updateAccount(accountModel, sLoginMethod,
accountNameTextField.text.toString(),
userNameTextField.text.toString(),
passwordTextField.text.toString(),
testAccount.checked, rememberPassword.checked,
useLS.checked, certPathLabelId.text.toString())) {
settings.saveAllSettings(accountModel)
}
}
pageView.pop(StackView.Immediate)
}
......@@ -114,24 +129,28 @@ Item {
settings.saveAllSettings(accountModel)
pageView.pop(StackView.Immediate)
}
}
Connections {
// Connection is activated when login to new account fails.
target: isds
onUnsuccessedLoginToIsdsSig: {
if (accounts.removeAccount(accountModel, userName, false)) {
settings.saveAllSettings(accountModel)
}
}
}
Connections {
// Connection is activated when login phase was succeeded and
// try download account info.
target: isds
onRunGetAccountInfoSig: {
settings.saveAllSettings(accountModel)
isds.getAccountInfo(userName)
}
onRunChangeUserNameSig: {
// Login to isds with new user name has been succeeded.
// Get databox ID of new user name.
var dbId = isds.getAccountDbId(userName)
// Change username and rename databases.
if (accounts.changeAccountUserName(accountModel,
accountNameTextField.text.toString(),
userNameTextField.text.toString(),
useLS.checked, oldUserName, dbId)) {
settings.saveAllSettings(accountModel)
isds.getAccountInfo(userName)
}
}
}
}
}
......@@ -173,7 +192,7 @@ Item {
if (sLoginMethod === "cert") {
certificateLabel.visible = true
certPathButtonId.visible = true
certPathLabelId.visible = (certPathLabelId.text != "")
certPathLabelId.visible = (certPathLabelId.text !== "")
} else {
certificateLabel.visible = false
certPathLabelId.visible = false
......@@ -318,7 +337,7 @@ Item {
useLS.checked = storeToDisk
certPathLabelId.text = certPath
loginMethodComboBox.selectCurrentKey(loginMethod)
userNameTextField.enabled = false
oldUserName = userName
testAccount.enabled = false
headerBar.title = qsTr("Account settings")
}
......
......@@ -8,7 +8,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
......@@ -32,6 +32,7 @@
#include "src/net/isds_session.h"
#include "src/settings.h"
#include "src/sqlite/account_db.h"
#include "src/sqlite/file_db_container.h"
#include "src/sqlite/message_db_container.h"
Accounts::Accounts(QObject *parent)
......@@ -145,6 +146,18 @@ void Accounts::getAccountData(const QString &userName)
acntData.rememberPwd(), acntData.storeToDisk(), acntData.certPath());
}
/*!
* @brief Check if username has correct length.
*
* @param[in] username Account login.
* @return True if length is correct.
*/
static
bool usernameCorrectLength(const QString &userName)
{
return userName.length() == 6;
}
bool Accounts::createAccount(const QVariant &acntModelVariant,
const QString &loginMetod, const QString &acntName, const QString &userName,
const QString &pwd, bool isTestAccount, bool rememberPwd, bool storeToDisk,
......@@ -152,6 +165,10 @@ bool Accounts::createAccount(const QVariant &acntModelVariant,
{
debugFuncCall();
AcntData acntData;
QString errTxt;
QString newUserName = userName.trimmed();
AccountListModel *accountModel =
AccountListModel::fromVariant(acntModelVariant);
if (accountModel == Q_NULLPTR) {
......@@ -160,17 +177,18 @@ bool Accounts::createAccount(const QVariant &acntModelVariant,
return false;
}
if (userName.isEmpty() || acntName.isEmpty() || pwd.isEmpty()) {
Dialogues::errorMessage(Dialogues::CRITICAL,
tr("Problem while creating account"),
tr("User name, password or account name has not been specified!"),
tr("These fields must be filled in."));
return false;
if (newUserName.isEmpty() || acntName.isEmpty() || pwd.isEmpty()) {
errTxt = tr("User name, password or account name has not been specified. These fields must be filled in");
goto fail;
}
if (!usernameCorrectLength(newUserName)) {
errTxt = tr("User name '%1' has wrong length.").arg(newUserName);
goto fail;
}
AcntData acntData;
acntData.setAccountName(acntName.trimmed());
acntData.setUserName(userName.trimmed());
acntData.setUserName(newUserName);
acntData.setPassword(pwd.trimmed());
acntData.setLoginMethod(loginMetod);
acntData.setTestAccount(isTestAccount);
......@@ -178,15 +196,20 @@ bool Accounts::createAccount(const QVariant &acntModelVariant,
acntData.setStoreToDisk(storeToDisk);
acntData.setCertPath(certPath);
if (accountModel->addAccount(acntData) == -2) {
Dialogues::errorMessage(Dialogues::CRITICAL,
tr("Creating account: %1").arg(userName),
tr("Account '%1' could not be created.").arg(acntName),
tr("Account with user name '%1' already exists.").arg(userName));
return false;
if (accountModel->addAccount(acntData) == AccountListModel::AA_EXISTS) {
errTxt = tr("Account with user name '%1' already exists.").arg(newUserName);
goto fail;
}
return true;
fail:
Dialogues::errorMessage(Dialogues::CRITICAL,
tr("Creating account: %1").arg(newUserName),
tr("Account '%1' could not be created.").arg(acntName),
errTxt);
return false;
}
bool Accounts::updateAccount(const QVariant &acntModelVariant,
......@@ -406,3 +429,223 @@ void Accounts::loadModelCounters(AccountListModel *accountModel)
msgDb->getMessageCountFromDb(MessageDb::TYPE_SENT));
}
}
bool Accounts::prepareChangeUserName(const QVariant &acntModelVariant,
const QString &loginMetod, const QString &acntName, const QString &newUserName,
const QString &pwd, bool isTestAccount, bool rememberPwd, bool storeToDisk,
const QString &certPath, const QString &oldUserName)
{
debugFuncCall();
/* Show confirm dialogue about use name changing */
int msgResponse = Dialogues::message(Dialogues::QUESTION,
tr("Change user name: %1").arg(oldUserName),
tr("Do you want to change user name from '%1' to '%2' of account '%3'?").arg(oldUserName).arg(newUserName).arg(acntName),
tr("Note: It will also change all related local database names and account information."),
Dialogues::NO | Dialogues::YES, Dialogues::NO);
if (msgResponse == Dialogues::NO) {
return false;
}
return createAccount(acntModelVariant, loginMetod, acntName,
newUserName, pwd, isTestAccount, rememberPwd, storeToDisk,
certPath);
}
/*!
* @brief Check whether the box identifier matches the username of a known account.
*
* @param[in] dbId Data box ID.
* @param[in] username User name of already existing account.
* @return True if username corresponds to data box id, false on any error.
*/
static
bool boxMatchesUser(const QString &dbId, const QString &username)
{
if (Q_UNLIKELY(dbId.isEmpty() || username.isEmpty())) {
Q_ASSERT(0);
return false;
}
return dbId == GlobInstcs::accountDbPtr->dbId(username);
}
/*!
* @brief Change file database name to new username.
*
* @param[in] oldUserName Original user name of account.
* @param[in] newUserName New user name identifying account.
* @param[in] storeToDisk True if database store to local storage.
* @param[out] errTxt Error description.
* @return True on success.
*/
static
bool changeFileDbName(const QString &oldUserName,
const QString &newUserName, bool storeToDisk, QString &errTxt)
{
debugFuncCall();
FileDb *fDb = GlobInstcs::fileDbsPtr->accessFileDb(
GlobInstcs::setPtr->dbsLocation, oldUserName, storeToDisk);
if (Q_UNLIKELY(fDb == Q_NULLPTR)) {
errTxt = Accounts::tr("Cannot access file database for the user name '%1'.")
.arg(oldUserName);
return false;
}
/* Rename file database */
QString currentDbFileName = fDb->fileName();
currentDbFileName.replace(oldUserName, newUserName);
if (!fDb->moveDb(currentDbFileName)) {
errTxt = Accounts::tr("Cannot change file database on the user name '%1'.")
.arg(newUserName);
return false;
}
return true;
}
/*!
* @brief Change message database name to new user name.
*
* @param[in] oldUserName Original user name of account.
* @param[in] newUserName New user name identifying account.
* @param[in] storeToDisk True if database store to local storage.
* @param[out] errTxt Error description.
* @return True if success.
*/
static
bool changeMessageDbName(const QString &oldUserName,
const QString &newUserName, bool storeToDisk, QString &errTxt)
{
debugFuncCall();
MessageDb *msgDb = GlobInstcs::messageDbsPtr->accessMessageDb(
GlobInstcs::setPtr->dbsLocation, oldUserName, storeToDisk);
if (Q_UNLIKELY(msgDb == Q_NULLPTR)) {
errTxt = Accounts::tr("Cannot access message database for user name '%1'.")
.arg(oldUserName);
return false;
}
/* Rename message database */
QString currentDbFileName = msgDb->fileName();
currentDbFileName.replace(oldUserName, newUserName);
if (!msgDb->moveDb(currentDbFileName)) {
errTxt = Accounts::tr("Cannot change message database on the user name '%1'.")
.arg(newUserName);
return false;
}
return true;
}
bool Accounts::changeAccountUserName(const QVariant &acntModelVariant,
const QString &acntName, const QString &newUserName, bool storeToDisk,
const QString &oldUserName, const QString &newDbId)
{
debugFuncCall();
QString errTxt;
AccountListModel *accountModel = Q_NULLPTR;
if (Q_UNLIKELY((GlobInstcs::acntMapPtr == Q_NULLPTR) ||
(GlobInstcs::fileDbsPtr == Q_NULLPTR) ||
(GlobInstcs::messageDbsPtr == Q_NULLPTR))) {
Q_ASSERT(0);
goto exit;
}
/* Get account model */
accountModel = AccountListModel::fromVariant(acntModelVariant);
if (Q_UNLIKELY(accountModel == Q_NULLPTR)) {
Q_ASSERT(0);
logErrorNL("%s", "Cannot access account model.");
goto exit;
}
/* Check if new user name corresponds with data box id. */
if (!boxMatchesUser(newDbId, oldUserName)) {
errTxt = tr("New data box identifier '%1' does not correspond with the old username '%2'.")
.arg(newDbId).arg(oldUserName);
goto fail;
}
/* First: Change user name in the account database (user_info, account_info) */
if (!GlobInstcs::accountDbPtr->changeUserName(oldUserName, newUserName)) {
errTxt = tr("Cannot change username '%1' in the account database.")
.arg(newUserName);
goto fail;
}
/* Second: Change file database name or rollback in an error */
if (!changeFileDbName(oldUserName, newUserName, storeToDisk, errTxt)) {
goto rollbackAccountChanges;
}
/* Third: Change message database name or rollback in an error */
if (!changeMessageDbName(oldUserName, newUserName, storeToDisk, errTxt)) {
goto rollbackFilesChanges;
}
/* Last: Delete original/old account from model and settings */
deleteAccountFromModel(accountModel, oldUserName);
logInfoNL("Username has been changed to '%s'.",
newUserName.toUtf8().constData());
Dialogues::errorMessage(Dialogues::INFORMATION,
tr("Change user name: %1").arg(oldUserName),
tr("A new user name '%1' for the account '%2' has been set.")
.arg(newUserName).arg(acntName),
tr("Account will use the new settings."));
return true;
rollbackFilesChanges:
/* Change back file database name */
if (changeFileDbName(newUserName, oldUserName, storeToDisk, errTxt)) {
logErrorNL("Cannot restore file database name '%s'.",
oldUserName.toUtf8().constData());
}
rollbackAccountChanges:
/* Change back original user name in the account database. */
if (!GlobInstcs::accountDbPtr->changeUserName(newUserName, oldUserName)) {
logErrorNL("%s",
"Cannot restore user name in the account database.");
}
fail:
/* Show error dialogue with message what happened */
Dialogues::errorMessage(Dialogues::CRITICAL,
tr("User name problem: %1").arg(oldUserName),
tr("The new user name '%1' for account '%2' has not been set!")
.arg(newUserName).arg(acntName),
errTxt + QStringLiteral(" ") +
tr("Account will use the original settings."));
exit:
/* Remove new account */
deleteAccountFromModel(accountModel, newUserName);
return false;
}
void Accounts::deleteAccountFromModel(AccountListModel *accountModel,
const QString &userName)
{
if (Q_UNLIKELY((accountModel == Q_NULLPTR) || userName.isEmpty())) {
Q_ASSERT(0);
return;
}
/* Remove old account from model */
accountModel->deleteAccount(userName);
/* Delete ISDS session context of old account */
emit removeIsdsCtx(userName);
/* Load message counters of all accounts */
loadModelCounters(accountModel);
}
......@@ -8,7 +8,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
......@@ -149,6 +149,44 @@ public:
static
void loadModelCounters(AccountListModel *accountModel);
/*!
* @brief Prepare change account user name.
*
* @param[in,out] acntModelVariant QVariant holding account model.
* @param[in] loginMetod User name identifying account.
* @param[in] acntName Account name.
* @param[in] newUserName New user name identifying account.
* @param[in] pwd Password.
* @param[in] isTestAccount True if account is ISDS test environment.
* @param[in] rememberPwd True if remember password.
* @param[in] storeToDisk True if database store to local storage.
* @param[in] certPath Certificate path (can be null).
* @param[in] oldUserName Original old user name of account.
* @return True if success.
*/
Q_INVOKABLE
bool prepareChangeUserName(const QVariant &acntModelVariant,
const QString &loginMetod, const QString &acntName,
const QString &newUserName, const QString &pwd, bool isTestAccount,
bool rememberPwd, bool storeToDisk, const QString &certPath,
const QString &oldUserName);
/*!
* @brief Change account user name and store account to settings.
*
* @param[in,out] acntModelVariant QVariant holding account model.
* @param[in] acntName Account name.
* @param[in] newUserName New user name identifying account.
* @param[in] storeToDisk True if database store to local storage.
* @param[in] oldUserName Original user name of account.
* @param[in] newDbId Databox id of new user name.
* @return True if success.
*/
Q_INVOKABLE
bool changeAccountUserName(const QVariant &acntModelVariant,
const QString &acntName, const QString &newUserName,
bool storeToDisk, const QString &oldUserName, const QString &newDbId);
signals:
/*!
* @brief Send account settings to QML settings page.
......@@ -157,7 +195,7 @@ signals:
* @param[in] userName User name identifying account.
* @param[in] loginMetod User name identifying account.
* @param[in] pwd Password.
* @param[in] isTestAccount True if account is isds test enveiroment.
* @param[in] isTestAccount True if account is ISDS test environment.
* @param[in] rememberPwd True if remember password.
* @param[in] storeToDisk True if database store to local storage.
* @param[in] certPath Certificate path (can be null).
......@@ -167,9 +205,19 @@ signals:
bool rememberPwd, bool storeToDisk, QString certPath);
/*!
* @brief Remove isds context for account in the isds session.
* @brief Remove ISDS context for account in the ISDS session.
*
* @param[in] acntName Account name.
* @param[in] userName User name.
*/
void removeIsdsCtx(QString userName);
private:
/*!
* @brief Delete account from model.
*
* @param[in,out] accountModel Model whose counters should be updated.
* @param[in] userName User name identifying account.
*/
void deleteAccountFromModel(AccountListModel *accountModel,
const QString &userName);
};
......@@ -8,7 +8,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
......
......@@ -8,7 +8,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
......@@ -727,24 +727,25 @@ void AccountListModel::saveAccountsToSettings(const QString &pinVal,
}
}
int AccountListModel::addAccount(const AcntData &acntData, QModelIndex *idx)
enum AccountListModel::AddAcntResult AccountListModel::addAccount(
const AcntData &acntData, QModelIndex *idx)
{
if (Q_UNLIKELY(m_accountsPtr == Q_NULLPTR)) {
Q_ASSERT(0);
return -1;
return AA_ERR;
}
const QString userName(acntData.userName());
if (userName.isEmpty()) {
Q_ASSERT(0);
return -1;
return AA_ERR;
}
if (m_accountsPtr->contains(userName)) {
logWarningNL("Account with username '%s' already exists.",
userName.toUtf8().constData());
return -2;
return AA_EXISTS;
}
Q_ASSERT(!m_userNames.contains(userName));
......@@ -761,7 +762,7 @@ int AccountListModel::addAccount(const AcntData &acntData, QModelIndex *idx)
*idx = index(m_userNames.size() - 1, 0, QModelIndex());
}
return 0;
return AA_SUCCESS;
}
void AccountListModel::deleteAccount(const QString &userName)
......
......@@ -8,7 +8,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
......@@ -152,6 +152,15 @@ public:
};
Q_ENUM(Roles)
/*!
* @brief Return add account result.
*/
enum AddAcntResult {
AA_SUCCESS = 0, /*!< Operation was successful. */
AA_EXISTS, /*!< Account already exists in the model. */
AA_ERR /*!< Internal error. */
};
/* Don't forget to declare various properties to the QML system. */
static
void declareQML(void);
......@@ -239,12 +248,11 @@ public:
* @brief Add account.
*
* @patam[in] acntSettings Settings data to be added into the model.
* @param[out] idx Index of newly added account if specified.
* @return -2 if account already exists,
* -1 if account could not be added,
* 0 if account was added.
* @param[out] idx Index of newly added account if specified.
* @return Error state.
*/
int addAccount(const AcntData &acntData, QModelIndex *idx = Q_NULLPTR);
enum AddAcntResult addAccount(const AcntData &acntData,
QModelIndex *idx = Q_NULLPTR);
/*!
* @brief Delete account.
......
......@@ -261,6 +261,8 @@ void IsdsWrapper::doIsdsAction(const QString &isdsAction,
emit runDownloadMessageSig(userName);
} else if (isdsAction == "addNewAccount") {
emit runGetAccountInfoSig(userName);
} else if (isdsAction == "changeUserName") {
emit runChangeUserNameSig(userName);
} else if (isdsAction == "getAccountInfo") {
emit runGetAccountInfoSig(userName);
} else if (isdsAction == "syncOneAccount") {
......@@ -321,12 +323,46 @@ void IsdsWrapper::getAccountInfo(const QString &userName)
arg(userName), true, true);
TaskDownloadAccountInfo *task;
/* Last param: true = store account info into database */
task = new (std::nothrow) TaskDownloadAccountInfo(
m_isdsSession.isdsCtxMap[userName], &m_netLayer);
m_isdsSession.isdsCtxMap[userName], &m_netLayer, true);
task->setAutoDelete(true);
GlobInstcs::workPoolPtr->assignHi(task);
}
QString IsdsWrapper::getAccountDbId(const QString &userName)
{
debugFuncCall();
if (Q_UNLIKELY(GlobInstcs::workPoolPtr == Q_NULLPTR)) {
Q_ASSERT(0);
return QString();
}
QString errTxt(tr("Wrong username"));
if (userName.isEmpty()) {
Dialogues::errorMessage(Dialogues::CRITICAL,
tr("Error"), errTxt, tr("Internal error"));
return QString();
}
/* User must be logged to isds */
if (!isLoggedToIsds(userName)) {
return QString();
}
TaskDownloadAccountInfo *task;
/* Last param: false = account info won't store into database */
task = new (std::nothrow) TaskDownloadAccountInfo(
m_isdsSession.isdsCtxMap[userName], &m_netLayer, false);
task->setAutoDelete(false);
GlobInstcs::workPoolPtr->runSingle(task);
QString dbId(task->m_dbID);
delete task; task = Q_NULLPTR;
return dbId;
}
int IsdsWrapper::findDataboxFulltext(const QString &userName,
const QVariant &dbModelVariant, const QString &phrase,
const QString &searchType, const QString &searchScope, int page)
......@@ -516,7 +552,7 @@ bool IsdsWrapper::isCorrectPassword(const QString &password)
void IsdsWrapper::inputDialogCancelPostAction(const QString &isdsAction,
const QString &userName)
{
if (isdsAction == "addNewAccount") {
if (isdsAction == "addNewAccount" || isdsAction == "changeUserName") {
emit unsuccessedLoginToIsdsSig(userName);
}
}
......@@ -1124,6 +1160,14 @@ void IsdsWrapper::doLoginAction(const QString &isdsAction,
tr("ISDS returns:") + " " + m_isdsSession.isdsCtxMap[userName].last_isds_msg + "\n\n" +
tr("Check your login data and try again."));
emit unsuccessedLoginToIsdsSig(userName);
} else if (isdsAction == "changeUserName") {
Dialogues::errorMessage(Dialogues::CRITICAL,
tr("Username change: %1").arg(userName),
tr("Username could not be changed because an error occurred while trying to log in with new user name '%1'.")
.arg(userName),
tr("ISDS returns:") + " " + m_isdsSession.isdsCtxMap[userName].last_isds_msg + "\n\n" +
tr("Check your login data and try again."));
emit unsuccessedLoginToIsdsSig(userName);
} else {
/* Show error login dialogue */
Dialogues::errorMessage(Dialogues::CRITICAL,
......
......@@ -8,7 +8,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
......@@ -130,6 +130,15 @@ public:
Q_INVOKABLE
void getAccountInfo(const QString &userName);
/*!
* @brief Get databox ID from ISDS.
*
* @param[in] userName Account username string.
* @return Return databox ID.
*/
Q_INVOKABLE
QString getAccountDbId(const QString &userName);
/*!
* @brief Downloads delivery info.
*
......@@ -347,6 +356,13 @@ signals:
*/
void downloadAccountInfoFinishedSig(QString userName);
/*!
* @brief Signal is emitted when account username can be changed.
*
* @param[in] userName Account user name string.
*/
void runChangeUserNameSig(QString userName);
/*!
* @brief Run download mesasge isds action from QML.
*
......
......@@ -8,7 +8,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of