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
89e7438b
Commit
89e7438b
authored
May 06, 2020
by
Ming Rui Zhang
Browse files
newwizardwidget: add ringtone path directly when creating accounts
Change-Id: Ic5dabc2cc1a401834ee2da69e497f3598c7d0687
parent
2504f3a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/newwizardwidget.cpp
View file @
89e7438b
...
...
@@ -34,6 +34,9 @@
#include
"utils.h"
#include
"ringthemeutils.h"
#undef REGISTERED
#include
"../daemon/src/dring/account_const.h"
NewWizardWidget
::
NewWizardWidget
(
QWidget
*
parent
)
:
NavWidget
(
parent
),
ui
(
new
Ui
::
NewWizardWidget
),
...
...
@@ -548,21 +551,16 @@ NewWizardWidget::createAccount()
if
(
isConnectingToManager
)
{
Utils
::
oneShotConnect
(
&
LRCInstance
::
accountModel
(),
&
lrc
::
api
::
NewAccountModel
::
accountAdded
,
[
this
](
const
QString
&
accountId
)
{
Q_UNUSED
(
accountId
)
if
(
!
LRCInstance
::
accountModel
().
getAccountList
().
size
())
return
;
//set default ringtone
auto
confProps
=
LRCInstance
::
accountModel
().
getAccountConfig
(
accountId
);
confProps
.
Ringtone
.
ringtonePath
=
Utils
::
GetRingtonePath
();
LRCInstance
::
accountModel
().
setAccountConfig
(
accountId
,
confProps
);
emit
NavigationRequested
(
ScreenEnum
::
CallScreen
);
emit
LRCInstance
::
instance
().
accountListChanged
();
});
}
else
{
Utils
::
oneShotConnect
(
&
LRCInstance
::
accountModel
(),
&
lrc
::
api
::
NewAccountModel
::
accountAdded
,
[
this
,
isRing
,
isCreating
](
const
QString
&
accountId
)
{
//set default ringtone
auto
confProps
=
LRCInstance
::
accountModel
().
getAccountConfig
(
accountId
);
confProps
.
Ringtone
.
ringtonePath
=
Utils
::
GetRingtonePath
();
if
(
!
isRing
)
{
// set SIP details
confProps
.
hostname
=
inputPara_
[
"hostname"
];
...
...
@@ -626,11 +624,15 @@ NewWizardWidget::createAccount()
});
QtConcurrent
::
run
(
[
this
,
isRing
,
isConnectingToManager
]
{
QMap
<
QString
,
QString
>
additionalAccountConfig
;
additionalAccountConfig
.
insert
(
DRing
::
Account
::
ConfProperties
::
Ringtone
::
PATH
,
Utils
::
GetRingtonePath
());
if
(
isConnectingToManager
)
{
LRCInstance
::
accountModel
().
connectToAccountManager
(
inputPara_
[
"username"
],
inputPara_
[
"password"
],
inputPara_
[
"manager"
]
inputPara_
[
"manager"
],
additionalAccountConfig
);
}
else
if
(
isRing
)
{
LRCInstance
::
accountModel
().
createNewAccount
(
...
...
@@ -638,7 +640,9 @@ NewWizardWidget::createAccount()
inputPara_
[
"alias"
],
inputPara_
[
"archivePath"
],
inputPara_
[
"password"
],
inputPara_
[
"archivePin"
]
inputPara_
[
"archivePin"
],
""
,
additionalAccountConfig
);
}
else
{
LRCInstance
::
accountModel
().
createNewAccount
(
...
...
@@ -647,7 +651,8 @@ NewWizardWidget::createAccount()
inputPara_
[
"archivePath"
],
""
,
""
,
inputPara_
[
"username"
]
inputPara_
[
"username"
],
additionalAccountConfig
);
QThread
::
sleep
(
2
);
emit
NavigationRequested
(
ScreenEnum
::
CallScreen
);
...
...
Write
Preview
Supports
Markdown
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