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-daemon
Commits
62b69203
Commit
62b69203
authored
Jul 25, 2012
by
Emmanuel Lepage Vallee
Browse files
[ #13801 ] Code cleanup (1/2)
parent
7ed9c78a
Changes
54
Hide whitespace changes
Inline
Side-by-side
kde/src/conf/ConfigurationDialog.cpp
View file @
62b69203
...
...
@@ -35,6 +35,7 @@
#include
"lib/sflphone_const.h"
///Constructor
ConfigurationDialog
::
ConfigurationDialog
(
SFLPhoneView
*
parent
)
:
KConfigDialog
(
parent
,
SETTINGS_NAME
,
ConfigurationSkeleton
::
self
())
{
...
...
@@ -52,39 +53,40 @@ ConfigurationDialog::ConfigurationDialog(SFLPhoneView *parent)
dlgVideo
=
new
DlgVideo
(
this
);
#endif
addPage
(
dlgGeneral
,
i18nc
(
"General settings"
,
"General"
)
,
"sflphone-client-kde"
);
addPage
(
dlgAccounts
,
i18n
(
"Accounts"
)
,
"user-identity"
);
addPage
(
dlgAudio
,
i18n
(
"Audio"
)
,
"audio-headset"
);
addPage
(
dlgAddressBook
,
i18n
(
"Address Book"
)
,
"x-office-address-book"
);
addPage
(
dlgHooks
,
i18n
(
"Hooks"
)
,
"insert-link"
);
addPage
(
dlgAccessibility
,
i18n
(
"Accessibility"
)
,
"preferences-desktop-accessibility"
);
addPage
(
dlgGeneral
,
i18nc
(
"General settings"
,
"General"
)
,
"sflphone-client-kde"
);
addPage
(
dlgAccounts
,
i18n
(
"Accounts"
)
,
"user-identity"
);
addPage
(
dlgAudio
,
i18n
(
"Audio"
)
,
"audio-headset"
);
addPage
(
dlgAddressBook
,
i18n
(
"Address Book"
)
,
"x-office-address-book"
);
addPage
(
dlgHooks
,
i18n
(
"Hooks"
)
,
"insert-link"
);
addPage
(
dlgAccessibility
,
i18n
(
"Accessibility"
)
,
"preferences-desktop-accessibility"
);
#ifdef ENABLE_VIDEO
addPage
(
dlgVideo
,
i18nc
(
"Video conversation"
,
"Video"
)
,
"camera-web"
);
addPage
(
dlgVideo
,
i18nc
(
"Video conversation"
,
"Video"
)
,
"camera-web"
);
#endif
addPage
(
dlgDisplay
,
i18nc
(
"User interterface settings"
,
"Display"
)
,
"applications-graphics"
);
addPage
(
dlgDisplay
,
i18nc
(
"User interterface settings"
,
"Display"
),
"applications-graphics"
);
connect
(
this
,
SIGNAL
(
applyClicked
())
,
this
,
SLOT
(
applyCustomSettings
()));
connect
(
this
,
SIGNAL
(
okClicked
())
,
this
,
SLOT
(
applyCustomSettings
()));
connect
(
this
,
SIGNAL
(
cancelClicked
()),
this
,
SLOT
(
cancelSettings
()
));
connect
(
this
,
SIGNAL
(
applyClicked
())
,
this
,
SLOT
(
applyCustomSettings
()));
connect
(
this
,
SIGNAL
(
okClicked
())
,
this
,
SLOT
(
applyCustomSettings
()));
connect
(
this
,
SIGNAL
(
cancelClicked
()),
this
,
SLOT
(
cancelSettings
()
));
connect
(
dlgGeneral
,
SIGNAL
(
clearCallHistoryAsked
()),
this
,
SIGNAL
(
clearCallHistoryAsked
()));
}
//ConfigurationDialog
///Destructor
ConfigurationDialog
::~
ConfigurationDialog
()
{
delete
dlgGeneral
;
delete
dlgDisplay
;
delete
dlgAccounts
;
delete
dlgAudio
;
delete
dlgAddressBook
;
delete
dlgHooks
;
delete
dlgGeneral
;
delete
dlgDisplay
;
delete
dlgAccounts
;
delete
dlgAudio
;
delete
dlgAddressBook
;
delete
dlgHooks
;
delete
dlgAccessibility
;
#ifdef ENABLE_VIDEO
delete
dlgVideo
;
delete
dlgVideo
;
#endif
}
///Update all widgets when something is reloaded
void
ConfigurationDialog
::
updateWidgets
()
{
dlgAudio
->
updateWidgets
();
...
...
@@ -94,6 +96,7 @@ void ConfigurationDialog::updateWidgets()
dlgAccessibility
->
updateWidgets
();
}
///Save all settings when apply is clicked
void
ConfigurationDialog
::
updateSettings
()
{
dlgAudio
->
updateSettings
();
...
...
@@ -103,23 +106,27 @@ void ConfigurationDialog::updateSettings()
dlgAccessibility
->
updateSettings
();
}
///Cancel current modification
void
ConfigurationDialog
::
cancelSettings
()
{
dlgAccounts
->
cancel
();
}
///If the account changed
bool
ConfigurationDialog
::
hasChanged
()
{
bool
res
=
dlgAudio
->
hasChanged
()
||
dlgAccounts
->
hasChanged
()
||
dlgGeneral
->
hasChanged
();
return
res
;
}
///Update the buttons
void
ConfigurationDialog
::
updateButtons
()
{
bool
changed
=
hasChanged
();
enableButtonApply
(
changed
);
}
///Apply settings
void
ConfigurationDialog
::
applyCustomSettings
()
{
if
(
hasChanged
())
{
...
...
@@ -131,6 +138,7 @@ void ConfigurationDialog::applyCustomSettings()
emit
changesApplied
();
}
///Reload the pages
void
ConfigurationDialog
::
reload
()
{
kDebug
()
<<
"Reloading config"
;
...
...
kde/src/conf/ConfigurationDialog.h
View file @
62b69203
...
...
@@ -16,19 +16,18 @@
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef CONFIGURATIONDIALOG_H
#define CONFIGURATIONDIALOG_H
//Base
#include
<kconfigdialog.h>
#include
"klib/kcfg_settings.h"
#include
"SFLPhoneView.h"
#define SETTINGS_NAME "settings"
//SFLPhone
class
DlgGeneral
;
class
DlgDisplay
;
class
DlgAccounts
;
...
...
@@ -38,7 +37,6 @@ class DlgRecord;
class
DlgHooks
;
class
DlgAccessibility
;
class
DlgVideo
;
class
SFLPhoneView
;
/**
...
...
@@ -80,6 +78,7 @@ public slots:
*/
void
updateSettings
();
/**
* @author Jérémy Quentin <jeremy.quentin@gmail.com>
* Is implemented in KConfigDialog only from KDE4.3
* It it implemented here for KDE4.2 users.
* I didn't test with KDE4.3 so I leave it even for 4.3 users.
...
...
kde/src/conf/dlgaccessibility.h
View file @
62b69203
...
...
@@ -15,7 +15,6 @@
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef DLGACCESSIBILITY_H
#define DLGACCESSIBILITY_H
...
...
kde/src/conf/dlgaccounts.cpp
View file @
62b69203
...
...
@@ -16,10 +16,8 @@
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include
"dlgaccounts.h"
//Qt
#include
<QtCore/QString>
#include
<QtGui/QInputDialog>
...
...
@@ -121,13 +119,13 @@ DlgAccounts::DlgAccounts(KConfigDialog* parent)
/**/
connect
(
AccountList
::
getInstance
(),
SIGNAL
(
accountEnabledChanged
(
Account
*
)),
this
,
SLOT
(
otherAccountChanged
())
);
/* */
connect
(
listView_accountList
->
selectionModel
(),
SIGNAL
(
currentChanged
(
QModelIndex
,
QModelIndex
)),
this
,
SLOT
(
accountListChanged
(
QModelIndex
,
QModelIndex
)));
connect
(
listView_accountList
->
selectionModel
(),
SIGNAL
(
currentChanged
(
QModelIndex
,
QModelIndex
)),
this
,
SLOT
(
updateAccountListCommands
()));
connect
(
listView_accountList
->
selectionModel
(),
SIGNAL
(
currentChanged
(
QModelIndex
,
QModelIndex
)),
this
,
SLOT
(
accountListChanged
(
QModelIndex
,
QModelIndex
))
);
connect
(
listView_accountList
->
selectionModel
(),
SIGNAL
(
currentChanged
(
QModelIndex
,
QModelIndex
)),
this
,
SLOT
(
updateAccountListCommands
())
);
//Disable control
connect
(
radioButton_pa_same_as_local
,
SIGNAL
(
clicked
(
bool
))
,
this
,
SLOT
(
enablePublished
()));
connect
(
radioButton_pa_custom
,
SIGNAL
(
clicked
(
bool
))
,
this
,
SLOT
(
enablePublished
()));
connect
(
radioButton_pa_same_as_local
,
SIGNAL
(
clicked
(
bool
))
,
this
,
SLOT
(
enablePublished
()));
connect
(
radioButton_pa_custom
,
SIGNAL
(
clicked
(
bool
))
,
this
,
SLOT
(
enablePublished
()));
if
(
AccountList
::
getInstance
()
->
index
(
0
,
0
).
isValid
())
{
...
...
@@ -296,7 +294,7 @@ void DlgAccounts::loadAccount(QModelIndex item)
break
;
}
// WIDGET VALUE
VALUE /
// WIDGET VALUE VALUE
/
/**/
edit2_protocol
->
setCurrentIndex
(
(
protocolIndex
<
0
)
?
0
:
protocolIndex
);
/**/
edit3_server
->
setText
(
account
->
getAccountHostname
());
/**/
edit4_user
->
setText
(
account
->
getAccountUsername
());
...
...
@@ -328,44 +326,44 @@ void DlgAccounts::loadAccount(QModelIndex item)
/**/
check_tls_requier_cert
->
setChecked
(
account
->
isTlsRequireClientCertificate
());
/**/
group_security_tls
->
setChecked
(
account
->
isTlsEnable
());
/**/
combo_security_STRP
->
setCurrentIndex
(
account
->
getTlsMethod
());
/* */
/*
*/
m_pDefaultAccount
->
setChecked
(
account
==
AccountList
::
getInstance
()
->
getDefaultAccount
());
account
->
getVideoCodecModel
()
->
reload
();
disconnect
(
list_credential
->
selectionModel
(),
SIGNAL
(
currentChanged
(
QModelIndex
,
QModelIndex
)),
this
,
SLOT
(
selectCredential
(
QModelIndex
,
QModelIndex
)));
disconnect
(
list_credential
->
selectionModel
(),
SIGNAL
(
currentChanged
(
QModelIndex
,
QModelIndex
)),
this
,
SLOT
(
selectCredential
(
QModelIndex
,
QModelIndex
))
);
list_credential
->
setModel
(
account
->
getCredentialsModel
());
connect
(
list_credential
->
selectionModel
()
,
SIGNAL
(
currentChanged
(
QModelIndex
,
QModelIndex
)),
this
,
SLOT
(
selectCredential
(
QModelIndex
,
QModelIndex
)));
connect
(
list_credential
->
selectionModel
()
,
SIGNAL
(
currentChanged
(
QModelIndex
,
QModelIndex
)),
this
,
SLOT
(
selectCredential
(
QModelIndex
,
QModelIndex
))
);
disconnect
(
list_audiocodec
->
selectionModel
(),
SIGNAL
(
currentChanged
(
QModelIndex
,
QModelIndex
)),
this
,
SLOT
(
selectedCodecChanged
(
QModelIndex
,
QModelIndex
)));
disconnect
(
list_audiocodec
->
model
(),
SIGNAL
(
dataChanged
(
QModelIndex
,
QModelIndex
)),
this
,
SLOT
(
changedAccountList
()));
disconnect
(
list_audiocodec
->
selectionModel
(),
SIGNAL
(
currentChanged
(
QModelIndex
,
QModelIndex
)),
this
,
SLOT
(
selectedCodecChanged
(
QModelIndex
,
QModelIndex
))
);
disconnect
(
list_audiocodec
->
model
()
,
SIGNAL
(
dataChanged
(
QModelIndex
,
QModelIndex
)),
this
,
SLOT
(
changedAccountList
())
);
list_audiocodec
->
setModel
(
account
->
getAudioCodecModel
());
connect
(
list_audiocodec
->
model
(),
SIGNAL
(
dataChanged
(
QModelIndex
,
QModelIndex
)),
this
,
SLOT
(
changedAccountList
()));
connect
(
list_audiocodec
->
selectionModel
()
,
SIGNAL
(
currentChanged
(
QModelIndex
,
QModelIndex
)),
this
,
SLOT
(
selectedCodecChanged
(
QModelIndex
,
QModelIndex
)));
connect
(
list_audiocodec
->
model
()
,
SIGNAL
(
dataChanged
(
QModelIndex
,
QModelIndex
)),
this
,
SLOT
(
changedAccountList
())
);
connect
(
list_audiocodec
->
selectionModel
()
,
SIGNAL
(
currentChanged
(
QModelIndex
,
QModelIndex
)),
this
,
SLOT
(
selectedCodecChanged
(
QModelIndex
,
QModelIndex
))
);
#ifdef ENABLE_VIDEO
disconnect
(
m_pCodecsLW
->
selectionModel
(),
SIGNAL
(
currentChanged
(
QModelIndex
,
QModelIndex
)),
this
,
SLOT
(
loadVidCodecDetails
(
QModelIndex
,
QModelIndex
)));
disconnect
(
m_pCodecsLW
->
model
(),
SIGNAL
(
dataChanged
(
QModelIndex
,
QModelIndex
)),
this
,
SLOT
(
changedAccountList
()));
disconnect
(
m_pCodecsLW
->
selectionModel
()
,
SIGNAL
(
currentChanged
(
QModelIndex
,
QModelIndex
)),
this
,
SLOT
(
loadVidCodecDetails
(
QModelIndex
,
QModelIndex
))
);
disconnect
(
m_pCodecsLW
->
model
()
,
SIGNAL
(
dataChanged
(
QModelIndex
,
QModelIndex
)),
this
,
SLOT
(
changedAccountList
())
);
m_pCodecsLW
->
setModel
(
account
->
getVideoCodecModel
());
connect
(
m_pCodecsLW
->
model
(),
SIGNAL
(
dataChanged
(
QModelIndex
,
QModelIndex
)),
this
,
SLOT
(
changedAccountList
()));
connect
(
m_pCodecsLW
->
selectionModel
()
,
SIGNAL
(
currentChanged
(
QModelIndex
,
QModelIndex
)),
this
,
SLOT
(
loadVidCodecDetails
(
QModelIndex
,
QModelIndex
)));
connect
(
m_pCodecsLW
->
model
()
,
SIGNAL
(
dataChanged
(
QModelIndex
,
QModelIndex
)),
this
,
SLOT
(
changedAccountList
())
);
connect
(
m_pCodecsLW
->
selectionModel
()
,
SIGNAL
(
currentChanged
(
QModelIndex
,
QModelIndex
)),
this
,
SLOT
(
loadVidCodecDetails
(
QModelIndex
,
QModelIndex
))
);
#endif
if
(
account
->
getAccountAlias
()
==
"IP2IP"
)
{
frame2_editAccounts
->
setTabEnabled
(
0
,
false
);
frame2_editAccounts
->
setTabEnabled
(
1
,
false
);
frame2_editAccounts
->
setTabEnabled
(
2
,
true
);
frame2_editAccounts
->
setTabEnabled
(
3
,
false
);
frame2_editAccounts
->
setTabEnabled
(
4
,
false
);
frame2_editAccounts
->
setTabEnabled
(
5
,
true
);
frame2_editAccounts
->
setTabEnabled
(
0
,
false
);
frame2_editAccounts
->
setTabEnabled
(
1
,
false
);
frame2_editAccounts
->
setTabEnabled
(
2
,
true
);
frame2_editAccounts
->
setTabEnabled
(
3
,
false
);
frame2_editAccounts
->
setTabEnabled
(
4
,
false
);
frame2_editAccounts
->
setTabEnabled
(
5
,
true
);
}
else
{
frame2_editAccounts
->
setTabEnabled
(
0
,
true
);
frame2_editAccounts
->
setTabEnabled
(
1
,
true
);
frame2_editAccounts
->
setTabEnabled
(
3
,
true
);
frame2_editAccounts
->
setTabEnabled
(
4
,
true
);
frame2_editAccounts
->
setTabEnabled
(
0
,
true
);
frame2_editAccounts
->
setTabEnabled
(
1
,
true
);
frame2_editAccounts
->
setTabEnabled
(
3
,
true
);
frame2_editAccounts
->
setTabEnabled
(
4
,
true
);
frame2_editAccounts
->
setCurrentIndex
(
0
);
}
...
...
@@ -374,8 +372,8 @@ void DlgAccounts::loadAccount(QModelIndex item)
m_pRingTonePath
->
setUrl
(
ringtonePath
);
combo_tls_method
->
setCurrentIndex
(
account
->
getTlsMethod
()
);
ConfigurationManagerInterface
&
configurationManager
=
ConfigurationManagerInterfaceSingleton
::
getInstance
();
combo_tls_method
->
setCurrentIndex
(
account
->
getTlsMethod
()
);
ConfigurationManagerInterface
&
configurationManager
=
ConfigurationManagerInterfaceSingleton
::
getInstance
();
m_pRingtoneListLW
->
clear
();
m_hRingtonePath
=
configurationManager
.
getRingtoneList
();
...
...
@@ -383,14 +381,15 @@ void DlgAccounts::loadAccount(QModelIndex item)
bool
found
=
false
;
while
(
iter
.
hasNext
())
{
iter
.
next
();
QListWidgetItem
*
item
=
new
QListWidgetItem
();
QListWidgetItem
*
item
=
new
QListWidgetItem
();
RingToneListItem
*
item_widget
=
new
RingToneListItem
(
iter
.
key
(),
iter
.
value
());
m_pRingtoneListLW
->
addItem
(
item
);
m_pRingtoneListLW
->
setItemWidget
(
item
,
item_widget
);
m_pRingtoneListLW
->
addItem
(
item
);
m_pRingtoneListLW
->
setItemWidget
(
item
,
item_widget
);
if
(
KStandardDirs
::
realFilePath
(
iter
.
key
())
==
ringtonePath
)
{
m_pUseCustomFileCK
->
setChecked
(
false
);
m_pRingTonePath
->
setDisabled
(
true
);
item
->
setSelected
(
true
);
m_pUseCustomFileCK
->
setChecked
(
false
);
m_pRingTonePath
->
setDisabled
(
true
);
item
->
setSelected
(
true
);
found
=
true
;
}
}
...
...
@@ -412,17 +411,16 @@ void DlgAccounts::loadAccount(QModelIndex item)
line_stun
->
setText
(
account
->
getAccountSipStunServer
()
);
//checkbox_zrtp->setChecked(account->getAccountDetail(ACCOUNT_SRTP_ENABLED) == REGISTRATION_ENABLED_TRUE);
tab_advanced
->
setEnabled
(
true
);
line_stun
->
setEnabled
(
checkbox_stun
->
isChecked
());
radioButton_pa_same_as_local
->
setDisabled
(
checkbox_stun
->
isChecked
());
radioButton_pa_custom
->
setDisabled
(
checkbox_stun
->
isChecked
());
tab_advanced
->
setEnabled
(
true
);
line_stun
->
setEnabled
(
checkbox_stun
->
isChecked
()
);
radioButton_pa_same_as_local
->
setDisabled
(
checkbox_stun
->
isChecked
()
);
radioButton_pa_custom
->
setDisabled
(
checkbox_stun
->
isChecked
()
);
}
else
{
checkbox_stun
->
setChecked
(
false
);
tab_advanced
->
setEnabled
(
false
);
line_stun
->
setText
(
account
->
getAccountSipStunServer
()
);
//checkbox_zrtp->setChecked(false);
tab_advanced
->
setEnabled
(
false
);
}
updateStatusLabel
(
account
);
...
...
@@ -438,10 +436,8 @@ void DlgAccounts::loadAccountList()
AccountList
::
getInstance
()
->
updateAccounts
();
if
(
listView_accountList
->
model
()
->
rowCount
()
>
0
&&
!
listView_accountList
->
currentIndex
().
isValid
())
listView_accountList
->
setCurrentIndex
(
listView_accountList
->
model
()
->
index
(
0
,
0
));
else
if
(
listView_accountList
->
currentIndex
().
isValid
())
frame2_editAccounts
->
setEnabled
(
true
);
else
frame2_editAccounts
->
setEnabled
(
false
);
frame2_editAccounts
->
setEnabled
(
listView_accountList
->
currentIndex
().
isValid
()
);
}
///Called when one of the child widget is modified
...
...
@@ -449,9 +445,8 @@ void DlgAccounts::changedAccountList()
{
if
(
!
m_IsLoading
)
{
Account
*
acc
=
AccountList
::
getInstance
()
->
getAccountByModelIndex
(
listView_accountList
->
currentIndex
());
if
(
acc
)
{
if
(
acc
)
acc
->
performAction
(
MODIFY
);
}
accountListHasChanged
=
true
;
emit
updateButtons
();
}
...
...
@@ -475,27 +470,27 @@ void DlgAccounts::accountListChanged(QModelIndex current, QModelIndex previous)
//updateAccountListCommands();
}
///Move account up
void
DlgAccounts
::
on_button_accountUp_clicked
()
{
kDebug
()
<<
"on_button_accountUp_clicked"
;
QModelIndex
index
=
listView_accountList
->
currentIndex
();
Account
*
acc
=
AccountList
::
getInstance
()
->
getAccountByModelIndex
(
index
);
AccountList
::
getInstance
()
->
accountUp
(
index
.
row
());
listView_accountList
->
setCurrentIndex
(
acc
->
getIndex
());
}
///Move account down
void
DlgAccounts
::
on_button_accountDown_clicked
()
{
kDebug
()
<<
"on_button_accountDown_clicked"
;
QModelIndex
index
=
listView_accountList
->
currentIndex
();
Account
*
acc
=
AccountList
::
getInstance
()
->
getAccountByModelIndex
(
index
);
AccountList
::
getInstance
()
->
accountDown
(
index
.
row
());
listView_accountList
->
setCurrentIndex
(
acc
->
getIndex
());
}
///Add new account
void
DlgAccounts
::
on_button_accountAdd_clicked
()
{
kDebug
()
<<
"on_button_accountAdd_clicked"
;
QString
itemName
=
QInputDialog
::
getText
(
this
,
"New account"
,
"Enter new account's alias"
);
itemName
=
itemName
.
simplified
();
if
(
!
itemName
.
isEmpty
())
{
...
...
@@ -506,27 +501,27 @@ void DlgAccounts::on_button_accountAdd_clicked()
}
}
//on_button_accountAdd_clicked
///Remove selected account
void
DlgAccounts
::
on_button_accountRemove_clicked
()
{
kDebug
()
<<
"on_button_accountRemove_clicked"
;
AccountList
::
getInstance
()
->
removeAccount
(
listView_accountList
->
currentIndex
());
listView_accountList
->
setCurrentIndex
(
listView_accountList
->
model
()
->
index
(
0
,
0
));
}
///Update account list
void
DlgAccounts
::
updateAccountListCommands
()
{
kDebug
()
<<
"updateAccountListCommands"
;
bool
buttonsEnabled
[
4
]
=
{
true
,
true
,
true
,
true
};
if
(
!
listView_accountList
->
currentIndex
().
isValid
())
{
buttonsEnabled
[
0
]
=
false
;
buttonsEnabled
[
1
]
=
false
;
buttonsEnabled
[
3
]
=
false
;
buttonsEnabled
[
0
]
=
false
;
buttonsEnabled
[
1
]
=
false
;
buttonsEnabled
[
3
]
=
false
;
}
else
if
(
listView_accountList
->
currentIndex
().
row
()
==
0
)
{
buttonsEnabled
[
0
]
=
false
;
buttonsEnabled
[
0
]
=
false
;
}
if
(
listView_accountList
->
currentIndex
().
row
()
==
listView_accountList
->
model
()
->
rowCount
()
-
1
)
{
buttonsEnabled
[
1
]
=
false
;
buttonsEnabled
[
1
]
=
false
;
}
button_accountUp
->
setEnabled
(
buttonsEnabled
[
0
]
);
...
...
@@ -535,12 +530,13 @@ void DlgAccounts::updateAccountListCommands()
button_accountRemove
->
setEnabled
(
buttonsEnabled
[
3
]
);
}
///Password changed
void
DlgAccounts
::
main_password_field_changed
()
{
list_credential
->
model
()
->
setData
(
list_credential
->
model
()
->
index
(
0
,
0
),
edit5_password
->
text
(),
CredentialModel
::
PASSWORD_ROLE
);
}
///Credential changed
void
DlgAccounts
::
main_credential_password_changed
()
{
if
(
list_credential
->
currentIndex
().
row
()
==
0
)
{
...
...
@@ -548,30 +544,35 @@ void DlgAccounts::main_credential_password_changed()
}
}
///Move codec up
void
DlgAccounts
::
moveAudioCodecUp
()
{
if
(((
AudioCodecModel
*
)
list_audiocodec
->
model
())
->
moveUp
(
list_audiocodec
->
currentIndex
()))
list_audiocodec
->
setCurrentIndex
(
list_audiocodec
->
model
()
->
index
(
list_audiocodec
->
currentIndex
().
row
()
-
1
,
0
));
}
///Move codec down
void
DlgAccounts
::
moveAudioCodecDown
()
{
if
(((
AudioCodecModel
*
)
list_audiocodec
->
model
())
->
moveDown
(
list_audiocodec
->
currentIndex
()))
list_audiocodec
->
setCurrentIndex
(
list_audiocodec
->
model
()
->
index
(
list_audiocodec
->
currentIndex
().
row
()
+
1
,
0
));
}
///Move video codec up
void
DlgAccounts
::
moveVideoCodecUp
()
{
if
(((
VideoCodecModel
*
)
m_pCodecsLW
->
model
())
->
moveUp
(
m_pCodecsLW
->
currentIndex
()))
m_pCodecsLW
->
setCurrentIndex
(
m_pCodecsLW
->
model
()
->
index
(
m_pCodecsLW
->
currentIndex
().
row
()
-
1
,
0
));
}
///Move video codec down
void
DlgAccounts
::
moveVideoCodecDown
()
{
if
(((
VideoCodecModel
*
)
m_pCodecsLW
->
model
())
->
moveDown
(
m_pCodecsLW
->
currentIndex
()))
m_pCodecsLW
->
setCurrentIndex
(
m_pCodecsLW
->
model
()
->
index
(
m_pCodecsLW
->
currentIndex
().
row
()
+
1
,
0
));
}
///Load the video codec list
void
DlgAccounts
::
loadVidCodecDetails
(
const
QModelIndex
&
current
,
const
QModelIndex
&
previous
)
{
if
(
previous
!=
current
&&
previous
.
isValid
())
{
...
...
@@ -582,6 +583,7 @@ void DlgAccounts::loadVidCodecDetails(const QModelIndex& current,const QModelInd
m_pBitrateSB
->
setValue
(
bitrate
);
}
///Update account state
void
DlgAccounts
::
updateAccountStates
()
{
kDebug
()
<<
"updateAccountStates"
;
...
...
@@ -592,22 +594,22 @@ void DlgAccounts::updateAccountStates()
updateStatusLabel
(
listView_accountList
->
currentIndex
());
}
///Update the status label to current account state
void
DlgAccounts
::
updateStatusLabel
(
QModelIndex
item
)
{
kDebug
()
<<
"MODEL index is"
<<
item
.
row
();
if
(
!
item
.
isValid
())
{
if
(
!
item
.
isValid
())
return
;
}
Account
*
account
=
AccountList
::
getInstance
()
->
getAccountByModelIndex
(
item
);
if
(
account
)
updateStatusLabel
(
account
);
}
///Update the status label to current account state
void
DlgAccounts
::
updateStatusLabel
(
Account
*
account
)
{
if
(
!
account
)
{
return
;
}
if
(
!
account
)
return
;
QString
status
=
account
->
getAccountRegistrationStatus
();
edit7_state
->
setText
(
"<FONT COLOR=
\"
"
+
account
->
getStateColorName
()
+
"
\"
>"
+
status
+
"</FONT>"
);
}
...
...
@@ -642,6 +644,7 @@ void DlgAccounts::updateWidgets()
accountListHasChanged
=
false
;
}
///The audio codec changed
void
DlgAccounts
::
selectedCodecChanged
(
const
QModelIndex
&
current
,
const
QModelIndex
&
previous
)
{
Q_UNUSED
(
previous
)
...
...
@@ -649,7 +652,7 @@ void DlgAccounts::selectedCodecChanged(const QModelIndex& current,const QModelIn
label_frequency_value
->
setText
(
list_audiocodec
->
model
()
->
data
(
current
,
AudioCodecModel
::
SAMPLERATE_ROLE
).
toString
());
}
///Select available security options for various methods
void
DlgAccounts
::
updateCombo
(
int
value
)
{
Q_UNUSED
(
value
)
...
...
@@ -678,6 +681,7 @@ void DlgAccounts::updateCombo(int value)
}
}
//updateCombo
///Save the current credential
void
DlgAccounts
::
saveCredential
()
{
QModelIndex
index
=
listView_accountList
->
currentIndex
();
...
...
@@ -693,6 +697,7 @@ void DlgAccounts::saveCredential()
acc
->
saveCredentials
();
}
//saveCredential
///Add a new credential
void
DlgAccounts
::
addCredential
()
{
QModelIndex
index
=
listView_accountList
->
currentIndex
();
...
...
@@ -702,6 +707,7 @@ void DlgAccounts::addCredential()
list_credential
->
setCurrentIndex
(
idx
);
}
//addCredential
///Save and load a credential
void
DlgAccounts
::
selectCredential
(
QModelIndex
item
,
QModelIndex
previous
)
{
list_credential
->
model
()
->
setData
(
previous
,
edit_credential_auth
->
text
()
,
CredentialModel
::
NAME_ROLE
);
...
...
@@ -718,12 +724,14 @@ void DlgAccounts::selectCredential(QModelIndex item, QModelIndex previous)
//TODO
}
//selectCredential
///Remove a credential
void
DlgAccounts
::
removeCredential
()
{
Account
*
acc
=
AccountList
::
getInstance
()
->
getAccountByModelIndex
(
listView_accountList
->
currentIndex
());
acc
->
getCredentialsModel
()
->
removeCredentials
(
list_credential
->
currentIndex
());
list_credential
->
setCurrentIndex
(
acc
->
getCredentialsModel
()
->
index
(
0
,
0
));
}
///Enable published
void
DlgAccounts
::
enablePublished
()
{
lineEdit_pa_published_address
->
setDisabled
(
radioButton_pa_same_as_local
->
isChecked
());
...
...
kde/src/conf/dlgaccounts.h
View file @
62b69203
...
...
@@ -41,12 +41,12 @@ class RingToneListItem : public QWidget
friend
class
DlgAccounts
;
///Constructor
RingToneListItem
(
QString
path
,
QString
name
)
:
QWidget
(
0
),
m_Path
(
path
)
{
QHBoxLayout
*
l
=
new
QHBoxLayout
(
this
);
QHBoxLayout
*
l
=
new
QHBoxLayout
(
this
);
m_pPlayPB
=
new
QPushButton
(
this
);
QLabel
*
lblName
=
new
QLabel
(
name
,
this
);
l
->
setContentsMargins
(
0
,
0
,
0
,
0
);
m_pPlayPB
=
new
QPushButton
(
this
);
m_pPlayPB
->
setIcon
(
KIcon
(
"media-playback-start"
));
m_pPlayPB
->
setVisible
(
false
);
QLabel
*
lblName
=
new
QLabel
(
name
,
this
);
lblName
->
setStyleSheet
(
"padding-left:5px;"
);
lblName
->
setSizePolicy
(
QSizePolicy
::
Expanding
,
QSizePolicy
::
Expanding
);
l
->
addWidget
(
lblName
);
...
...
@@ -153,7 +153,6 @@ private slots:
signals:
///Update the Ok and Apply button style
void
updateButtons
();
};
#endif
kde/src/conf/dlgaddressbook.cpp
View file @
62b69203
...
...
@@ -27,21 +27,20 @@ DlgAddressBook::DlgAddressBook(QWidget *parent)
{
setupUi
(
this
);
m_pPhoneTypeList
->
addItem
(
m_mNumbertype
[
"Work"
]
=
new
QListWidgetItem
(
"Work"
));
m_pPhoneTypeList
->
addItem
(
m_mNumbertype
[
"Home"
]
=
new
QListWidgetItem
(
"Home"
));
m_pPhoneTypeList
->
addItem
(
m_mNumbertype
[
"Messenger"
]
=
new
QListWidgetItem
(
"Messenger"
));
m_pPhoneTypeList
->
addItem
(
m_mNumbertype
[
"Work"
]
=
new
QListWidgetItem
(
"Work"
));
m_pPhoneTypeList
->
addItem
(
m_mNumbertype
[
"Home"
]
=
new
QListWidgetItem
(
"Home"
));
m_pPhoneTypeList
->
addItem
(
m_mNumbertype
[
"Messenger"
]
=
new
QListWidgetItem
(
"Messenger"
));
m_pPhoneTypeList
->
addItem
(
m_mNumbertype
[
"Preferred number"
]
=
new
QListWidgetItem
(
"Preferred number"
));
m_pPhoneTypeList
->
addItem
(
m_mNumbertype
[
"Voice"
]
=
new
QListWidgetItem
(
"Voice"
));
// m_pPhoneTypeList->addItem( m_mNumbertype["Fax"] = new QListWidgetItem("Fax" ));
m_pPhoneTypeList
->
addItem
(
m_mNumbertype
[
"Mobile"
]
=
new
QListWidgetItem
(
"Mobile"
));
m_pPhoneTypeList
->
addItem
(
m_mNumbertype
[
"Video"
]
=
new
QListWidgetItem
(
"Video"
));
m_pPhoneTypeList
->
addItem
(
m_mNumbertype
[
"Mailbox"
]
=
new
QListWidgetItem
(
"Mailbox"
));
m_pPhoneTypeList
->
addItem
(
m_mNumbertype
[
"Modem"
]
=
new
QListWidgetItem
(
"Modem"
));
m_pPhoneTypeList
->
addItem
(
m_mNumbertype
[
"Car"
]
=
new
QListWidgetItem
(
"Car"
));
m_pPhoneTypeList
->
addItem
(
m_mNumbertype
[
"ISDN"
]
=
new
QListWidgetItem
(
"ISDN"
));
m_pPhoneTypeList
->
addItem
(
m_mNumbertype
[
"PCS"
]
=
new
QListWidgetItem
(
"PCS"
));
m_pPhoneTypeList
->
addItem
(
m_mNumbertype
[
"Pager"
]
=
new
QListWidgetItem
(
"Pager"
));
m_pPhoneTypeList
->
addItem
(
m_mNumbertype
[
"Other..."
]
=
new
QListWidgetItem
(
"Other..."
));
m_pPhoneTypeList
->
addItem
(
m_mNumbertype
[
"Voice"
]
=
new
QListWidgetItem
(
"Voice"
));
m_pPhoneTypeList
->
addItem
(
m_mNumbertype
[
"Mobile"
]
=
new
QListWidgetItem
(
"Mobile"
));
m_pPhoneTypeList
->
addItem
(
m_mNumbertype
[
"Video"
]
=
new
QListWidgetItem
(
"Video"
));
m_pPhoneTypeList
->
addItem
(
m_mNumbertype
[
"Mailbox"
]
=
new
QListWidgetItem
(
"Mailbox"
));
m_pPhoneTypeList
->
addItem
(
m_mNumbertype
[
"Modem"
]
=
new
QListWidgetItem
(
"Modem"
));
m_pPhoneTypeList
->
addItem
(
m_mNumbertype
[
"Car"
]
=
new
QListWidgetItem
(
"Car"
));
m_pPhoneTypeList
->
addItem
(
m_mNumbertype
[
"ISDN"
]
=
new
QListWidgetItem
(
"ISDN"
));
m_pPhoneTypeList
->
addItem
(
m_mNumbertype
[
"PCS"
]
=
new
QListWidgetItem
(
"PCS"
));
m_pPhoneTypeList
->
addItem
(
m_mNumbertype
[
"Pager"
]
=
new
QListWidgetItem
(
"Pager"
));
m_pPhoneTypeList
->
addItem
(
m_mNumbertype
[
"Other..."
]
=
new
QListWidgetItem
(
"Other..."
));
QStringList
list
=
ConfigurationSkeleton
::
phoneTypeList
();
foreach
(
QListWidgetItem
*
i
,
m_mN