diff --git a/linphone-app/assets/languages/cs.ts b/linphone-app/assets/languages/cs.ts
index 28ad22c92..1a1d73d69 100644
--- a/linphone-app/assets/languages/cs.ts
+++ b/linphone-app/assets/languages/cs.ts
@@ -3697,6 +3697,11 @@ Klikněte zde: <a href="%1">%1</a>
'Display only usernames from SIP addresses' : tooltip for addresses display mode where username is only shown.
+
+ magicSearchMaxResultsLabel
+ 'Max results on search' : Label for setting the max results returned by the Magic Search bar.
+
+
SettingsVideo
diff --git a/linphone-app/assets/languages/da.ts b/linphone-app/assets/languages/da.ts
index 46966c130..be5ec30a8 100644
--- a/linphone-app/assets/languages/da.ts
+++ b/linphone-app/assets/languages/da.ts
@@ -3660,6 +3660,11 @@ Klik her: <a href="%1">%1</a>
'Display only usernames from SIP addresses' : tooltip for addresses display mode where username is only shown.
+
+ magicSearchMaxResultsLabel
+ 'Max results on search' : Label for setting the max results returned by the Magic Search bar.
+
+
SettingsVideo
diff --git a/linphone-app/assets/languages/de.ts b/linphone-app/assets/languages/de.ts
index 326d2b429..7a4ed5226 100644
--- a/linphone-app/assets/languages/de.ts
+++ b/linphone-app/assets/languages/de.ts
@@ -3660,6 +3660,11 @@ Klicken Sie hier: <a href="%1">%1</a>
'Display only usernames from SIP addresses' : tooltip for addresses display mode where username is only shown.
+
+ magicSearchMaxResultsLabel
+ 'Max results on search' : Label for setting the max results returned by the Magic Search bar.
+
+
SettingsVideo
diff --git a/linphone-app/assets/languages/en.ts b/linphone-app/assets/languages/en.ts
index 8773634b8..0254195ef 100644
--- a/linphone-app/assets/languages/en.ts
+++ b/linphone-app/assets/languages/en.ts
@@ -3685,6 +3685,11 @@ Click here: <a href="%1">%1</a>
'Display only usernames from SIP addresses' : tooltip for addresses display mode where username is only shown.
Display only usernames from SIP addresses
+
+ magicSearchMaxResultsLabel
+ 'Max results on search' : Label for setting the max results returned by the Magic Search bar.
+ Max results on search
+
SettingsVideo
diff --git a/linphone-app/assets/languages/es.ts b/linphone-app/assets/languages/es.ts
index 3438bd115..50a3d259e 100644
--- a/linphone-app/assets/languages/es.ts
+++ b/linphone-app/assets/languages/es.ts
@@ -3660,6 +3660,11 @@ Haga clic aquí: <a href="%1">%1 </a>
'Display only usernames from SIP addresses' : tooltip for addresses display mode where username is only shown.
+
+ magicSearchMaxResultsLabel
+ 'Max results on search' : Label for setting the max results returned by the Magic Search bar.
+
+
SettingsVideo
diff --git a/linphone-app/assets/languages/fr_FR.ts b/linphone-app/assets/languages/fr_FR.ts
index 4c3138e5d..65f89cb7d 100644
--- a/linphone-app/assets/languages/fr_FR.ts
+++ b/linphone-app/assets/languages/fr_FR.ts
@@ -3660,6 +3660,11 @@ Cliquez ici : <a href="%1">%1</a>
'Display only usernames from SIP addresses' : tooltip for addresses display mode where username is only shown.
Lorsque des adresses SIP sont affichées, n'afficher que les noms d'utilisateurs
+
+ magicSearchMaxResultsLabel
+ 'Max results on search' : Label for setting the max results returned by the Magic Search bar.
+
+
SettingsVideo
diff --git a/linphone-app/assets/languages/hu.ts b/linphone-app/assets/languages/hu.ts
index 1b4d60995..4db60cf8e 100644
--- a/linphone-app/assets/languages/hu.ts
+++ b/linphone-app/assets/languages/hu.ts
@@ -3647,6 +3647,11 @@ Kattintson ide: <a href="%1">%1</a>
'Display only usernames from SIP addresses' : tooltip for addresses display mode where username is only shown.
+
+ magicSearchMaxResultsLabel
+ 'Max results on search' : Label for setting the max results returned by the Magic Search bar.
+
+
SettingsVideo
diff --git a/linphone-app/assets/languages/it.ts b/linphone-app/assets/languages/it.ts
index 2ea8a71c5..c5b1692ed 100644
--- a/linphone-app/assets/languages/it.ts
+++ b/linphone-app/assets/languages/it.ts
@@ -3660,6 +3660,11 @@ Clicca: <a href="%1">%1</a>
'Display only usernames from SIP addresses' : tooltip for addresses display mode where username is only shown.
+
+ magicSearchMaxResultsLabel
+ 'Max results on search' : Label for setting the max results returned by the Magic Search bar.
+
+
SettingsVideo
diff --git a/linphone-app/assets/languages/ja.ts b/linphone-app/assets/languages/ja.ts
index 12f97c975..7d4ef33c1 100644
--- a/linphone-app/assets/languages/ja.ts
+++ b/linphone-app/assets/languages/ja.ts
@@ -3647,6 +3647,11 @@
'Display only usernames from SIP addresses' : tooltip for addresses display mode where username is only shown.
+
+ magicSearchMaxResultsLabel
+ 'Max results on search' : Label for setting the max results returned by the Magic Search bar.
+
+
SettingsVideo
diff --git a/linphone-app/assets/languages/lt.ts b/linphone-app/assets/languages/lt.ts
index cd1d545d6..3659e3b3b 100644
--- a/linphone-app/assets/languages/lt.ts
+++ b/linphone-app/assets/languages/lt.ts
@@ -3673,6 +3673,11 @@ Spustelėkite čia: <a href="%1">%1</a>
'Display only usernames from SIP addresses' : tooltip for addresses display mode where username is only shown.
+
+ magicSearchMaxResultsLabel
+ 'Max results on search' : Label for setting the max results returned by the Magic Search bar.
+
+
SettingsVideo
diff --git a/linphone-app/assets/languages/pt_BR.ts b/linphone-app/assets/languages/pt_BR.ts
index 553ac097f..e553885a4 100644
--- a/linphone-app/assets/languages/pt_BR.ts
+++ b/linphone-app/assets/languages/pt_BR.ts
@@ -3660,6 +3660,11 @@ Clique aqui: <a href="%1">%1 </a>
'Display only usernames from SIP addresses' : tooltip for addresses display mode where username is only shown.
+
+ magicSearchMaxResultsLabel
+ 'Max results on search' : Label for setting the max results returned by the Magic Search bar.
+
+
SettingsVideo
diff --git a/linphone-app/assets/languages/ru.ts b/linphone-app/assets/languages/ru.ts
index 63a23fa63..4cfd10c4b 100644
--- a/linphone-app/assets/languages/ru.ts
+++ b/linphone-app/assets/languages/ru.ts
@@ -3673,6 +3673,11 @@
'Display only usernames from SIP addresses' : tooltip for addresses display mode where username is only shown.
+
+ magicSearchMaxResultsLabel
+ 'Max results on search' : Label for setting the max results returned by the Magic Search bar.
+
+
SettingsVideo
diff --git a/linphone-app/assets/languages/sv.ts b/linphone-app/assets/languages/sv.ts
index 19738b147..d216b4308 100644
--- a/linphone-app/assets/languages/sv.ts
+++ b/linphone-app/assets/languages/sv.ts
@@ -3660,6 +3660,11 @@ Klicka här: <a href="%1">%1</a>
'Display only usernames from SIP addresses' : tooltip for addresses display mode where username is only shown.
+
+ magicSearchMaxResultsLabel
+ 'Max results on search' : Label for setting the max results returned by the Magic Search bar.
+
+
SettingsVideo
diff --git a/linphone-app/assets/languages/tr.ts b/linphone-app/assets/languages/tr.ts
index 84ce257cb..8e24fcf29 100644
--- a/linphone-app/assets/languages/tr.ts
+++ b/linphone-app/assets/languages/tr.ts
@@ -3647,6 +3647,11 @@ Buraya tıklayın: <a href="%1">%1</a>
'Display only usernames from SIP addresses' : tooltip for addresses display mode where username is only shown.
+
+ magicSearchMaxResultsLabel
+ 'Max results on search' : Label for setting the max results returned by the Magic Search bar.
+
+
SettingsVideo
diff --git a/linphone-app/assets/languages/uk.ts b/linphone-app/assets/languages/uk.ts
index ddbdf86cd..451d992f2 100644
--- a/linphone-app/assets/languages/uk.ts
+++ b/linphone-app/assets/languages/uk.ts
@@ -3673,6 +3673,11 @@
'Display only usernames from SIP addresses' : tooltip for addresses display mode where username is only shown.
+
+ magicSearchMaxResultsLabel
+ 'Max results on search' : Label for setting the max results returned by the Magic Search bar.
+
+
SettingsVideo
diff --git a/linphone-app/assets/languages/zh_CN.ts b/linphone-app/assets/languages/zh_CN.ts
index f2a426704..d51a6c49f 100644
--- a/linphone-app/assets/languages/zh_CN.ts
+++ b/linphone-app/assets/languages/zh_CN.ts
@@ -3647,6 +3647,11 @@
'Display only usernames from SIP addresses' : tooltip for addresses display mode where username is only shown.
+
+ magicSearchMaxResultsLabel
+ 'Max results on search' : Label for setting the max results returned by the Magic Search bar.
+
+
SettingsVideo
diff --git a/linphone-app/src/components/search/SearchSipAddressesModel.cpp b/linphone-app/src/components/search/SearchSipAddressesModel.cpp
index 2334ef0e6..6b5c54808 100644
--- a/linphone-app/src/components/search/SearchSipAddressesModel.cpp
+++ b/linphone-app/src/components/search/SearchSipAddressesModel.cpp
@@ -34,6 +34,7 @@
#include "components/core/CoreManager.hpp"
#include "components/history/HistoryModel.hpp"
#include "components/settings/AccountSettingsModel.hpp"
+#include "components/settings/SettingsModel.hpp"
#include "utils/Utils.hpp"
#include "SearchResultModel.hpp"
@@ -62,9 +63,10 @@ SearchSipAddressesModel::~SearchSipAddressesModel(){
// -----------------------------------------------------------------------------
void SearchSipAddressesModel::setFilter(const QString& filter){
- if(!filter.isEmpty())
+ if(!filter.isEmpty()){
+ mMagicSearch->setSearchLimit((int)CoreManager::getInstance()->getSettingsModel()->getMagicSearchMaxResults());
mMagicSearch->getContactsListAsync(filter.toStdString(),"", (int)linphone::MagicSearchSource::All, linphone::MagicSearchAggregation::None);
- else{
+ }else{
beginResetModel();
mList.clear();
endResetModel();
diff --git a/linphone-app/src/components/settings/SettingsModel.cpp b/linphone-app/src/components/settings/SettingsModel.cpp
index 6c0a5483f..462d779e6 100644
--- a/linphone-app/src/components/settings/SettingsModel.cpp
+++ b/linphone-app/src/components/settings/SettingsModel.cpp
@@ -1703,6 +1703,17 @@ void SettingsModel::setSipDisplayMode(Utils::SipDisplayMode mode){
}
}
+int SettingsModel::getMagicSearchMaxResults() const {
+ return mConfig->getInt(UiSection, "magic_search_max_results", 30);
+}
+
+void SettingsModel::setMagicSearchMaxResults(int maxResults) {
+ if(getMagicSearchMaxResults() != maxResults){
+ mConfig->setInt(UiSection, "magic_search_max_results", maxResults);
+ emit magicSearchMaxResultsChanged();
+ }
+}
+
// =============================================================================
// Advanced.
// =============================================================================
diff --git a/linphone-app/src/components/settings/SettingsModel.hpp b/linphone-app/src/components/settings/SettingsModel.hpp
index 56eeba55b..b1b581172 100644
--- a/linphone-app/src/components/settings/SettingsModel.hpp
+++ b/linphone-app/src/components/settings/SettingsModel.hpp
@@ -223,6 +223,7 @@ class SettingsModel : public QObject {
Q_PROPERTY(bool mipmapEnabled READ isMipmapEnabled WRITE setMipmapEnabled NOTIFY mipmapEnabledChanged)
Q_PROPERTY(bool useMinimalTimelineFilter READ useMinimalTimelineFilter WRITE setUseMinimalTimelineFilter NOTIFY useMinimalTimelineFilterChanged)
Q_PROPERTY(Utils::SipDisplayMode sipDisplayMode READ getSipDisplayMode WRITE setSipDisplayMode NOTIFY sipDisplayModeChanged)
+ Q_PROPERTY(int magicSearchMaxResults READ getMagicSearchMaxResults WRITE setMagicSearchMaxResults NOTIFY magicSearchMaxResultsChanged)
// Advanced. -----------------------------------------------------------------
@@ -618,6 +619,9 @@ public:
Utils::SipDisplayMode getSipDisplayMode() const;
void setSipDisplayMode(Utils::SipDisplayMode mode);
+ int getMagicSearchMaxResults() const;
+ void setMagicSearchMaxResults(int maxResults);
+
// Advanced. ---------------------------------------------------------------------------
@@ -843,6 +847,8 @@ signals:
void versionCheckUrlChanged();
void versionCheckTypeChanged();
+ void magicSearchMaxResultsChanged();
+
// Advanced. -----------------------------------------------------------------
void logsFolderChanged (const QString &folder);
diff --git a/linphone-app/ui/views/App/Main/Assistant/UseAppSipAccount.qml b/linphone-app/ui/views/App/Main/Assistant/UseAppSipAccount.qml
index d31ea60ef..fa9197a26 100644
--- a/linphone-app/ui/views/App/Main/Assistant/UseAppSipAccount.qml
+++ b/linphone-app/ui/views/App/Main/Assistant/UseAppSipAccount.qml
@@ -45,7 +45,9 @@ AssistantAbstractView {
anchors.left: loader.left
onClicked: {
+ var displayNameBackup = assistantModel.displayName
assistantModel.reset()
+ assistantModel.displayName = displayNameBackup
requestBlock.setText('')
if (!checked) {
diff --git a/linphone-app/ui/views/App/Main/Assistant/UseAppSipAccountWithPhoneNumber.qml b/linphone-app/ui/views/App/Main/Assistant/UseAppSipAccountWithPhoneNumber.qml
index b16fa86ea..53bf24dfc 100644
--- a/linphone-app/ui/views/App/Main/Assistant/UseAppSipAccountWithPhoneNumber.qml
+++ b/linphone-app/ui/views/App/Main/Assistant/UseAppSipAccountWithPhoneNumber.qml
@@ -15,7 +15,8 @@ Form {
label: qsTr('displayNameLabel')
TextField {
- onTextChanged: assistantModel.displayName = text
+ text: assistantModel.displayName
+ onTextChanged: if( assistantModel.displayName != text) assistantModel.displayName = text
}
}
}
@@ -50,8 +51,8 @@ Form {
id: phoneNumber
inputMethodHints: Qt.ImhDialableCharactersOnly
-
- onTextChanged: assistantModel.phoneNumber = text
+ text: assistantModel.phoneNumber
+ onTextChanged: if( assistantModel.phoneNumber != text) assistantModel.phoneNumber = text
}
}
}
diff --git a/linphone-app/ui/views/App/Main/Assistant/UseAppSipAccountWithUsername.qml b/linphone-app/ui/views/App/Main/Assistant/UseAppSipAccountWithUsername.qml
index 1ead92ffe..4fc980c2a 100644
--- a/linphone-app/ui/views/App/Main/Assistant/UseAppSipAccountWithUsername.qml
+++ b/linphone-app/ui/views/App/Main/Assistant/UseAppSipAccountWithUsername.qml
@@ -17,7 +17,8 @@ Form {
label: qsTr('displayNameLabel')
TextField {
- onTextChanged: assistantModel.displayName = text
+ text: assistantModel.displayName
+ onTextChanged: if( assistantModel.displayName != text) assistantModel.displayName = text
}
}
}
@@ -28,8 +29,8 @@ Form {
TextField {
id: username
-
- onTextChanged: assistantModel.username = text
+ text: assistantModel.username
+ onTextChanged: if( assistantModel.username != text) assistantModel.username = text
}
}
}
diff --git a/linphone-app/ui/views/App/Settings/SettingsUi.qml b/linphone-app/ui/views/App/Settings/SettingsUi.qml
index eb74d1c09..1f78d09a9 100644
--- a/linphone-app/ui/views/App/Settings/SettingsUi.qml
+++ b/linphone-app/ui/views/App/Settings/SettingsUi.qml
@@ -302,6 +302,19 @@ TabContainer {
}
}
}
+ FormGroup {
+ //: 'Max results on search' : Label for setting the max results returned by the Magic Search bar.
+ label: qsTr('magicSearchMaxResultsLabel')
+
+ NumericField {
+ minValue: 0
+ maxValue: 100000
+ step: 5
+ text: SettingsModel.magicSearchMaxResults
+
+ onEditingFinished: SettingsModel.magicSearchMaxResults = text
+ }
+ }
}
FormLine {
maxItemWidth: parent.width