Commit f1892798 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(ui/views/App/Main/ManageAccounts): display registration failed

parent 9a892096
...@@ -248,7 +248,6 @@ QVariantList AccountSettingsModel::getAccounts () const { ...@@ -248,7 +248,6 @@ QVariantList AccountSettingsModel::getAccounts () const {
{ {
QVariantMap account; QVariantMap account;
account["sipAddress"] = ::Utils::linphoneStringToQString(core->getPrimaryContactParsed()->asStringUriOnly()); account["sipAddress"] = ::Utils::linphoneStringToQString(core->getPrimaryContactParsed()->asStringUriOnly());
account["proxyConfig"].setValue(shared_ptr<linphone::ProxyConfig>());
accounts << account; accounts << account;
} }
......
...@@ -2,9 +2,13 @@ ...@@ -2,9 +2,13 @@
// `ComboBox.qml` Logic. // `ComboBox.qml` Logic.
// ============================================================================= // =============================================================================
.import 'qrc:/ui/scripts/Utils/utils.js' as Utils
// =============================================================================
function getSelectedEntryIcon () { function getSelectedEntryIcon () {
var iconRole = comboBox.iconRole var iconRole = comboBox.iconRole
if (iconRole.length === 0) { if (iconRole == null || iconRole.length === 0) {
return '' return ''
} }
...@@ -14,6 +18,15 @@ function getSelectedEntryIcon () { ...@@ -14,6 +18,15 @@ function getSelectedEntryIcon () {
} }
var model = comboBox.model var model = comboBox.model
if (Utils.isFunction(iconRole)) {
return iconRole(
Utils.isArray(model)
? model[currentIndex]
: model.get(currentIndex)
)
}
return ( return (
Utils.isArray(model) Utils.isArray(model)
? model[currentIndex][iconRole] ? model[currentIndex][iconRole]
...@@ -23,5 +36,11 @@ function getSelectedEntryIcon () { ...@@ -23,5 +36,11 @@ function getSelectedEntryIcon () {
function getEntryIcon (item) { function getEntryIcon (item) {
var iconRole = comboBox.iconRole var iconRole = comboBox.iconRole
return (iconRole.length && item.flattenedModel[iconRole]) || '' if (iconRole == null || iconRole.length === 0) {
return ''
}
return Utils.isFunction(iconRole)
? iconRole(item.flattenedModel)
: item.flattenedModel[iconRole]
} }
...@@ -16,7 +16,7 @@ ComboBox { ...@@ -16,7 +16,7 @@ ComboBox {
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
property string iconRole: '' property var iconRole
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
......
...@@ -62,6 +62,12 @@ DialogPlus { ...@@ -62,6 +62,12 @@ DialogPlus {
}) })
model: AccountSettingsModel.accounts model: AccountSettingsModel.accounts
iconRole: (function (data) {
var proxyConfig = data.proxyConfig
return proxyConfig && AccountSettingsModel.getProxyConfigDescription(proxyConfig).registrationState !== AccountSettingsModel.RegistrationStateRegistered
? 'generic_error'
: ''
})
textRole: 'sipAddress' textRole: 'sipAddress'
onActivated: AccountSettingsModel.setDefaultProxyConfig(model[index].proxyConfig) onActivated: AccountSettingsModel.setDefaultProxyConfig(model[index].proxyConfig)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment