- Add an hidden option to activate ephemeral on chat creation (create_ephemeral_chat_rooms=<seconds>)

- Add a placeholder in contacts for display name and resize empty box to placeholder size.
- Fix account name alignment.
- Hide records menu if option has been deactivated.
This commit is contained in:
Julien Wadel 2023-07-27 14:03:05 +02:00
parent 73a3478e21
commit bbae9ecb4c
24 changed files with 117 additions and 7 deletions

View file

@ -1008,6 +1008,11 @@
<extracomment>&apos;USERNAME(S)&apos; : label for sip accounts when only username is displayed n contact</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>displayName</source>
<extracomment>&apos;Display Name&apos; : placeholder for setting display name on a contact</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Contacts</name>

View file

@ -1003,6 +1003,11 @@ Server url ikke konfigureret.</translation>
<extracomment>&apos;USERNAME(S)&apos; : label for sip accounts when only username is displayed n contact</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>displayName</source>
<extracomment>&apos;Display Name&apos; : placeholder for setting display name on a contact</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Contacts</name>

View file

@ -625,7 +625,7 @@ Server URL ist nicht konfiguriert.</translation>
<message>
<source>icsCancelledMeetingInvite</source>
<extracomment>&apos;Meeting has been cancelled&apos; : ICS title for a cancelled invitation.</extracomment>
<translation type="unfinished"></translation>
<translation type="unfinished">Das Treffen wurde storniert</translation>
</message>
</context>
<context>
@ -1003,6 +1003,11 @@ Server URL ist nicht konfiguriert.</translation>
<extracomment>&apos;USERNAME(S)&apos; : label for sip accounts when only username is displayed n contact</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>displayName</source>
<extracomment>&apos;Display Name&apos; : placeholder for setting display name on a contact</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Contacts</name>

View file

@ -1003,6 +1003,11 @@ Server URL not configured.</translation>
<extracomment>&apos;USERNAME(S)&apos; : label for sip accounts when only username is displayed n contact</extracomment>
<translation>USERNAME(S)</translation>
</message>
<message>
<source>displayName</source>
<extracomment>&apos;Display Name&apos; : placeholder for setting display name on a contact</extracomment>
<translation>Display Name</translation>
</message>
</context>
<context>
<name>Contacts</name>

View file

@ -1003,6 +1003,11 @@ URL del servidor no configurada.</translation>
<extracomment>&apos;USERNAME(S)&apos; : label for sip accounts when only username is displayed n contact</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>displayName</source>
<extracomment>&apos;Display Name&apos; : placeholder for setting display name on a contact</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Contacts</name>

View file

@ -1003,6 +1003,11 @@ URL du serveur non configurée.</translation>
<extracomment>&apos;USERNAME(S)&apos; : label for sip accounts when only username is displayed n contact</extracomment>
<translation>Nom(s) d&apos;utilisateur</translation>
</message>
<message>
<source>displayName</source>
<extracomment>&apos;Display Name&apos; : placeholder for setting display name on a contact</extracomment>
<translation>Nom d&apos;affichage</translation>
</message>
</context>
<context>
<name>Contacts</name>

View file

@ -997,6 +997,11 @@ A kiszolgáló URL-je nincs konfigurálva.</translation>
<extracomment>&apos;USERNAME(S)&apos; : label for sip accounts when only username is displayed n contact</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>displayName</source>
<extracomment>&apos;Display Name&apos; : placeholder for setting display name on a contact</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Contacts</name>

View file

@ -1003,6 +1003,11 @@ URL del server non configurato.</translation>
<extracomment>&apos;USERNAME(S)&apos; : label for sip accounts when only username is displayed n contact</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>displayName</source>
<extracomment>&apos;Display Name&apos; : placeholder for setting display name on a contact</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Contacts</name>

View file

@ -997,6 +997,11 @@
<extracomment>&apos;USERNAME(S)&apos; : label for sip accounts when only username is displayed n contact</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>displayName</source>
<extracomment>&apos;Display Name&apos; : placeholder for setting display name on a contact</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Contacts</name>

View file

@ -1009,6 +1009,11 @@ Nesukonfigūruotas serverio url.</translation>
<extracomment>&apos;USERNAME(S)&apos; : label for sip accounts when only username is displayed n contact</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>displayName</source>
<extracomment>&apos;Display Name&apos; : placeholder for setting display name on a contact</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Contacts</name>

View file

@ -1003,6 +1003,11 @@ URL do servidor não configurado.</translation>
<extracomment>&apos;USERNAME(S)&apos; : label for sip accounts when only username is displayed n contact</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>displayName</source>
<extracomment>&apos;Display Name&apos; : placeholder for setting display name on a contact</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Contacts</name>

View file

@ -1009,6 +1009,11 @@
<extracomment>&apos;USERNAME(S)&apos; : label for sip accounts when only username is displayed n contact</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>displayName</source>
<extracomment>&apos;Display Name&apos; : placeholder for setting display name on a contact</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Contacts</name>

View file

@ -1003,6 +1003,11 @@ Serverwebbadressen är inte konfigurerad.</translation>
<extracomment>&apos;USERNAME(S)&apos; : label for sip accounts when only username is displayed n contact</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>displayName</source>
<extracomment>&apos;Display Name&apos; : placeholder for setting display name on a contact</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Contacts</name>

View file

@ -997,6 +997,11 @@ Sunucu url&apos;si yapılandırılmadı.</translation>
<extracomment>&apos;USERNAME(S)&apos; : label for sip accounts when only username is displayed n contact</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>displayName</source>
<extracomment>&apos;Display Name&apos; : placeholder for setting display name on a contact</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Contacts</name>

View file

@ -1009,6 +1009,11 @@
<extracomment>&apos;USERNAME(S)&apos; : label for sip accounts when only username is displayed n contact</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>displayName</source>
<extracomment>&apos;Display Name&apos; : placeholder for setting display name on a contact</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Contacts</name>

View file

@ -997,6 +997,11 @@
<extracomment>&apos;USERNAME(S)&apos; : label for sip accounts when only username is displayed n contact</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>displayName</source>
<extracomment>&apos;Display Name&apos; : placeholder for setting display name on a contact</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Contacts</name>

View file

@ -260,6 +260,9 @@ bool CallsListModel::createSecureChat (const QString& subject, const QString &pa
std::list <shared_ptr<linphone::Address> > participants;
std::shared_ptr<const linphone::Address> localAddress;
participants.push_back(address);
int ephemeralTime = CoreManager::getInstance()->getSettingsModel()->getCreateEphemeralChatRooms();
if(ephemeralTime>0)
params->setEphemeralLifetime(ephemeralTime);
params->enableEncryption(true);
params->setSubject(Utils::appStringToCoreString(subject));
@ -268,6 +271,8 @@ bool CallsListModel::createSecureChat (const QString& subject, const QString &pa
qInfo() << "Create secure ChatRoom: " << subject << ", from " << QString::fromStdString(localAddress->asString()) << " and with " <<participantAddress;;
std::shared_ptr<linphone::ChatRoom> chatRoom = core->createChatRoom(params, localAddress, participants);
if(chatRoom)
chatRoom->enableEphemeral(ephemeralTime>0);
// Still needed?
// if( chatRoom != nullptr){
// auto timelineList = CoreManager::getInstance()->getTimelineListModel();
@ -318,6 +323,9 @@ QVariantMap CallsListModel::createChatRoom(const QString& subject, const int& se
qWarning() << "Failed to add participant to conference, bad address : " << (participant ? participant->getSipAddress() : p.toString());
}
params->enableEncryption(securityLevel>0);
int ephemeralTime = CoreManager::getInstance()->getSettingsModel()->getCreateEphemeralChatRooms();
if(securityLevel > 0 && ephemeralTime>0)
params->setEphemeralLifetime(ephemeralTime);
if( securityLevel<=0)
params->setBackend(linphone::ChatRoomBackend::Basic);
@ -365,6 +373,8 @@ QVariantMap CallsListModel::createChatRoom(const QString& subject, const int& se
}
if( !chatRoom)
qWarning() << "Chat room cannot be created";
else if(securityLevel > 0)
chatRoom->enableEphemeral(ephemeralTime>0);
result["created"] = (chatRoom != nullptr);
return result;

View file

@ -1140,6 +1140,17 @@ void SettingsModel::setContactsEnabled (bool status) {
int SettingsModel::getIncomingCallTimeout() const {
return CoreManager::getInstance()->getCore()->getIncTimeout();
}
int SettingsModel::getCreateEphemeralChatRooms() const{
return mConfig->getInt(UiSection, "create_ephemeral_chat_rooms", 0);
}
void SettingsModel::setCreateEphemeralChatRooms(int seconds) {
if(!isReadOnly(UiSection, "create_ephemeral_chat_rooms"))
mConfig->setInt(UiSection, "create_ephemeral_chat_rooms", seconds);
emit createEphemeralsChatRoomsChanged();
}
// =============================================================================
// Network.
// =============================================================================

View file

@ -501,6 +501,9 @@ public:
int getIncomingCallTimeout() const;
int getCreateEphemeralChatRooms() const;
void setCreateEphemeralChatRooms(int seconds);// <=0 deactivate
// Network. ------------------------------------------------------------------
bool getShowNetworkSettings () const;
@ -594,7 +597,7 @@ public:
void setDownloadFolder (const QString &folder);
QString getRemoteProvisioningRootUrl() const;
QString getRemoteProvisioning () const;
Q_INVOKABLE QString getRemoteProvisioning () const;
void setRemoteProvisioning (const QString &remoteProvisioning);
Q_INVOKABLE bool isQRCodeAvailable() const;
@ -804,6 +807,8 @@ signals:
void contactsEnabledChanged (bool status);
void createEphemeralsChatRoomsChanged();
// Network. ------------------------------------------------------------------
void showNetworkSettingsChanged (bool status);

View file

@ -40,7 +40,7 @@ Item {
'transparent'
height: parent.height
width: {
var width = textInput.contentWidth + parent.padding * 2
var width = Math.max(textInput.contentWidth, placeholder.contentWidth) + parent.padding * 2
return width < parent.width ? width : parent.width
}

View file

@ -70,7 +70,7 @@ Item {
Text {
id:username
Layout.fillWidth: true
Layout.preferredHeight: accountStatus.noAccountConfigured ? -1 : parent.height / 2
Layout.preferredHeight: accountStatus.noAccountConfigured ? -1 : subtitle.visible ? parent.height / 2 : parent.height
Layout.alignment: !subtitle.visible ? Qt.AlignVCenter | Qt.AlignLeft : Qt.AlignBottom | Qt.AlignLeft
color: AccountStatusStyle.username.colorModel.color
elide: Text.ElideRight
@ -78,7 +78,7 @@ Item {
font.pointSize: AccountStatusStyle.username.pointSize
//: 'No account configured' : Status text when there is no configured account.
text: accountStatus.noAccountConfigured ? qsTr('noAccount'): AccountSettingsModel.username
verticalAlignment: Text.AlignBottom
verticalAlignment: subtitle.visible ? Text.AlignBottom : Text.AlignVCenter
wrapMode: Text.WordWrap
maximumLineCount: 3
}
@ -106,7 +106,7 @@ Item {
Text {
id: subtitle
Layout.preferredHeight:parent.height / 2
Layout.preferredHeight: visible ? parent.height / 2 : 0
Layout.preferredWidth:parent.width
visible: !accountStatus.noAccountConfigured && text != username.text
color: AccountStatusStyle.sipAddress.colorModel.color

View file

@ -133,6 +133,8 @@ ColumnLayout {
forceFocus: true
readOnly: !_edition
text: avatar.username
//: 'Display Name' : placeholder for setting display name on a contact
placeholder: qsTr('displayName')
font.family: SettingsModel.textMessageFont.family
onEditingFinished: Logic.setUsername(text)

View file

@ -57,7 +57,7 @@ Item {
Shortcut {
id: recordingsShortcut
onActivated: menuParent.displayRecordings()
onActivated: if(SettingsModel.callRecorderEnabled) menuParent.displayRecordings()
}
// ---------------------------------------------------------------------------
@ -75,6 +75,7 @@ Item {
}
MenuItem{
visible: SettingsModel.callRecorderEnabled
//: 'Recordings' : Label for the recordings menu.
text: qsTr('recordings')
onTriggered: recordingsShortcut.onActivated()

View file

@ -28,6 +28,7 @@ MenuBar {
}
MenuItem {
visible: SettingsModel.callRecorderEnabled
//: 'Recordings' : Label for the recordings menu.
text: qsTr('recordings')
role: MenuItem.ApplicationSpecificRole