Add version types preset for version url checker.

Fix add/edit contact icons in secure chat.
Add a dynamic width combobox that fit content text.
This commit is contained in:
Julien Wadel 2022-05-24 12:35:56 +02:00
parent 9341494850
commit 7ef7e1a564
23 changed files with 326 additions and 12 deletions

View file

@ -4,7 +4,20 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## 4.4.1 - [undefined]
## 4.4.2 - [undefined]
### Added
- Based on LinphoneSDK 5.1.34
- Add Sanitizer build.
- Version types selection for version checker.
### Fixed
- Order messages from receiving time.
- Fix H264 download URL on Linux.
- Hide Admin status in One-to-one chats.
## 4.4.1 - 2022-04-06
### Fixed
- Fix codec downloading on Windows and popup progress bar.

View file

@ -2908,6 +2908,21 @@ Klik her: <a href="%1">%1</a>
<extracomment>&apos;Show a minimal version of what to display in timeline.&apos; :</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>versionCheckTypeRelease</source>
<extracomment>&apos;Release&apos; : Keyword for an option to check the release version</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>versionCheckTypeCustom</source>
<extracomment>&apos;Custom&apos; : Keyword for an option to check the custom version</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>versionCheckTypeNightly</source>
<extracomment>&apos;Nightly&apos; : Keyword for an option to check the nightly version</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -2908,6 +2908,21 @@ Klicken Sie hier: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<extracomment>&apos;Show a minimal version of what to display in timeline.&apos; :</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>versionCheckTypeRelease</source>
<extracomment>&apos;Release&apos; : Keyword for an option to check the release version</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>versionCheckTypeCustom</source>
<extracomment>&apos;Custom&apos; : Keyword for an option to check the custom version</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>versionCheckTypeNightly</source>
<extracomment>&apos;Nightly&apos; : Keyword for an option to check the nightly version</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -2931,6 +2931,21 @@ Click here: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<extracomment>&apos;Show a minimal version of what to display in timeline.&apos; :</extracomment>
<translation>Show a minimal version of what to display in timeline.</translation>
</message>
<message>
<source>versionCheckTypeRelease</source>
<extracomment>&apos;Release&apos; : Keyword for an option to check the release version</extracomment>
<translation>Release</translation>
</message>
<message>
<source>versionCheckTypeCustom</source>
<extracomment>&apos;Custom&apos; : Keyword for an option to check the custom version</extracomment>
<translation>Custom</translation>
</message>
<message>
<source>versionCheckTypeNightly</source>
<extracomment>&apos;Nightly&apos; : Keyword for an option to check the nightly version</extracomment>
<translation>Nightly</translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -2908,6 +2908,21 @@ Haga clic aquí: &lt;a href=&quot;%1&quot;&gt;%1 &lt;/a&gt;
<extracomment>&apos;Show a minimal version of what to display in timeline.&apos; :</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>versionCheckTypeRelease</source>
<extracomment>&apos;Release&apos; : Keyword for an option to check the release version</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>versionCheckTypeCustom</source>
<extracomment>&apos;Custom&apos; : Keyword for an option to check the custom version</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>versionCheckTypeNightly</source>
<extracomment>&apos;Nightly&apos; : Keyword for an option to check the nightly version</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -2908,6 +2908,21 @@ Cliquez ici : &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<extracomment>&apos;Show a minimal version of what to display in timeline.&apos; :</extracomment>
<translation>Afficher une version minimaliste dans la zone de recherche des chronologies.</translation>
</message>
<message>
<source>versionCheckTypeRelease</source>
<extracomment>&apos;Release&apos; : Keyword for an option to check the release version</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>versionCheckTypeCustom</source>
<extracomment>&apos;Custom&apos; : Keyword for an option to check the custom version</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>versionCheckTypeNightly</source>
<extracomment>&apos;Nightly&apos; : Keyword for an option to check the nightly version</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -2896,6 +2896,21 @@ Kattintson ide: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<extracomment>&apos;Show a minimal version of what to display in timeline.&apos; :</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>versionCheckTypeRelease</source>
<extracomment>&apos;Release&apos; : Keyword for an option to check the release version</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>versionCheckTypeCustom</source>
<extracomment>&apos;Custom&apos; : Keyword for an option to check the custom version</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>versionCheckTypeNightly</source>
<extracomment>&apos;Nightly&apos; : Keyword for an option to check the nightly version</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -2908,6 +2908,21 @@ Clicca: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<extracomment>&apos;Show a minimal version of what to display in timeline.&apos; :</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>versionCheckTypeRelease</source>
<extracomment>&apos;Release&apos; : Keyword for an option to check the release version</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>versionCheckTypeCustom</source>
<extracomment>&apos;Custom&apos; : Keyword for an option to check the custom version</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>versionCheckTypeNightly</source>
<extracomment>&apos;Nightly&apos; : Keyword for an option to check the nightly version</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -2896,6 +2896,21 @@
<extracomment>&apos;Show a minimal version of what to display in timeline.&apos; :</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>versionCheckTypeRelease</source>
<extracomment>&apos;Release&apos; : Keyword for an option to check the release version</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>versionCheckTypeCustom</source>
<extracomment>&apos;Custom&apos; : Keyword for an option to check the custom version</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>versionCheckTypeNightly</source>
<extracomment>&apos;Nightly&apos; : Keyword for an option to check the nightly version</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -2920,6 +2920,21 @@ Spustelėkite čia: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<extracomment>&apos;Show a minimal version of what to display in timeline.&apos; :</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>versionCheckTypeRelease</source>
<extracomment>&apos;Release&apos; : Keyword for an option to check the release version</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>versionCheckTypeCustom</source>
<extracomment>&apos;Custom&apos; : Keyword for an option to check the custom version</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>versionCheckTypeNightly</source>
<extracomment>&apos;Nightly&apos; : Keyword for an option to check the nightly version</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -2908,6 +2908,21 @@ Clique aqui: &lt;a href=&quot;%1&quot;&gt;%1 &lt;/a&gt;
<extracomment>&apos;Show a minimal version of what to display in timeline.&apos; :</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>versionCheckTypeRelease</source>
<extracomment>&apos;Release&apos; : Keyword for an option to check the release version</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>versionCheckTypeCustom</source>
<extracomment>&apos;Custom&apos; : Keyword for an option to check the custom version</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>versionCheckTypeNightly</source>
<extracomment>&apos;Nightly&apos; : Keyword for an option to check the nightly version</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -2920,6 +2920,21 @@
<extracomment>&apos;Show a minimal version of what to display in timeline.&apos; :</extracomment>
<translation>Показать минимальную версию того, что нужно отображать на временной шкале.</translation>
</message>
<message>
<source>versionCheckTypeRelease</source>
<extracomment>&apos;Release&apos; : Keyword for an option to check the release version</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>versionCheckTypeCustom</source>
<extracomment>&apos;Custom&apos; : Keyword for an option to check the custom version</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>versionCheckTypeNightly</source>
<extracomment>&apos;Nightly&apos; : Keyword for an option to check the nightly version</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -2908,6 +2908,21 @@ Klicka här: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<extracomment>&apos;Show a minimal version of what to display in timeline.&apos; :</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>versionCheckTypeRelease</source>
<extracomment>&apos;Release&apos; : Keyword for an option to check the release version</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>versionCheckTypeCustom</source>
<extracomment>&apos;Custom&apos; : Keyword for an option to check the custom version</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>versionCheckTypeNightly</source>
<extracomment>&apos;Nightly&apos; : Keyword for an option to check the nightly version</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -2896,6 +2896,21 @@ Buraya tıklayın: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<extracomment>&apos;Show a minimal version of what to display in timeline.&apos; :</extracomment>
<translation>Zaman çizelgesinde sunulacakların kısa sürümünü göster.</translation>
</message>
<message>
<source>versionCheckTypeRelease</source>
<extracomment>&apos;Release&apos; : Keyword for an option to check the release version</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>versionCheckTypeCustom</source>
<extracomment>&apos;Custom&apos; : Keyword for an option to check the custom version</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>versionCheckTypeNightly</source>
<extracomment>&apos;Nightly&apos; : Keyword for an option to check the nightly version</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -2920,6 +2920,21 @@
<extracomment>&apos;Show a minimal version of what to display in timeline.&apos; :</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>versionCheckTypeRelease</source>
<extracomment>&apos;Release&apos; : Keyword for an option to check the release version</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>versionCheckTypeCustom</source>
<extracomment>&apos;Custom&apos; : Keyword for an option to check the custom version</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>versionCheckTypeNightly</source>
<extracomment>&apos;Nightly&apos; : Keyword for an option to check the nightly version</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -2896,6 +2896,21 @@
<extracomment>&apos;Show a minimal version of what to display in timeline.&apos; :</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>versionCheckTypeRelease</source>
<extracomment>&apos;Release&apos; : Keyword for an option to check the release version</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>versionCheckTypeCustom</source>
<extracomment>&apos;Custom&apos; : Keyword for an option to check the custom version</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>versionCheckTypeNightly</source>
<extracomment>&apos;Nightly&apos; : Keyword for an option to check the nightly version</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsVideo</name>

View file

@ -1384,13 +1384,42 @@ void SettingsModel::setCheckForUpdateEnabled(bool enable){
}
QString SettingsModel::getVersionCheckUrl() const{
return Utils::coreStringToAppString(mConfig->getString("misc", "version_check_url_root", Constants::VersionCheckUrl));
return Utils::coreStringToAppString(mConfig->getString("misc", "version_check_url_root", Constants::VersionCheckReleaseUrl));
}
void SettingsModel::setVersionCheckUrl(const QString& url){
mConfig->setString("misc", "version_check_url_root", Utils::appStringToCoreString(url));
emit versionCheckUrlChanged();
if( url != getVersionCheckUrl()){
mConfig->setString("misc", "version_check_url_root", Utils::appStringToCoreString(url));
if( url == Constants::VersionCheckReleaseUrl)
setVersionCheckType(VersionCheckType_Release);
else if( url == Constants::VersionCheckNightlyUrl)
setVersionCheckType(VersionCheckType_Nightly);
else
setVersionCheckType(VersionCheckType_Custom);
emit versionCheckUrlChanged();
}
}
SettingsModel::VersionCheckType SettingsModel::getVersionCheckType() const{
return (SettingsModel::VersionCheckType) mConfig->getInt(UiSection, "version_check_type", (int)VersionCheckType_Release);
}
void SettingsModel::setVersionCheckType(const VersionCheckType& type){
if( type != getVersionCheckType()){
mConfig->setInt(UiSection, "version_check_type", (int)type);
switch(type){
case VersionCheckType_Release : setVersionCheckUrl(Constants::VersionCheckReleaseUrl); break;
case VersionCheckType_Nightly : setVersionCheckUrl(Constants::VersionCheckNightlyUrl);break;
case VersionCheckType_Custom : break;// Do not override URL
}
emit versionCheckTypeChanged();
}
}
bool SettingsModel::haveVersionNightlyUrl()const{
return QString(Constants::VersionCheckNightlyUrl) != "";
}
// -----------------------------------------------------------------------------
bool SettingsModel::getShowLocalSipAccount()const{

View file

@ -192,6 +192,7 @@ class SettingsModel : public QObject {
Q_PROPERTY(bool exitOnClose READ getExitOnClose WRITE setExitOnClose NOTIFY exitOnCloseChanged)
Q_PROPERTY(bool checkForUpdateEnabled READ isCheckForUpdateEnabled WRITE setCheckForUpdateEnabled NOTIFY checkForUpdateEnabledChanged)
Q_PROPERTY(QString versionCheckUrl READ getVersionCheckUrl WRITE setVersionCheckUrl NOTIFY versionCheckUrlChanged)
Q_PROPERTY(VersionCheckType versionCheckType READ getVersionCheckType WRITE setVersionCheckType NOTIFY versionCheckTypeChanged)
Q_PROPERTY(bool showLocalSipAccount READ getShowLocalSipAccount CONSTANT)
Q_PROPERTY(bool showStartChatButton READ getShowStartChatButton CONSTANT)
@ -220,6 +221,13 @@ public:
};
Q_ENUM(MediaEncryption)
enum VersionCheckType {
VersionCheckType_Release,
VersionCheckType_Nightly,
VersionCheckType_Custom
};
Q_ENUM(VersionCheckType);
SettingsModel (QObject *parent = Q_NULLPTR);
virtual ~SettingsModel ();
@ -515,6 +523,10 @@ public:
QString getVersionCheckUrl() const;
void setVersionCheckUrl(const QString& url);
VersionCheckType getVersionCheckType() const;
void setVersionCheckType(const VersionCheckType& type);
Q_INVOKABLE bool haveVersionNightlyUrl()const;
Q_INVOKABLE bool getShowLocalSipAccount () const;
Q_INVOKABLE bool getShowStartChatButton () const;
@ -712,6 +724,7 @@ signals:
void checkForUpdateEnabledChanged();
void versionCheckUrlChanged();
void versionCheckTypeChanged();
// Advanced. -----------------------------------------------------------------

View file

@ -105,7 +105,8 @@ constexpr char Constants::DefaultContactParameters[];
constexpr char Constants::DefaultContactParametersOnRemove[];
constexpr int Constants::DefaultExpires;
constexpr char Constants::DownloadUrl[];
constexpr char Constants::VersionCheckUrl[];
constexpr char Constants::VersionCheckReleaseUrl[];
constexpr char Constants::VersionCheckNightlyUrl[];
constexpr char Constants::PasswordRecoveryUrl[];
constexpr char Constants::CguUrl[];
constexpr char Constants::PrivatePolicyUrl[];

View file

@ -55,7 +55,8 @@ public:
static constexpr char DefaultContactParametersOnRemove[] = "message-expires=0";
static constexpr int DefaultExpires = 3600;
static constexpr char DownloadUrl[] = "https://www.linphone.org/technical-corner/linphone";
static constexpr char VersionCheckUrl[] = "https://linphone.org/releases";
static constexpr char VersionCheckReleaseUrl[] = "https://download.linphone.org/releases";
static constexpr char VersionCheckNightlyUrl[] = "https://download.linphone.org/snapshots";
static constexpr char PasswordRecoveryUrl[] = "https://subscribe.linphone.org/login";
static constexpr char CguUrl[] = "https://www.linphone.org/general-terms";
static constexpr char PrivatePolicyUrl[] = "https://www.linphone.org/privacy-policy";

View file

@ -25,6 +25,7 @@ Controls.ComboBox {
property int maxPopupHeight : rootItem ? rootItem.height : 400
property int selectionWidth: width
property int fitWidth: contentItem.fitWidth + ComboBoxStyle.indicator.dropDown.iconSize
clip: true
// ---------------------------------------------------------------------------
@ -48,6 +49,7 @@ Controls.ComboBox {
// ---------------------------------------------------------------------------
contentItem: Item {
property int fitWidth: contentText.implicitWidth + ComboBoxStyle.contentItem.iconSize + contentLayout.anchors.leftMargin
height: comboBox.height
width: comboBox.selectionWidth
clip: true
@ -67,6 +69,7 @@ Controls.ComboBox {
}
Text {
id: contentText
Layout.fillWidth: true
color: comboBox.foregroundColor

View file

@ -29,14 +29,15 @@ ColumnLayout {
property ChatRoomModel chatRoomModel
property string peerAddress : chatRoomModel?chatRoomModel.getPeerAddress() : defaultPeerAddress
property string peerAddress : getPeerAddress()
property string localAddress : chatRoomModel?chatRoomModel.getLocalAddress() : defaultLocalAddress
property string fullPeerAddress : chatRoomModel?chatRoomModel.getFullPeerAddress() : defaultFullPeerAddress
property string fullPeerAddress : getFullPeerAddress()
property string fullLocalAddress : chatRoomModel?chatRoomModel.getFullLocalAddress() : defaultFullLocalAddress
property int securityLevel : chatRoomModel ? chatRoomModel.securityLevel : 1
property var _sipAddressObserver: SipAddressesModel.getSipAddressObserver((fullPeerAddress?fullPeerAddress:peerAddress), (fullLocalAddress?fullLocalAddress:localAddress))
property SipAddressObserver _sipAddressObserver: SipAddressesModel.getSipAddressObserver((fullPeerAddress?fullPeerAddress:peerAddress), (fullLocalAddress?fullLocalAddress:localAddress))
property bool haveMoreThanOneParticipants: chatRoomModel ? chatRoomModel.participants.count > 2 : false
property bool haveLessThanMinParticipantsForCall: chatRoomModel ? chatRoomModel.participants.count <= 5 : false
@ -48,7 +49,18 @@ ColumnLayout {
return chatRoomModel.sipAddress;
}
}else {
return conversation.fullPeerAddress || conversation.peerAddress || '';
return defaultPeerAddress
}
}
function getFullPeerAddress() {
if(chatRoomModel) {
if(chatRoomModel.groupEnabled || chatRoomModel.isSecure()) {
return chatRoomModel.participants.addressesToString;
}else {
return chatRoomModel.sipAddress;
}
}else {
return defaultFullPeerAddress;
}
}
@ -313,7 +325,7 @@ ColumnLayout {
visible: SettingsModel.contactsEnabled && !conversation.chatRoomModel.groupEnabled
onClicked: window.setView('ContactEdit', {
sipAddress: conversation.getPeerAddress()
sipAddress: conversation.getFullPeerAddress()
})
tooltipText: Logic.getEditTooltipText()
}

View file

@ -242,7 +242,7 @@ TabContainer {
FormGroup {
//: 'Check for updates' : Label switch for enabling check for updates
label: qsTr('checkForUpdateLabel')
maxWidth: 3*parent.width/2
RowLayout{
Switch {
checked: SettingsModel.checkForUpdateEnabled
@ -255,6 +255,23 @@ TabContainer {
onEditingFinished: SettingsModel.versionCheckUrl = text
}
ComboBox{
Layout.preferredWidth: fitWidth
Layout.leftMargin: 10
//: 'Release' : Keyword for an option to check the release version
model: [qsTr('versionCheckTypeRelease'),
//: 'Nightly' : Keyword for an option to check the nightly version
qsTr('versionCheckTypeNightly'),
//: 'Custom' : Keyword for an option to check the custom version
qsTr('versionCheckTypeCustom')]
visible: SettingsModel.haveVersionNightlyUrl()
currentIndex: SettingsModel.versionCheckType == SettingsModel.VersionCheckType_Release ? 0
: SettingsModel.versionCheckType == SettingsModel.VersionCheckType_Nightly ? 1
: 2
onActivated: SettingsModel.versionCheckType = ( currentIndex == 0 ? SettingsModel.VersionCheckType_Release
: currentIndex == 1 ? SettingsModel.VersionCheckType_Nightly
: SettingsModel.VersionCheckType_Custom)
}
}
}
}