Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
92bd5ce8
Commit
92bd5ce8
authored
12 years ago
by
Emmanuel Lepage
Browse files
Options
Downloads
Patches
Plain Diff
[ #12352 ] Fix adding account
parent
a6972aa5
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
kde/src/conf/dlgaccounts.cpp
+1
-0
1 addition, 0 deletions
kde/src/conf/dlgaccounts.cpp
kde/src/lib/Account.cpp
+14
-1
14 additions, 1 deletion
kde/src/lib/Account.cpp
kde/src/lib/Account.h
+5
-0
5 additions, 0 deletions
kde/src/lib/Account.h
with
20 additions
and
1 deletion
kde/src/conf/dlgaccounts.cpp
+
1
−
0
View file @
92bd5ce8
...
@@ -575,6 +575,7 @@ void DlgAccounts::on_button_accountAdd_clicked()
...
@@ -575,6 +575,7 @@ void DlgAccounts::on_button_accountAdd_clicked()
QString
itemName
=
QInputDialog
::
getText
(
this
,
"New account"
,
"Enter new account's alias"
);
QString
itemName
=
QInputDialog
::
getText
(
this
,
"New account"
,
"Enter new account's alias"
);
itemName
=
itemName
.
simplified
();
itemName
=
itemName
.
simplified
();
if
(
!
itemName
.
isEmpty
())
{
if
(
!
itemName
.
isEmpty
())
{
AccountList
::
getInstance
()
->
addAccount
(
itemName
);
int
r
=
listView_accountList
->
model
()
->
rowCount
()
-
1
;
int
r
=
listView_accountList
->
model
()
->
rowCount
()
-
1
;
listView_accountList
->
setCurrentIndex
(
listView_accountList
->
model
()
->
index
(
r
,
0
));
listView_accountList
->
setCurrentIndex
(
listView_accountList
->
model
()
->
index
(
r
,
0
));
frame2_editAccounts
->
setEnabled
(
true
);
frame2_editAccounts
->
setEnabled
(
true
);
...
...
This diff is collapsed.
Click to expand it.
kde/src/lib/Account.cpp
+
14
−
1
View file @
92bd5ce8
...
@@ -71,7 +71,7 @@ const QString& account_state_name(const QString& s)
...
@@ -71,7 +71,7 @@ const QString& account_state_name(const QString& s)
}
//account_state_name
}
//account_state_name
///Constructors
///Constructors
Account
::
Account
()
:
m_pAccountId
(
NULL
),
m_pAccountDetails
(
NULL
)
Account
::
Account
()
:
m_pAccountId
(
NULL
),
m_pAccountDetails
(
NULL
)
,
m_Temporary
(
false
)
{
{
CallManagerInterface
&
callManager
=
CallManagerInterfaceSingleton
::
getInstance
();
CallManagerInterface
&
callManager
=
CallManagerInterfaceSingleton
::
getInstance
();
connect
(
&
callManager
,
SIGNAL
(
registrationStateChanged
(
QString
,
QString
,
int
)),
this
,
SLOT
(
accountChanged
(
QString
,
QString
,
int
)));
connect
(
&
callManager
,
SIGNAL
(
registrationStateChanged
(
QString
,
QString
,
int
)),
this
,
SLOT
(
accountChanged
(
QString
,
QString
,
int
)));
...
@@ -198,6 +198,12 @@ bool Account::isRegistered() const
...
@@ -198,6 +198,12 @@ bool Account::isRegistered() const
return
(
getAccountDetail
(
ACCOUNT_REGISTRATION_STATUS
)
==
ACCOUNT_STATE_REGISTERED
);
return
(
getAccountDetail
(
ACCOUNT_REGISTRATION_STATUS
)
==
ACCOUNT_STATE_REGISTERED
);
}
}
///If this account is really part of the model or just "in progress" that can be canceled
bool
Account
::
isTemporary
()
const
{
return
m_Temporary
;
}
///Return the model index of this item
///Return the model index of this item
QModelIndex
Account
::
getIndex
()
QModelIndex
Account
::
getIndex
()
{
{
...
@@ -266,6 +272,12 @@ void Account::setEnabled(bool checked)
...
@@ -266,6 +272,12 @@ void Account::setEnabled(bool checked)
setAccountDetail
(
ACCOUNT_ENABLED
,
checked
?
REGISTRATION_ENABLED_TRUE
:
REGISTRATION_ENABLED_FALSE
);
setAccountDetail
(
ACCOUNT_ENABLED
,
checked
?
REGISTRATION_ENABLED_TRUE
:
REGISTRATION_ENABLED_FALSE
);
}
}
///Set if the account is temporary (work in progress, can be cancelled)
void
Account
::
setTemporary
(
bool
value
)
{
m_Temporary
=
value
;
}
/*****************************************************************************
/*****************************************************************************
* *
* *
* Mutator *
* Mutator *
...
@@ -286,6 +298,7 @@ void Account::updateState()
...
@@ -286,6 +298,7 @@ void Account::updateState()
///Save the current account to the daemon
///Save the current account to the daemon
void
Account
::
save
()
void
Account
::
save
()
{
{
if
(
isTemporary
())
return
;
ConfigurationManagerInterface
&
configurationManager
=
ConfigurationManagerInterfaceSingleton
::
getInstance
();
ConfigurationManagerInterface
&
configurationManager
=
ConfigurationManagerInterfaceSingleton
::
getInstance
();
if
(
isNew
())
{
if
(
isNew
())
{
MapStringString
details
=
getAccountDetails
();
MapStringString
details
=
getAccountDetails
();
...
...
This diff is collapsed.
Click to expand it.
kde/src/lib/Account.h
+
5
−
0
View file @
92bd5ce8
...
@@ -53,6 +53,7 @@ class LIB_EXPORT Account : public QObject {
...
@@ -53,6 +53,7 @@ class LIB_EXPORT Account : public QObject {
const
QString
&
getAlias
()
const
;
const
QString
&
getAlias
()
const
;
bool
isEnabled
()
const
;
bool
isEnabled
()
const
;
bool
isRegistered
()
const
;
bool
isRegistered
()
const
;
bool
isTemporary
()
const
;
QModelIndex
getIndex
()
;
QModelIndex
getIndex
()
;
QString
getStateColorName
()
const
;
QString
getStateColorName
()
const
;
Qt
::
GlobalColor
getStateColor
()
const
;
Qt
::
GlobalColor
getStateColor
()
const
;
...
@@ -134,6 +135,7 @@ class LIB_EXPORT Account : public QObject {
...
@@ -134,6 +135,7 @@ class LIB_EXPORT Account : public QObject {
void
setAccountId
(
const
QString
&
id
);
void
setAccountId
(
const
QString
&
id
);
void
setAccountDetails
(
const
MapStringString
&
m
);
void
setAccountDetails
(
const
MapStringString
&
m
);
void
setAccountDetail
(
const
QString
&
param
,
const
QString
&
val
);
void
setAccountDetail
(
const
QString
&
param
,
const
QString
&
val
);
void
setTemporary
(
const
bool
value
);
#ifdef ENABLE_VIDEO
#ifdef ENABLE_VIDEO
void
setActiveVideoCodecList
(
QList
<
VideoCodec
*>
codecs
);
void
setActiveVideoCodecList
(
QList
<
VideoCodec
*>
codecs
);
QList
<
VideoCodec
*>
getActiveVideoCodecList
();
QList
<
VideoCodec
*>
getActiveVideoCodecList
();
...
@@ -228,6 +230,9 @@ class LIB_EXPORT Account : public QObject {
...
@@ -228,6 +230,9 @@ class LIB_EXPORT Account : public QObject {
private
slots
:
private
slots
:
void
accountChanged
(
QString
accountId
,
QString
stateName
,
int
state
);
void
accountChanged
(
QString
accountId
,
QString
stateName
,
int
state
);
private
:
bool
m_Temporary
;
signals
:
signals
:
///The account state (Invalif,Trying,Registered) changed
///The account state (Invalif,Trying,Registered) changed
void
stateChanged
(
QString
state
);
void
stateChanged
(
QString
state
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment