From 1397e483b3a84b6cd4e57b0c319baf19dcc786f1 Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Wed, 4 Aug 2021 09:04:26 +0200 Subject: [PATCH] Imdn fix + text to speech debug feedback --- linphone-app/src/app/App.cpp | 2 +- .../components/chat-room/ChatRoomModel.cpp | 8 + .../components/chat-room/ChatRoomModel.hpp | 5 +- .../other/text-to-speech/TextToSpeech.cpp | 46 +++-- .../other/text-to-speech/TextToSpeech.hpp | 31 ++-- .../ParticipantImdnStateListModel.cpp | 4 +- .../ParticipantImdnStateListModel.hpp | 1 + .../ParticipantImdnStateProxyModel.cpp | 12 +- .../ParticipantImdnStateProxyModel.hpp | 7 +- .../modules/Common/Form/Fields/TextField.qml | 4 + .../Styles/Form/Fields/TextFieldStyle.qml | 29 +++ .../ui/modules/Linphone/Chat/Message.qml | 23 +-- .../Linphone/Contact/ContactDescription.qml | 11 ++ .../App/Calls/Dialogs/CallSipAddress.qml | 156 ++++++++-------- .../ui/views/App/Main/Conversation.qml | 173 ++++++++++-------- linphone-app/ui/views/App/Main/MainWindow.qml | 3 +- 16 files changed, 315 insertions(+), 200 deletions(-) diff --git a/linphone-app/src/app/App.cpp b/linphone-app/src/app/App.cpp index c378af506..4924f141f 100644 --- a/linphone-app/src/app/App.cpp +++ b/linphone-app/src/app/App.cpp @@ -617,6 +617,7 @@ void App::registerTypes () { registerType("FileExtractor"); registerType("HistoryProxyModel"); registerType("LdapProxyModel"); + registerType("ParticipantImdnStateProxyModel"); registerType("SipAddressesProxyModel"); registerType("SearchSipAddressesModel"); registerType("SearchSipAddressesProxyModel"); @@ -660,7 +661,6 @@ void App::registerTypes () { registerUncreatableType("ParticipantDeviceProxyModel"); registerUncreatableType("ParticipantImdnStateModel"); registerUncreatableType("ParticipantImdnStateListModel"); - registerUncreatableType("ParticipantImdnStateProxyModel"); diff --git a/linphone-app/src/components/chat-room/ChatRoomModel.cpp b/linphone-app/src/components/chat-room/ChatRoomModel.cpp index 45700dbec..b309742fa 100644 --- a/linphone-app/src/components/chat-room/ChatRoomModel.cpp +++ b/linphone-app/src/components/chat-room/ChatRoomModel.cpp @@ -377,6 +377,13 @@ QList ChatRoomModel::getComposers(){ //------------------------------------------------------------------------------------------------ +void ChatRoomModel::setSubject(QString& subject){ + if(mChatRoom && getSubject() != subject){ + mChatRoom->setSubject(Utils::appStringToCoreString(subject)); + emit subjectChanged(subject); + } +} + void ChatRoomModel::setLastUpdateTime(const QDateTime& lastUpdateDate) { if(mLastUpdateTime != lastUpdateDate ) { mLastUpdateTime = lastUpdateDate; @@ -822,5 +829,6 @@ void ChatRoomModel::onChatMessageShouldBeStored(const std::shared_ptr & chatRoom, const std::shared_ptr & message, const std::shared_ptr & state){ + qWarning() << "ChatRoom Imdn received :" << (state->getParticipant() != nullptr); } diff --git a/linphone-app/src/components/chat-room/ChatRoomModel.hpp b/linphone-app/src/components/chat-room/ChatRoomModel.hpp index f43f0b3c9..1de4218be 100644 --- a/linphone-app/src/components/chat-room/ChatRoomModel.hpp +++ b/linphone-app/src/components/chat-room/ChatRoomModel.hpp @@ -57,7 +57,7 @@ public: //Q_PROPERTY(QString participants READ getParticipants NOTIFY participantsChanged); //Q_PROPERTY(ParticipantProxyModel participants READ getParticipants NOTIFY participantsChanged); - Q_PROPERTY(QString subject READ getSubject NOTIFY subjectChanged) + Q_PROPERTY(QString subject READ getSubject WRITE setSubject NOTIFY subjectChanged) Q_PROPERTY(QDateTime lastUpdateTime MEMBER mLastUpdateTime WRITE setLastUpdateTime NOTIFY lastUpdateTimeChanged) Q_PROPERTY(int unreadMessagesCount MEMBER mUnreadMessagesCount WRITE setUnreadMessagesCount NOTIFY unreadMessagesCountChanged) Q_PROPERTY(int missedCallsCount MEMBER mMissedCallsCount WRITE setMissedCallsCount NOTIFY missedCallsCountChanged) @@ -130,7 +130,8 @@ public: std::shared_ptr getChatRoom(); QList getComposers(); -//---- Setters +//---- Setters + void setSubject(QString& subject); void setLastUpdateTime(const QDateTime& lastUpdateDate); void setUnreadMessagesCount(const int& count); diff --git a/linphone-app/src/components/other/text-to-speech/TextToSpeech.cpp b/linphone-app/src/components/other/text-to-speech/TextToSpeech.cpp index 23d2e211e..22e37a1d7 100644 --- a/linphone-app/src/components/other/text-to-speech/TextToSpeech.cpp +++ b/linphone-app/src/components/other/text-to-speech/TextToSpeech.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2020 Belledonne Communications SARL. + * Copyright (c) 2010-2021 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org). @@ -19,33 +19,47 @@ */ #ifdef TEXTTOSPEECH_ENABLED - #include +#include +#include #endif // ifdef TEXTTOSPEECH_ENABLED #include "TextToSpeech.hpp" +#include + // ============================================================================= #ifdef TEXTTOSPEECH_ENABLED - TextToSpeech::TextToSpeech (QObject *parent) : QObject(parent) { - mQtTextToSpeech = new QTextToSpeech(this); - } +TextToSpeech::TextToSpeech (QObject *parent) : QObject(parent) { + mQtTextToSpeech = new QTextToSpeech(this); + connect(mQtTextToSpeech, &QTextToSpeech::stateChanged, this, &TextToSpeech::onStateChanged); +} - void TextToSpeech::say (const QString &text) { - mQtTextToSpeech->say(text); - } +void TextToSpeech::say (const QString &text) { + if(mQtTextToSpeech->volume() == 0.0) + mQtTextToSpeech->setVolume(1.0); + QStringList names; + for(auto i : mQtTextToSpeech->availableVoices()) + names << i.name(); + qInfo() << "Speech request : Volume " << mQtTextToSpeech->volume() << "; voices: " << names.join(",") << "; Engines: " << QTextToSpeech::availableEngines(); + mQtTextToSpeech->say(text); +} - bool TextToSpeech::available () const { - return true; - } +bool TextToSpeech::available () const { + return true; +} + +void TextToSpeech::onStateChanged(QTextToSpeech::State state){ + qInfo() << "Speech Status : " << (int)state; +} #else - TextToSpeech::TextToSpeech (QObject *parent) : QObject(parent) {} +TextToSpeech::TextToSpeech (QObject *parent) : QObject(parent) {} - void TextToSpeech::say (const QString &) {} +void TextToSpeech::say (const QString &) {} - bool TextToSpeech::available () const { - return false; - } +bool TextToSpeech::available () const { + return false; +} #endif // ifdef TEXTTOSPEECH_ENABLED diff --git a/linphone-app/src/components/other/text-to-speech/TextToSpeech.hpp b/linphone-app/src/components/other/text-to-speech/TextToSpeech.hpp index 2f12cfb1f..9ad42d511 100644 --- a/linphone-app/src/components/other/text-to-speech/TextToSpeech.hpp +++ b/linphone-app/src/components/other/text-to-speech/TextToSpeech.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2020 Belledonne Communications SARL. + * Copyright (c) 2010-2021 Belledonne Communications SARL. * * This file is part of linphone-desktop * (see https://www.linphone.org). @@ -22,25 +22,32 @@ #define TEXT_TO_SPEECH_H_ #include +#ifdef TEXTTOSPEECH_ENABLED +#include +#endif // ifdef TEXTTOSPEECH_ENABLED // ============================================================================= class QTextToSpeech; class TextToSpeech : public QObject { - Q_OBJECT; - - Q_PROPERTY(bool available READ available CONSTANT); - + Q_OBJECT; + + Q_PROPERTY(bool available READ available CONSTANT); + public: - TextToSpeech (QObject *parent = Q_NULLPTR); - - Q_INVOKABLE void say (const QString &text); - + TextToSpeech (QObject *parent = Q_NULLPTR); + + Q_INVOKABLE void say (const QString &text); +#ifdef TEXTTOSPEECH_ENABLED +public slots: + void onStateChanged(QTextToSpeech::State state); +#endif + private: - bool available () const; - - QTextToSpeech *mQtTextToSpeech = nullptr; + bool available () const; + + QTextToSpeech *mQtTextToSpeech = nullptr; }; #endif // ifndef TEXT_TO_SPEECH_H_ diff --git a/linphone-app/src/components/participant-imdn/ParticipantImdnStateListModel.cpp b/linphone-app/src/components/participant-imdn/ParticipantImdnStateListModel.cpp index 4b18ae634..60c574835 100644 --- a/linphone-app/src/components/participant-imdn/ParticipantImdnStateListModel.cpp +++ b/linphone-app/src/components/participant-imdn/ParticipantImdnStateListModel.cpp @@ -76,7 +76,8 @@ void ParticipantImdnStateListModel::add(std::shared_ptr imdn); diff --git a/linphone-app/src/components/participant-imdn/ParticipantImdnStateProxyModel.cpp b/linphone-app/src/components/participant-imdn/ParticipantImdnStateProxyModel.cpp index d82842e0a..c1c966b24 100644 --- a/linphone-app/src/components/participant-imdn/ParticipantImdnStateProxyModel.cpp +++ b/linphone-app/src/components/participant-imdn/ParticipantImdnStateProxyModel.cpp @@ -52,7 +52,17 @@ bool ParticipantImdnStateProxyModel::lessThan (const QModelIndex &left, const QM || (imdnA->getState() == imdnB->getState() && imdnA->getStateChangeTime() < imdnB->getStateChangeTime()); } //--------------------------------------------------------------------------------- +int ParticipantImdnStateProxyModel::getCount(){ + return rowCount(); +} void ParticipantImdnStateProxyModel::setChatMessageModel(ChatMessageModel * message){ - setSourceModel(message->getParticipantImdnStates().get()); + ParticipantImdnStateListModel *model = static_cast(sourceModel()); + ParticipantImdnStateListModel *messageModel = message->getParticipantImdnStates().get(); + if( model != messageModel){ + setSourceModel(messageModel); + connect(messageModel, &ParticipantImdnStateListModel::countChanged, this, &ParticipantImdnStateProxyModel::countChanged); + sort(0); + emit chatMessageModelChanged(); + } } \ No newline at end of file diff --git a/linphone-app/src/components/participant-imdn/ParticipantImdnStateProxyModel.hpp b/linphone-app/src/components/participant-imdn/ParticipantImdnStateProxyModel.hpp index e0f0abff1..90d8d02d1 100644 --- a/linphone-app/src/components/participant-imdn/ParticipantImdnStateProxyModel.hpp +++ b/linphone-app/src/components/participant-imdn/ParticipantImdnStateProxyModel.hpp @@ -36,10 +36,16 @@ class ParticipantImdnStateProxyModel : public QSortFilterProxyModel { Q_OBJECT public: + Q_PROPERTY(ChatMessageModel * chatMessageModel WRITE setChatMessageModel NOTIFY chatMessageModelChanged) + Q_PROPERTY(int count READ getCount NOTIFY countChanged) ParticipantImdnStateProxyModel (QObject *parent = nullptr); void setChatMessageModel(ChatMessageModel* message); + int getCount(); +signals: + void chatMessageModelChanged(); + void countChanged(); protected: virtual bool filterAcceptsRow (int sourceRow, const QModelIndex &sourceParent) const override; virtual bool lessThan (const QModelIndex &left, const QModelIndex &right) const override; @@ -47,5 +53,4 @@ protected: std::shared_ptr mImdns; }; - #endif diff --git a/linphone-app/ui/modules/Common/Form/Fields/TextField.qml b/linphone-app/ui/modules/Common/Form/Fields/TextField.qml index 19f503ab0..41794d345 100644 --- a/linphone-app/ui/modules/Common/Form/Fields/TextField.qml +++ b/linphone-app/ui/modules/Common/Form/Fields/TextField.qml @@ -103,4 +103,8 @@ Controls.TextField { visible:error!= '' text:error } + Keys.onPressed:{ + if( event.key == Qt.Key_Escape) + focus = false + } } diff --git a/linphone-app/ui/modules/Common/Styles/Form/Fields/TextFieldStyle.qml b/linphone-app/ui/modules/Common/Styles/Form/Fields/TextFieldStyle.qml index cafd9a521..aabfd2a40 100644 --- a/linphone-app/ui/modules/Common/Styles/Form/Fields/TextFieldStyle.qml +++ b/linphone-app/ui/modules/Common/Styles/Form/Fields/TextFieldStyle.qml @@ -57,6 +57,35 @@ QtObject { } } + property QtObject text: QtObject { + property color color: Colors.d.color + property int pointSize: Units.dp * 10 + property int rightPadding: 10 + } + } + property QtObject flat : QtObject { + property QtObject background: QtObject { + property int height: 36 + property int width: 200 + + property int radius: 0 + + property QtObject border: QtObject { + property QtObject color: QtObject { + property color error: Colors.error.color + property color normal: Colors.c.color + property color selected: Colors.i.color + } + + property int width: 0 + } + + property QtObject color: QtObject { + property color normal: Colors.q.color + property color readOnly: Colors.e.color + } + } + property QtObject text: QtObject { property color color: Colors.d.color property int pointSize: Units.dp * 10 diff --git a/linphone-app/ui/modules/Linphone/Chat/Message.qml b/linphone-app/ui/modules/Linphone/Chat/Message.qml index fba910e19..393a00aeb 100644 --- a/linphone-app/ui/modules/Linphone/Chat/Message.qml +++ b/linphone-app/ui/modules/Linphone/Chat/Message.qml @@ -3,6 +3,8 @@ import QtQuick.Layouts 1.3 import Clipboard 1.0 import Common 1.0 +import Linphone 1.0 + import Common.Styles 1.0 import Linphone.Styles 1.0 import TextToSpeech 1.0 @@ -130,7 +132,7 @@ Item { iconSizeMenu: 17 iconLayoutDirection: Qt.RightToLeft menuItemStyle : MenuItemStyle.aux - visible: deliveryLayout.model.rowCount() > 0 + visible: deliveryLayout.model.count > 0 onTriggered: deliveryLayout.visible = !deliveryLayout.visible } MenuItem { @@ -140,7 +142,7 @@ Item { iconSizeMenu: 17 iconLayoutDirection: Qt.RightToLeft menuItemStyle : MenuItemStyle.auxRed - onTriggered: deliveryLayout.visible = !deliveryLayout.visible + onTriggered: removeEntry() } } @@ -179,20 +181,13 @@ Item { anchors.right:parent.right anchors.rightMargin: 50 //height: visible ? ChatStyle.composingText.height*container.proxyModel.composers.length : 0 - height: visible ? (ChatStyle.composingText.height-5)*deliveryLayout.model.rowCount() : 0 + height: visible ? (ChatStyle.composingText.height-5)*deliveryLayout.model.count : 0 cellWidth: parent.width; cellHeight: ChatStyle.composingText.height-5 visible:false - /* - property var composersLength : container.proxyModel.composers.length - onComposersLengthChanged:{ - model.clear() - console.log(container.proxyModel.composers) - for(var j = 0 ; j < container.proxyModel.composers.length ; ++j) { - console.log(container.proxyModel.composers[j]) - model.append({text:container.proxyModel.composers[j]}) - } - }*/ - model: $chatEntry.getProxyImdnStates() + model: ParticipantImdnStateProxyModel{ + id: imdnStatesModel + chatMessageModel: $chatEntry + } function getText(state){ if(state == LinphoneEnums.ChatMessageStateDelivered) //: 'Send to %1 - %2' Little message to indicate the state of a message diff --git a/linphone-app/ui/modules/Linphone/Contact/ContactDescription.qml b/linphone-app/ui/modules/Linphone/Contact/ContactDescription.qml index 9a2530fd0..2b3b6d77d 100644 --- a/linphone-app/ui/modules/Linphone/Contact/ContactDescription.qml +++ b/linphone-app/ui/modules/Linphone/Contact/ContactDescription.qml @@ -7,6 +7,7 @@ import Common 1.0 // ============================================================================= Column { + id:mainItem property alias username: username.text property string sipAddress property alias statusText : status.text @@ -23,6 +24,11 @@ Column { readonly property int statusWidth : (status.visible ? status.width + 5 : 0) + property bool usernameDoubleClickable: false + + signal usernameDoubleClicked() + + // --------------------------------------------------------------------------- @@ -51,6 +57,11 @@ Column { font.pointSize: contactDescriptionStyle.username.status.pointSize font.italic : true } + MouseArea{ + anchors.fill:parent + visible: usernameDoubleClickable + onDoubleClicked: usernameDoubleClicked() + } } Text { diff --git a/linphone-app/ui/views/App/Calls/Dialogs/CallSipAddress.qml b/linphone-app/ui/views/App/Calls/Dialogs/CallSipAddress.qml index e3ff6452a..98c19aaeb 100644 --- a/linphone-app/ui/views/App/Calls/Dialogs/CallSipAddress.qml +++ b/linphone-app/ui/views/App/Calls/Dialogs/CallSipAddress.qml @@ -9,80 +9,84 @@ import App.Styles 1.0 // ============================================================================= DialogPlus { - buttons: [ - TextButtonA { - text: qsTr('cancel') - - onClicked: exit(0) - } - ] - - buttonsAlignment: Qt.AlignCenter - descriptionText: qsTr('callSipAddressDescription') - - height: CallSipAddressStyle.height + 30 - width: CallSipAddressStyle.width - - // --------------------------------------------------------------------------- - - ColumnLayout { - anchors.fill: parent - spacing: 0 - - // ------------------------------------------------------------------------- - // Address selector. - // ------------------------------------------------------------------------- - - Item { - Layout.fillHeight: true - Layout.fillWidth: true - - ColumnLayout { - anchors.fill: parent - spacing: CallSipAddressStyle.spacing - - TextField { - id: filter - - Layout.fillWidth: true - - icon: 'search' - - onTextChanged: sipAddressesModel.setFilter(text) - } - - ScrollableListViewField { - Layout.fillHeight: true - Layout.fillWidth: true - - SipAddressesView { - anchors.fill: parent - - actions: [{ - icon: 'video_call', - handler: function (entry) { - CallsListModel.launchVideoCall(entry.sipAddress) - exit(1) - }, - visible: SettingsModel.videoSupported && SettingsModel.showStartVideoCallButton - }, { - icon: 'call', - handler: function (entry) { - CallsListModel.launchAudioCall(entry.sipAddress) - exit(1) - } - }] - - genSipAddress: filter.text - - model: SearchSipAddressesModel { - id: sipAddressesModel - } - - onEntryClicked: actions[0].handler(entry) - } - } - } - } - } + buttons: [ + TextButtonA { + text: qsTr('cancel') + + onClicked: exit(0) + } + ] + + buttonsAlignment: Qt.AlignCenter + descriptionText: qsTr('callSipAddressDescription') + + height: CallSipAddressStyle.height + 30 + width: CallSipAddressStyle.width + + // --------------------------------------------------------------------------- + + ColumnLayout { + anchors.fill: parent + spacing: 0 + + // ------------------------------------------------------------------------- + // Address selector. + // ------------------------------------------------------------------------- + + Item { + Layout.fillHeight: true + Layout.fillWidth: true + + ColumnLayout { + anchors.fill: parent + spacing: CallSipAddressStyle.spacing + + TextField { + id: filter + + Layout.fillWidth: true + + icon: 'search' + + onTextChanged: sipAddressesModel.setFilter(text) + } + + ScrollableListViewField { + Layout.fillHeight: true + Layout.fillWidth: true + + SipAddressesView { + anchors.fill: parent + + actions: [{ + icon: 'video_call', + secure:0, + visible:true, + handler: function (entry) { + CallsListModel.launchVideoCall(entry.sipAddress) + exit(1) + }, + visible: SettingsModel.videoSupported && SettingsModel.showStartVideoCallButton + }, { + icon: 'call', + secure:0, + visible:true, + handler: function (entry) { + CallsListModel.launchAudioCall(entry.sipAddress) + exit(1) + } + }] + + genSipAddress: filter.text + + model: SearchSipAddressesModel { + id: sipAddressesModel + } + + onEntryClicked: actions[0].handler(entry) + } + } + } + } + } } diff --git a/linphone-app/ui/views/App/Main/Conversation.qml b/linphone-app/ui/views/App/Main/Conversation.qml index e36ce98c3..a2d0ed001 100644 --- a/linphone-app/ui/views/App/Main/Conversation.qml +++ b/linphone-app/ui/views/App/Main/Conversation.qml @@ -83,93 +83,116 @@ ColumnLayout { iconSize: ConversationStyle.bar.groupChatSize visible: chatRoomModel.groupEnabled } - RowLayout{ + Item{ Layout.fillHeight: true Layout.fillWidth: true - spacing:0 - - ColumnLayout{ - Layout.fillHeight: true - Layout.minimumWidth: 20 - Layout.maximumWidth: contactBar.width-avatar.width-actionBar.width-3*ConversationStyle.bar.spacing - Layout.preferredWidth: contactDescription.contentWidth - spacing: 5 - Row{ - Layout.topMargin: 15 - Layout.preferredHeight: implicitHeight - Layout.alignment: Qt.AlignBottom - visible:chatRoomModel.isMeAdmin - - Icon{ - id:adminIcon - icon : 'admin_selected' - iconSize:14 - } - Text{ - anchors.verticalCenter: parent.verticalCenter - //: 'Admin' : Admin(istrator) - //~ Context One word title for describing the current admin status - text: qsTr('adminStatus') - color:"#9FA6AB" - font.pointSize: Units.dp * 8 - } - } + RowLayout{ + anchors.fill: parent + spacing:0 - ContactDescription { - id:contactDescription + ColumnLayout{ + Layout.fillHeight: true Layout.minimumWidth: 20 Layout.maximumWidth: contactBar.width-avatar.width-actionBar.width-3*ConversationStyle.bar.spacing - Layout.preferredWidth: contentWidth - Layout.preferredHeight: contentHeight - Layout.alignment: Qt.AlignTop | Qt.AlignLeft - contactDescriptionStyle: ConversationStyle.bar.contactDescription - username: avatar.username - sipAddress: { - if(chatRoomModel) { - if(chatRoomModel.groupEnabled) { - return chatRoomModel.participants.displayNamesToString(); - }else if(chatRoomModel.isSecure()) { - return chatRoomModel.participants.addressesToString(); - }else { - return chatRoomModel.sipAddress; - } - }else { - return conversation.sipAddress || conversation.fullPeerAddress || conversation.peerAddress || ''; - } + Layout.preferredWidth: contactDescription.contentWidth + spacing: 5 + Row{ + Layout.topMargin: 15 + Layout.preferredHeight: implicitHeight + Layout.alignment: Qt.AlignBottom + visible:chatRoomModel.isMeAdmin + Icon{ + id:adminIcon + icon : 'admin_selected' + iconSize:14 + } + Text{ + anchors.verticalCenter: parent.verticalCenter + //: 'Admin' : Admin(istrator) + //~ Context One word title for describing the current admin status + text: qsTr('adminStatus') + color:"#9FA6AB" + font.pointSize: Units.dp * 8 + } + } + + ContactDescription { + id:contactDescription + Layout.minimumWidth: 20 + Layout.maximumWidth: contactBar.width-avatar.width-actionBar.width-3*ConversationStyle.bar.spacing + Layout.preferredWidth: contentWidth + Layout.preferredHeight: contentHeight + Layout.alignment: Qt.AlignTop | Qt.AlignLeft + contactDescriptionStyle: ConversationStyle.bar.contactDescription + username: avatar.username + usernameDoubleClickable: chatRoomModel.isMeAdmin + sipAddress: { + if(chatRoomModel) { + if(chatRoomModel.groupEnabled) { + return chatRoomModel.participants.displayNamesToString(); + }else if(chatRoomModel.isSecure()) { + return chatRoomModel.participants.addressesToString(); + }else { + return chatRoomModel.sipAddress; + } + }else { + return conversation.sipAddress || conversation.fullPeerAddress || conversation.peerAddress || ''; + } + + } + onUsernameDoubleClicked: { + usernameEdit.visible = !usernameEdit.visible + usernameEdit.forceActiveFocus() + } + } + Item{ + Layout.fillHeight: true + Layout.fillWidth: true + visible: chatRoomModel.isMeAdmin } } - Item{ - Layout.fillHeight: true + Icon{ + Layout.alignment: Qt.AlignVCenter + visible: securityLevel != 1 + icon: securityLevel === 2?'secure_level_1': securityLevel===3? 'secure_level_2' : 'secure_level_unsafe' + iconSize:30 + MouseArea{ + anchors.fill:parent + onClicked : { + window.detachVirtualWindow() + window.attachVirtualWindow(Qt.resolvedUrl('Dialogs/InfoEncryption.qml') + ,{securityLevel:securityLevel} + , function (status) { + if(status){ + window.detachVirtualWindow() + window.attachVirtualWindow(Qt.resolvedUrl('Dialogs/ParticipantsDevices.qml') + ,{chatRoomModel:chatRoomModel + , window:window}) + } + }) + } + } + } + Item{//Spacer Layout.fillWidth: true - visible: chatRoomModel.isMeAdmin } } - Icon{ - Layout.alignment: Qt.AlignVCenter - visible: securityLevel != 1 - icon: securityLevel === 2?'secure_level_1': securityLevel===3? 'secure_level_2' : 'secure_level_unsafe' - iconSize:30 - MouseArea{ - anchors.fill:parent - onClicked : { - window.detachVirtualWindow() - window.attachVirtualWindow(Qt.resolvedUrl('Dialogs/InfoEncryption.qml') - ,{securityLevel:securityLevel} - , function (status) { - if(status){ - window.detachVirtualWindow() - window.attachVirtualWindow(Qt.resolvedUrl('Dialogs/ParticipantsDevices.qml') - ,{chatRoomModel:chatRoomModel - , window:window}) - } - }) + + TextField{ + id: usernameEdit + anchors.fill: parent + //anchors.margins: -1 + //textFieldStyle : TextFieldStyle.flat + text: avatar.username + visible: false + onEditingFinished: { + chatRoomModel.subject = text + visible = false + } + font.bold: true + onFocusChanged: if(!focus) visible=false } - } - } - Item{//Spacer - Layout.fillWidth: true - } } Row { diff --git a/linphone-app/ui/views/App/Main/MainWindow.qml b/linphone-app/ui/views/App/Main/MainWindow.qml index ae3177b8b..8cb5749f7 100644 --- a/linphone-app/ui/views/App/Main/MainWindow.qml +++ b/linphone-app/ui/views/App/Main/MainWindow.qml @@ -200,7 +200,8 @@ ApplicationWindow { ActionButton { icon: 'new_chat_group' - tooltipText : 'Open Conference' + //: 'Open Conference' : Tooltip to illustrate a button + tooltipText : qsTr('newChatRoom') iconSize: MainWindowStyle.newConferenceSize //autoIcon: true onClicked: {