Option to change the max results of the Magic Search bar.

Keep display name while changing username/phone in assistant.
Update SDK to 5.2.84
This commit is contained in:
Julien Wadel 2023-07-26 16:49:36 +02:00
parent 59ea9c69e5
commit 23297f07d4
23 changed files with 124 additions and 8 deletions

View file

@ -3697,6 +3697,11 @@ Klikněte zde: <a href="%1">%1</a>
<extracomment>&apos;Display only usernames from SIP addresses&apos; : tooltip for addresses display mode where username is only shown.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>magicSearchMaxResultsLabel</source>
<extracomment>&apos;Max results on search&apos; : Label for setting the max results returned by the Magic Search bar.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -3660,6 +3660,11 @@ Klik her: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<extracomment>&apos;Display only usernames from SIP addresses&apos; : tooltip for addresses display mode where username is only shown.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>magicSearchMaxResultsLabel</source>
<extracomment>&apos;Max results on search&apos; : Label for setting the max results returned by the Magic Search bar.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -3660,6 +3660,11 @@ Klicken Sie hier: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<extracomment>&apos;Display only usernames from SIP addresses&apos; : tooltip for addresses display mode where username is only shown.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>magicSearchMaxResultsLabel</source>
<extracomment>&apos;Max results on search&apos; : Label for setting the max results returned by the Magic Search bar.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -3685,6 +3685,11 @@ Click here: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<extracomment>&apos;Display only usernames from SIP addresses&apos; : tooltip for addresses display mode where username is only shown.</extracomment>
<translation>Display only usernames from SIP addresses</translation>
</message>
<message>
<source>magicSearchMaxResultsLabel</source>
<extracomment>&apos;Max results on search&apos; : Label for setting the max results returned by the Magic Search bar.</extracomment>
<translation>Max results on search</translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -3660,6 +3660,11 @@ Haga clic aquí: &lt;a href=&quot;%1&quot;&gt;%1 &lt;/a&gt;
<extracomment>&apos;Display only usernames from SIP addresses&apos; : tooltip for addresses display mode where username is only shown.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>magicSearchMaxResultsLabel</source>
<extracomment>&apos;Max results on search&apos; : Label for setting the max results returned by the Magic Search bar.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -3660,6 +3660,11 @@ Cliquez ici : &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<extracomment>&apos;Display only usernames from SIP addresses&apos; : tooltip for addresses display mode where username is only shown.</extracomment>
<translation>Lorsque des adresses SIP sont affichées, n&apos;afficher que les noms d&apos;utilisateurs</translation>
</message>
<message>
<source>magicSearchMaxResultsLabel</source>
<extracomment>&apos;Max results on search&apos; : Label for setting the max results returned by the Magic Search bar.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -3647,6 +3647,11 @@ Kattintson ide: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<extracomment>&apos;Display only usernames from SIP addresses&apos; : tooltip for addresses display mode where username is only shown.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>magicSearchMaxResultsLabel</source>
<extracomment>&apos;Max results on search&apos; : Label for setting the max results returned by the Magic Search bar.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -3660,6 +3660,11 @@ Clicca: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<extracomment>&apos;Display only usernames from SIP addresses&apos; : tooltip for addresses display mode where username is only shown.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>magicSearchMaxResultsLabel</source>
<extracomment>&apos;Max results on search&apos; : Label for setting the max results returned by the Magic Search bar.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -3647,6 +3647,11 @@
<extracomment>&apos;Display only usernames from SIP addresses&apos; : tooltip for addresses display mode where username is only shown.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>magicSearchMaxResultsLabel</source>
<extracomment>&apos;Max results on search&apos; : Label for setting the max results returned by the Magic Search bar.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -3673,6 +3673,11 @@ Spustelėkite čia: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<extracomment>&apos;Display only usernames from SIP addresses&apos; : tooltip for addresses display mode where username is only shown.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>magicSearchMaxResultsLabel</source>
<extracomment>&apos;Max results on search&apos; : Label for setting the max results returned by the Magic Search bar.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -3660,6 +3660,11 @@ Clique aqui: &lt;a href=&quot;%1&quot;&gt;%1 &lt;/a&gt;
<extracomment>&apos;Display only usernames from SIP addresses&apos; : tooltip for addresses display mode where username is only shown.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>magicSearchMaxResultsLabel</source>
<extracomment>&apos;Max results on search&apos; : Label for setting the max results returned by the Magic Search bar.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -3673,6 +3673,11 @@
<extracomment>&apos;Display only usernames from SIP addresses&apos; : tooltip for addresses display mode where username is only shown.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>magicSearchMaxResultsLabel</source>
<extracomment>&apos;Max results on search&apos; : Label for setting the max results returned by the Magic Search bar.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -3660,6 +3660,11 @@ Klicka här: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<extracomment>&apos;Display only usernames from SIP addresses&apos; : tooltip for addresses display mode where username is only shown.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>magicSearchMaxResultsLabel</source>
<extracomment>&apos;Max results on search&apos; : Label for setting the max results returned by the Magic Search bar.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -3647,6 +3647,11 @@ Buraya tıklayın: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<extracomment>&apos;Display only usernames from SIP addresses&apos; : tooltip for addresses display mode where username is only shown.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>magicSearchMaxResultsLabel</source>
<extracomment>&apos;Max results on search&apos; : Label for setting the max results returned by the Magic Search bar.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -3673,6 +3673,11 @@
<extracomment>&apos;Display only usernames from SIP addresses&apos; : tooltip for addresses display mode where username is only shown.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>magicSearchMaxResultsLabel</source>
<extracomment>&apos;Max results on search&apos; : Label for setting the max results returned by the Magic Search bar.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -3647,6 +3647,11 @@
<extracomment>&apos;Display only usernames from SIP addresses&apos; : tooltip for addresses display mode where username is only shown.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>magicSearchMaxResultsLabel</source>
<extracomment>&apos;Max results on search&apos; : Label for setting the max results returned by the Magic Search bar.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -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();

View file

@ -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.
// =============================================================================

View file

@ -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);

View file

@ -45,7 +45,9 @@ AssistantAbstractView {
anchors.left: loader.left
onClicked: {
var displayNameBackup = assistantModel.displayName
assistantModel.reset()
assistantModel.displayName = displayNameBackup
requestBlock.setText('')
if (!checked) {

View file

@ -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
}
}
}

View file

@ -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
}
}
}

View file

@ -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