Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-client-windows
Commits
a2aa7e42
Commit
a2aa7e42
authored
Feb 25, 2019
by
Andreas Traczyk
Browse files
wizard: use correct password when importing account
Change-Id: I9cdc4d373191d555d025a9dc1e196a7c42d81a64 Gitlab: #445
parent
e77c49a8
Changes
2
Hide whitespace changes
Inline
Side-by-side
newwizardwidget.cpp
View file @
a2aa7e42
...
...
@@ -37,7 +37,7 @@ const QString DEFAULT_RING_ACCT_ALIAS = QObject::tr("Jami account", "Default ali
NewWizardWidget
::
NewWizardWidget
(
QWidget
*
parent
)
:
NavWidget
(
parent
),
ui
(
new
Ui
::
NewWizardWidget
),
wizardMode_
(
WizardMode
::
WIZARD
),
wizardMode_
(
WizardMode
::
CREATE
),
lookupTimer_
(
this
)
{
ui
->
setupUi
(
this
);
...
...
@@ -117,7 +117,7 @@ NewWizardWidget::~NewWizardWidget()
void
NewWizardWidget
::
setToMigrate
(
AccountInfo
*
toBeMigrated
)
{
wizardMode_
=
MIGRAT
ION
;
wizardMode_
=
WizardMode
::
MIGRAT
E
;
changePage
(
ui
->
createRingAccountPage
);
ui
->
usernameEdit
->
setEnabled
(
false
);
ui
->
usernameEdit
->
setText
(
QString
::
fromStdString
(
toBeMigrated
->
profileInfo
.
alias
));
...
...
@@ -159,32 +159,6 @@ NewWizardWidget::navigated(bool to)
Utils
::
setStackWidget
(
ui
->
stackedWidget
,
ui
->
welcomePage
);
}
void
NewWizardWidget
::
processWizardInformations
()
{
if
(
wizardMode_
==
MIGRATION
)
ui
->
progressLabel
->
setText
(
tr
(
"Migrating your Jami account..."
));
else
if
(
wizardMode_
==
IMPORT
)
ui
->
progressLabel
->
setText
(
tr
(
"Importing account archive..."
));
else
ui
->
progressLabel
->
setText
(
tr
(
"Generating your Jami account..."
));
if
(
wizardMode_
!=
IMPORT
)
{
QString
accountAlias
=
(
ui
->
fullNameEdit
->
text
().
isEmpty
()
||
ui
->
fullNameEdit
->
text
().
isNull
())
?
DEFAULT_RING_ACCT_ALIAS
:
ui
->
fullNameEdit
->
text
();
QString
archivePin
=
(
ui
->
pinEdit
->
text
().
isEmpty
()
||
ui
->
pinEdit
->
text
().
isNull
())
?
QString
()
:
ui
->
pinEdit
->
text
();
changePage
(
ui
->
spinnerPage
);
createRingAccount
(
accountAlias
,
ui
->
passwordEdit
->
text
(),
archivePin
,
fileToImport_
);
ui
->
passwordEdit
->
clear
();
ui
->
confirmPasswordEdit
->
clear
();
ui
->
pinEdit
->
clear
();
}
Utils
::
CreateStartupLink
();
}
void
NewWizardWidget
::
on_existingPushButton_clicked
()
{
...
...
@@ -263,8 +237,11 @@ NewWizardWidget::on_nextButton_clicked()
const
QWidget
*
curWidget
=
ui
->
stackedWidget
->
currentWidget
();
ui
->
setAvatarWidget
->
stopBooth
();
disconnect
(
registeredNameFoundConnection_
);
if
(
curWidget
==
ui
->
createRingAccountPage
||
curWidget
==
ui
->
linkRingAccountPage
)
{
if
(
curWidget
==
ui
->
createRingAccountPage
)
{
wizardMode_
=
WizardMode
::
CREATE
;
processWizardInformations
();
}
if
(
curWidget
==
ui
->
linkRingAccountPage
)
{
wizardMode_
=
WizardMode
::
IMPORT
;
processWizardInformations
();
}
}
...
...
@@ -401,6 +378,38 @@ NewWizardWidget::validateWizardProgression()
ui
->
nextButton
->
setEnabled
(
usernameOk
&&
passwordOk
);
}
void
NewWizardWidget
::
processWizardInformations
()
{
QString
alias
,
password
,
archivePin
;
switch
(
wizardMode_
)
{
case
WizardMode
::
CREATE
:
ui
->
progressLabel
->
setText
(
tr
(
"Generating your Jami account..."
));
alias
=
ui
->
fullNameEdit
->
text
();
password
=
ui
->
passwordEdit
->
text
();
ui
->
fullNameEdit
->
clear
();
ui
->
passwordEdit
->
clear
();
ui
->
confirmPasswordEdit
->
clear
();
break
;
case
WizardMode
::
IMPORT
:
ui
->
progressLabel
->
setText
(
tr
(
"Importing account archive..."
));
password
=
ui
->
importPasswordEdit
->
text
();
archivePin
=
ui
->
pinEdit
->
text
();
ui
->
pinEdit
->
clear
();
ui
->
importPasswordEdit
->
clear
();
break
;
case
WizardMode
::
MIGRATE
:
ui
->
progressLabel
->
setText
(
tr
(
"Migrating your Jami account..."
));
break
;
}
changePage
(
ui
->
spinnerPage
);
createRingAccount
(
alias
,
password
,
archivePin
,
fileToImport_
);
Utils
::
CreateStartupLink
();
}
void
NewWizardWidget
::
createRingAccount
(
const
QString
&
displayName
,
const
QString
&
password
,
...
...
newwizardwidget.h
View file @
a2aa7e42
...
...
@@ -38,7 +38,7 @@ public:
using
AccountInfo
=
Info
;
enum
WizardMode
{
WIZARD
,
IMPORT
,
MIGRAT
ION
};
enum
WizardMode
{
CREATE
,
IMPORT
,
MIGRAT
E
};
private:
enum
NameRegistrationUIState
{
BLANK
,
INVALID
,
TAKEN
,
FREE
,
SEARCHING
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment