From c1855d07a4e506cc47e56497bb511803aad785c6 Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Thu, 5 Aug 2021 17:29:35 +0200 Subject: [PATCH] Fixes --- .../macos/linphone_dmg.scpt.in | 1 + linphone-app/resources.qrc | 3 +- .../src/components/calls/CallsListModel.cpp | 2 +- .../chat-room/ChatRoomProxyModel.cpp | 12 ++- .../participant/ParticipantListModel.cpp | 88 ++++++++++--------- .../participant/ParticipantListModel.hpp | 3 + .../participant/ParticipantProxyModel.cpp | 4 +- .../participant/ParticipantProxyModel.hpp | 4 +- .../settings/AccountSettingsModel.cpp | 6 ++ .../settings/AccountSettingsModel.hpp | 3 + .../timeline/TimelineProxyModel.cpp | 11 +-- .../ui/modules/Common/Tooltip/TooltipArea.qml | 3 +- .../ui/modules/Linphone/Contact/Contact.qml | 2 +- .../SmartSearchBar/SmartSearchBar.qml | 2 +- .../ui/views/App/Calls/CallsWindow.js | 4 +- .../ui/views/App/Calls/CallsWindow.qml | 12 ++- linphone-app/ui/views/App/Main/Contacts.qml | 11 ++- .../ui/views/App/Main/Conversation.qml | 2 +- .../ui/views/App/Main/Dialogs/NewChatRoom.qml | 19 +++- 19 files changed, 131 insertions(+), 61 deletions(-) diff --git a/linphone-app/cmake_builder/linphone_package/macos/linphone_dmg.scpt.in b/linphone-app/cmake_builder/linphone_package/macos/linphone_dmg.scpt.in index 866c6fcb0..a1cbe207a 100755 --- a/linphone-app/cmake_builder/linphone_package/macos/linphone_dmg.scpt.in +++ b/linphone-app/cmake_builder/linphone_package/macos/linphone_dmg.scpt.in @@ -26,6 +26,7 @@ on run argv set the bounds to { 300, 100, 1000, 520 } set position of item "@APPLICATION_NAME@.app" to { 200, 280 } set position of item "Applications" to { 500, 280 } + set position of item "include" to { 200, 1000 } end tell update without registering applications delay 1 diff --git a/linphone-app/resources.qrc b/linphone-app/resources.qrc index 324043073..0b490187b 100644 --- a/linphone-app/resources.qrc +++ b/linphone-app/resources.qrc @@ -62,7 +62,8 @@ assets/images/cancel_pressed.svg assets/images/chat_amount.svg assets/images/chat_count.svg - assets/images/chat_delivered.svg + assets/images/chat_disabled.svg + assets/images/chat_delivered.svg assets/images/chat_error.svg assets/images/chat_hovered.svg assets/images/chat_is_composing_0.svg diff --git a/linphone-app/src/components/calls/CallsListModel.cpp b/linphone-app/src/components/calls/CallsListModel.cpp index ebf5bc7db..917e14fe4 100644 --- a/linphone-app/src/components/calls/CallsListModel.cpp +++ b/linphone-app/src/components/calls/CallsListModel.cpp @@ -316,7 +316,7 @@ QVariantMap CallsListModel::createChatRoom(const QString& subject, const int& se params->setEncryptionBackend(linphone::ChatRoomEncryptionBackend::Lime); }else params->setBackend(linphone::ChatRoomBackend::Basic); - params->enableGroup(subject != ""); + params->enableGroup(chatRoomParticipants.size() > 1); if(chatRoomParticipants.size() > 0) { diff --git a/linphone-app/src/components/chat-room/ChatRoomProxyModel.cpp b/linphone-app/src/components/chat-room/ChatRoomProxyModel.cpp index a9c797a61..782649849 100644 --- a/linphone-app/src/components/chat-room/ChatRoomProxyModel.cpp +++ b/linphone-app/src/components/chat-room/ChatRoomProxyModel.cpp @@ -57,8 +57,16 @@ protected: QModelIndex index = sourceModel()->index(sourceRow, 0, QModelIndex()); const QVariantMap data = index.data().toMap(); - - return (data["type"].toInt() & mEntryTypeFilter) > 0; + + auto eventModel = sourceModel()->data(index); + + if( mEntryTypeFilter == ChatRoomModel::EntryType::CallEntry && eventModel.value() != nullptr) + return true; + if( mEntryTypeFilter == ChatRoomModel::EntryType::MessageEntry && eventModel.value() != nullptr) + return true; + if( mEntryTypeFilter == ChatRoomModel::EntryType::NoticeEntry && eventModel.value() != nullptr) + return true; + return false; } private: diff --git a/linphone-app/src/components/participant/ParticipantListModel.cpp b/linphone-app/src/components/participant/ParticipantListModel.cpp index c02eab7d0..55af6e42c 100644 --- a/linphone-app/src/components/participant/ParticipantListModel.cpp +++ b/linphone-app/src/components/participant/ParticipantListModel.cpp @@ -47,7 +47,7 @@ ParticipantListModel::ParticipantListModel (ChatRoomModel * chatRoomModel, QObje connect(mChatRoomModel, &ChatRoomModel::participantAdminStatusChanged, this, &ParticipantListModel::onParticipantAdminStatusChanged); connect(mChatRoomModel, &ChatRoomModel::participantRegistrationSubscriptionRequested, this, &ParticipantListModel::onParticipantRegistrationSubscriptionRequested); connect(mChatRoomModel, &ChatRoomModel::participantRegistrationUnsubscriptionRequested, this, &ParticipantListModel::onParticipantRegistrationUnsubscriptionRequested); - + updateParticipants(); } } @@ -66,6 +66,10 @@ ChatRoomModel *ParticipantListModel::getChatRoomModel() const{ return mChatRoomModel; } +int ParticipantListModel::getCount() const{ + return mParticipants.size(); +} + QString ParticipantListModel::addressesToString()const{ QStringList txt; for(auto participant : mParticipants){ @@ -112,25 +116,25 @@ bool ParticipantListModel::contains(const QString& address) const{ //---------------------------------------------------------------------------- int ParticipantListModel::rowCount (const QModelIndex &) const { - return mParticipants.count(); + return mParticipants.count(); } QHash ParticipantListModel::roleNames () const { - QHash roles; - roles[Qt::DisplayRole] = "$participant"; - return roles; + QHash roles; + roles[Qt::DisplayRole] = "$participant"; + return roles; } QVariant ParticipantListModel::data (const QModelIndex &index, int role) const { - int row = index.row(); - - if (!index.isValid() || row < 0 || row >= mParticipants.count()) - return QVariant(); - - if (role == Qt::DisplayRole) - return QVariant::fromValue(mParticipants[row].get()); - - return QVariant(); + int row = index.row(); + + if (!index.isValid() || row < 0 || row >= mParticipants.count()) + return QVariant(); + + if (role == Qt::DisplayRole) + return QVariant::fromValue(mParticipants[row].get()); + + return QVariant(); } // ----------------------------------------------------------------------------- @@ -140,24 +144,24 @@ QVariant ParticipantListModel::data (const QModelIndex &index, int role) const { // ----------------------------------------------------------------------------- bool ParticipantListModel::removeRow (int row, const QModelIndex &parent) { - return removeRows(row, 1, parent); + return removeRows(row, 1, parent); } bool ParticipantListModel::removeRows (int row, int count, const QModelIndex &parent) { - int limit = row + count - 1; - - if (row < 0 || count < 0 || limit >= mParticipants.count()) - return false; - - beginRemoveRows(parent, row, limit); - - for (int i = 0; i < count; ++i){ - mParticipants.takeAt(row); - } - - endRemoveRows(); - - return true; + int limit = row + count - 1; + + if (row < 0 || count < 0 || limit >= mParticipants.count()) + return false; + + beginRemoveRows(parent, row, limit); + + for (int i = 0; i < count; ++i){ + mParticipants.takeAt(row); + } + + endRemoveRows(); + emit countChanged(); + return true; } @@ -165,21 +169,21 @@ bool ParticipantListModel::removeRows (int row, int count, const QModelIndex &pa void ParticipantListModel::updateParticipants () { if( mChatRoomModel) { - bool changed = false; + bool changed = false; CoreManager *coreManager = CoreManager::getInstance(); auto dbParticipants = mChatRoomModel->getChatRoom()->getParticipants(); auto me = mChatRoomModel->getChatRoom()->getMe(); dbParticipants.push_front(me); - //Remove left participants + //Remove left participants //for(auto participant : mParticipants){ auto itParticipant = mParticipants.begin(); while(itParticipant != mParticipants.end()) { auto itDbParticipant = dbParticipants.begin(); while(itDbParticipant != dbParticipants.end() && ((*itParticipant)->getParticipant() && !(*itDbParticipant)->getAddress()->weakEqual((*itParticipant)->getParticipant()->getAddress()) - || !(*itParticipant)->getParticipant() && !(*itDbParticipant)->getAddress()->weakEqual(Utils::interpretUrl((*itParticipant)->getSipAddress())) - ) + || !(*itParticipant)->getParticipant() && !(*itDbParticipant)->getAddress()->weakEqual(Utils::interpretUrl((*itParticipant)->getSipAddress())) + ) ){ ++itDbParticipant; } @@ -192,14 +196,14 @@ void ParticipantListModel::updateParticipants () { }else ++itParticipant; } - // Add new + // Add new for(auto dbParticipant : dbParticipants){ auto itParticipant = mParticipants.begin(); while(itParticipant != mParticipants.end() && ( (*itParticipant)->getParticipant() && !dbParticipant->getAddress()->weakEqual((*itParticipant)->getParticipant()->getAddress()) - || (!(*itParticipant)->getParticipant() && !dbParticipant->getAddress()->weakEqual(Utils::interpretUrl((*itParticipant)->getSipAddress()))) - ) - ){ - + || (!(*itParticipant)->getParticipant() && !dbParticipant->getAddress()->weakEqual(Utils::interpretUrl((*itParticipant)->getSipAddress()))) + ) + ){ + ++itParticipant; } if( itParticipant == mParticipants.end()){ @@ -216,8 +220,10 @@ void ParticipantListModel::updateParticipants () { (*itParticipant)->setParticipant(dbParticipant); } } - if( changed) + if( changed){ emit participantsChanged(); + emit countChanged(); + } } } @@ -228,6 +234,7 @@ void ParticipantListModel::add (std::shared_ptr participant){ endInsertRows(); resetInternalData(); emit participantsChanged(); + emit countChanged(); } void ParticipantListModel::remove (ParticipantModel *model) { @@ -248,6 +255,7 @@ void ParticipantListModel::remove (ParticipantModel *model) { mParticipants.erase(itParticipant); endRemoveRows(); emit participantsChanged(); + emit countChanged(); } } @@ -280,7 +288,7 @@ void ParticipantListModel::onSecurityEvent(const std::shared_ptrgetDeviceAddress(); -// Looping on all participant ensure to get all devices. Can be optimized if Device address is unique : Gain 2n operations. + // Looping on all participant ensure to get all devices. Can be optimized if Device address is unique : Gain 2n operations. if(address) emit deviceSecurityLevelChanged(address); } diff --git a/linphone-app/src/components/participant/ParticipantListModel.hpp b/linphone-app/src/components/participant/ParticipantListModel.hpp index 39f2587de..cf1b68770 100644 --- a/linphone-app/src/components/participant/ParticipantListModel.hpp +++ b/linphone-app/src/components/participant/ParticipantListModel.hpp @@ -34,6 +34,7 @@ public: virtual ~ParticipantListModel(); Q_PROPERTY(ChatRoomModel* chatRoomModel READ getChatRoomModel CONSTANT) + Q_PROPERTY(int count READ getCount NOTIFY countChanged) void reset(); void update(); @@ -51,6 +52,7 @@ public: // Remove a chatroom Q_INVOKABLE void remove (ParticipantModel *importer); Q_INVOKABLE ChatRoomModel* getChatRoomModel() const; + int getCount() const; Q_INVOKABLE QString addressesToString()const; Q_INVOKABLE QString displayNamesToString()const; @@ -77,6 +79,7 @@ signals: void securityLevelChanged(); void deviceSecurityLevelChanged(std::shared_ptr device); void participantsChanged(); + void countChanged(); private: bool removeRow (int row, const QModelIndex &parent = QModelIndex()); diff --git a/linphone-app/src/components/participant/ParticipantProxyModel.cpp b/linphone-app/src/components/participant/ParticipantProxyModel.cpp index f248799aa..898b11983 100644 --- a/linphone-app/src/components/participant/ParticipantProxyModel.cpp +++ b/linphone-app/src/components/participant/ParticipantProxyModel.cpp @@ -61,7 +61,7 @@ QVariantList ParticipantProxyModel::getParticipants() const{ return participants; } -int ParticipantProxyModel::count(){ +int ParticipantProxyModel::getCount() const{ return dynamic_cast(sourceModel())->rowCount(); } @@ -88,6 +88,7 @@ void ParticipantProxyModel::add(const QString& address){ participantsModel->add(participant); if(mChatRoomModel && mChatRoomModel->getChatRoom())// Invite and wait for its creation mChatRoomModel->getChatRoom()->addParticipant(Utils::interpretUrl(address)); + emit countChanged(); } } @@ -99,6 +100,7 @@ void ParticipantProxyModel::remove(ParticipantModel * participant){ }else if(mChatRoomModel->getChatRoom() && participant->getParticipant() ) mChatRoomModel->getChatRoom()->removeParticipant(participant->getParticipant()); //dynamic_cast(sourceModel())->remove(participant); + emit countChanged(); } } diff --git a/linphone-app/src/components/participant/ParticipantProxyModel.hpp b/linphone-app/src/components/participant/ParticipantProxyModel.hpp index 46bb1bb94..53cfa15f4 100644 --- a/linphone-app/src/components/participant/ParticipantProxyModel.hpp +++ b/linphone-app/src/components/participant/ParticipantProxyModel.hpp @@ -40,6 +40,7 @@ public: ParticipantProxyModel ( QObject *parent = Q_NULLPTR); Q_PROPERTY(ChatRoomModel* chatRoomModel READ getChatRoomModel WRITE setChatRoomModel NOTIFY chatRoomModelChanged) + Q_PROPERTY(int count READ getCount NOTIFY countChanged) bool filterAcceptsRow (int sourceRow, const QModelIndex &sourceParent) const override; bool lessThan (const QModelIndex &left, const QModelIndex &right) const override; @@ -47,7 +48,7 @@ public: ChatRoomModel *getChatRoomModel() const; Q_INVOKABLE QStringList getSipAddresses() const; Q_INVOKABLE QVariantList getParticipants() const; - Q_INVOKABLE int count(); + Q_INVOKABLE int getCount() const; void setChatRoomModel(ChatRoomModel * chatRoomModel); @@ -58,6 +59,7 @@ public: signals: void chatRoomModelChanged(); + void countChanged(); private: /* diff --git a/linphone-app/src/components/settings/AccountSettingsModel.cpp b/linphone-app/src/components/settings/AccountSettingsModel.cpp index d657c9e82..d4ce0cda2 100644 --- a/linphone-app/src/components/settings/AccountSettingsModel.cpp +++ b/linphone-app/src/components/settings/AccountSettingsModel.cpp @@ -169,6 +169,12 @@ QVariantMap AccountSettingsModel::getProxyConfigDescription (const shared_ptr
  • core = CoreManager::getInstance()->getCore(); + shared_ptr proxyConfig = core->getDefaultProxyConfig(); + return proxyConfig ? Utils::coreStringToAppString(proxyConfig->getConferenceFactoryUri()) : ""; +} + void AccountSettingsModel::setDefaultProxyConfig (const shared_ptr &proxyConfig) { shared_ptr core = CoreManager::getInstance()->getCore(); if (core->getDefaultProxyConfig() != proxyConfig) { diff --git a/linphone-app/src/components/settings/AccountSettingsModel.hpp b/linphone-app/src/components/settings/AccountSettingsModel.hpp index a46d5074f..c35497cec 100644 --- a/linphone-app/src/components/settings/AccountSettingsModel.hpp +++ b/linphone-app/src/components/settings/AccountSettingsModel.hpp @@ -37,6 +37,8 @@ class AccountSettingsModel : public QObject { Q_PROPERTY(QString sipAddress READ getUsedSipAddressAsStringUriOnly NOTIFY accountSettingsUpdated); Q_PROPERTY(QString fullSipAddress READ getUsedSipAddressAsString); Q_PROPERTY(RegistrationState registrationState READ getRegistrationState NOTIFY accountSettingsUpdated); + + Q_PROPERTY(QString conferenceURI READ getConferenceURI NOTIFY accountSettingsUpdated) // Default info. Q_PROPERTY(QString primaryDisplayName READ getPrimaryDisplayName WRITE setPrimaryDisplayName NOTIFY accountSettingsUpdated); @@ -65,6 +67,7 @@ public: bool addOrUpdateProxyConfig (const std::shared_ptr &proxyConfig); Q_INVOKABLE QVariantMap getProxyConfigDescription (const std::shared_ptr &proxyConfig); + QString getConferenceURI() const; Q_INVOKABLE void setDefaultProxyConfig (const std::shared_ptr &proxyConfig = nullptr); Q_INVOKABLE void setDefaultProxyConfigFromSipAddress (const QString &sipAddress); diff --git a/linphone-app/src/components/timeline/TimelineProxyModel.cpp b/linphone-app/src/components/timeline/TimelineProxyModel.cpp index d36d490ab..d161717f8 100644 --- a/linphone-app/src/components/timeline/TimelineProxyModel.cpp +++ b/linphone-app/src/components/timeline/TimelineProxyModel.cpp @@ -19,6 +19,7 @@ */ #include "components/core/CoreManager.hpp" +#include "components/participant/ParticipantListModel.hpp" #include "components/settings/AccountSettingsModel.hpp" #include "components/sip-addresses/SipAddressesModel.hpp" #include "utils/Utils.hpp" @@ -104,15 +105,15 @@ bool TimelineProxyModel::filterAcceptsRow (int sourceRow, const QModelIndex &sou auto timeline = sourceModel()->data(index).value(); bool show = (mFilterFlags==0);// Show all at 0 (no hide all) auto currentAddress = Utils::interpretUrl(CoreManager::getInstance()->getAccountSettingsModel()->getUsedSipAddressAsStringUriOnly()); - + bool isGroup = timeline->getChatRoomModel()->isGroupEnabled() && timeline->getChatRoomModel()->getParticipants()->getCount() > 2; if( !show && ( (mFilterFlags & TimelineFilter::SimpleChatRoom) == TimelineFilter::SimpleChatRoom)) - show = !timeline->getChatRoomModel()->isGroupEnabled() && !timeline->getChatRoomModel()->haveEncryption(); + show = !isGroup && !timeline->getChatRoomModel()->haveEncryption(); if( !show && ( (mFilterFlags & TimelineFilter::SecureChatRoom) == TimelineFilter::SecureChatRoom)) - show = !timeline->getChatRoomModel()->isGroupEnabled() && timeline->getChatRoomModel()->haveEncryption(); + show = !isGroup && timeline->getChatRoomModel()->haveEncryption(); if( !show && ( (mFilterFlags & TimelineFilter::GroupChatRoom) == TimelineFilter::GroupChatRoom)) - show = timeline->getChatRoomModel()->isGroupEnabled() && !timeline->getChatRoomModel()->haveEncryption(); + show = isGroup && !timeline->getChatRoomModel()->haveEncryption(); if( !show && ( (mFilterFlags & TimelineFilter::SecureGroupChatRoom) == TimelineFilter::SecureGroupChatRoom)) - show = timeline->getChatRoomModel()->isGroupEnabled() && timeline->getChatRoomModel()->haveEncryption(); + show = isGroup && timeline->getChatRoomModel()->haveEncryption(); if( !show && ( (mFilterFlags & TimelineFilter::EphemeralChatRoom) == TimelineFilter::EphemeralChatRoom)) show = timeline->getChatRoomModel()->isEphemeralEnabled(); if(show && mFilterText != ""){ diff --git a/linphone-app/ui/modules/Common/Tooltip/TooltipArea.qml b/linphone-app/ui/modules/Common/Tooltip/TooltipArea.qml index dd44105ed..b575d18d2 100644 --- a/linphone-app/ui/modules/Common/Tooltip/TooltipArea.qml +++ b/linphone-app/ui/modules/Common/Tooltip/TooltipArea.qml @@ -12,6 +12,7 @@ MouseArea { property int delay: TooltipStyle.delay property bool force: false property var tooltipParent: parent + property int maxWidth : tooltipParent.width property bool _visible: false property int hoveringCursor : Qt.PointingHandCursor @@ -36,7 +37,7 @@ MouseArea { delay: tooltipArea.delay parent: tooltipParent visible: _visible || force - width: Math.min(tooltip.implicitWidth, Math.max(tooltipParent.width, TooltipStyle.minWidth)) + width: Math.min(tooltip.implicitWidth, Math.max(tooltipArea.maxWidth, TooltipStyle.minWidth)) //tooltipParent.width>TooltipStyle.minWidth?tooltipParent.width:TooltipStyle.minWidth diff --git a/linphone-app/ui/modules/Linphone/Contact/Contact.qml b/linphone-app/ui/modules/Linphone/Contact/Contact.qml index 872cae38e..670418e6c 100644 --- a/linphone-app/ui/modules/Linphone/Contact/Contact.qml +++ b/linphone-app/ui/modules/Linphone/Contact/Contact.qml @@ -98,7 +98,7 @@ Rectangle { icon:'chat_room' iconSize: ContactStyle.contentHeight - visible: entry!=undefined && entry.groupEnabled != undefined && entry.groupEnabled + visible: entry!=undefined && entry.groupEnabled != undefined && entry.groupEnabled && entry.participants.count > 2 Icon{ anchors.right: parent.right diff --git a/linphone-app/ui/modules/Linphone/SmartSearchBar/SmartSearchBar.qml b/linphone-app/ui/modules/Linphone/SmartSearchBar/SmartSearchBar.qml index 67bc3fe2d..e9823bd5f 100644 --- a/linphone-app/ui/modules/Linphone/SmartSearchBar/SmartSearchBar.qml +++ b/linphone-app/ui/modules/Linphone/SmartSearchBar/SmartSearchBar.qml @@ -85,7 +85,7 @@ SearchBox { }, { icon: SettingsModel.chatEnabled && SettingsModel.getShowStartChatButton() ? 'chat' : 'history', secure:1, - visible:SettingsModel.chatEnabled && SettingsModel.getShowStartChatButton(), + visible:SettingsModel.chatEnabled && SettingsModel.getShowStartChatButton() && AccountSettingsModel.conferenceURI != '', handler: function (entry) { searchBox.closeMenu() searchBox.launchSecureChat(entry.sipAddress) diff --git a/linphone-app/ui/views/App/Calls/CallsWindow.js b/linphone-app/ui/views/App/Calls/CallsWindow.js index 96542aac1..825b96359 100644 --- a/linphone-app/ui/views/App/Calls/CallsWindow.js +++ b/linphone-app/ui/views/App/Calls/CallsWindow.js @@ -54,8 +54,8 @@ function openCallSipAddress () { window.attachVirtualWindow(Qt.resolvedUrl('Dialogs/CallSipAddress.qml')) } -function openConferenceManager (params) { - window.attachVirtualWindow(Qt.resolvedUrl('Dialogs/ConferenceManager.qml'), params) +function openConferenceManager (params, exitHandler) { + window.attachVirtualWindow(Qt.resolvedUrl('Dialogs/ConferenceManager.qml'), params, exitHandler) } // ----------------------------------------------------------------------------- diff --git a/linphone-app/ui/views/App/Calls/CallsWindow.qml b/linphone-app/ui/views/App/Calls/CallsWindow.qml index b61a52dbe..37311ca09 100644 --- a/linphone-app/ui/views/App/Calls/CallsWindow.qml +++ b/linphone-app/ui/views/App/Calls/CallsWindow.qml @@ -43,8 +43,14 @@ Window { rightPaned.close() } + + function conferenceManagerResult(exitValue){ + if(exitValue == 0 && calls.count == 0) + close(); + } + function openConferenceManager (params) { - Logic.openConferenceManager(params) + Logic.openConferenceManager(params, conferenceManagerResult) } function setHeight (height) { @@ -122,7 +128,9 @@ Window { icon: 'new_conference' visible: SettingsModel.conferenceEnabled - onClicked: Logic.openConferenceManager() + onClicked: { + Logic.openConferenceManager() + } } } } diff --git a/linphone-app/ui/views/App/Main/Contacts.qml b/linphone-app/ui/views/App/Main/Contacts.qml index e3bdf6c2d..460bd8cf5 100644 --- a/linphone-app/ui/views/App/Main/Contacts.qml +++ b/linphone-app/ui/views/App/Main/Contacts.qml @@ -125,6 +125,7 @@ ColumnLayout { Item { ActionBar { + id:actionBar anchors { left: parent.left verticalCenter: parent.verticalCenter @@ -152,7 +153,8 @@ ColumnLayout { ActionButton { icon: 'chat' - visible:SettingsModel.chatEnabled && SettingsModel.getShowStartChatButton() && $contact.hasCapability(LinphoneEnums.FriendCapabilityLimeX3Dh) + visible: SettingsModel.chatEnabled && SettingsModel.getShowStartChatButton() && $contact.hasCapability(LinphoneEnums.FriendCapabilityLimeX3Dh) + enabled: AccountSettingsModel.conferenceURI != '' Icon{ icon:'secure_level_1' iconSize:15 @@ -161,6 +163,13 @@ ColumnLayout { anchors.topMargin: -3 } onClicked: {actions.itemAt(3).open()} + TooltipArea{ + maxWidth: actionBar.width + visible: AccountSettingsModel.conferenceURI == '' + //: 'You need to set the conference URI in your account settings to create a conference based chat room.' : Tooltip to warn the user that a setting is missing in its configuration. + text: '- ' + qsTr('missingConferenceURI') + '\n' + + } } } diff --git a/linphone-app/ui/views/App/Main/Conversation.qml b/linphone-app/ui/views/App/Main/Conversation.qml index a2d0ed001..58e669a68 100644 --- a/linphone-app/ui/views/App/Main/Conversation.qml +++ b/linphone-app/ui/views/App/Main/Conversation.qml @@ -81,7 +81,7 @@ ColumnLayout { icon:'chat_room' iconSize: ConversationStyle.bar.groupChatSize - visible: chatRoomModel.groupEnabled + visible: chatRoomModel.groupEnabled && chatRoomModel.participants.count > 2 } Item{ Layout.fillHeight: true diff --git a/linphone-app/ui/views/App/Main/Dialogs/NewChatRoom.qml b/linphone-app/ui/views/App/Main/Dialogs/NewChatRoom.qml index 9a19527a4..40ca6e6a3 100644 --- a/linphone-app/ui/views/App/Main/Dialogs/NewChatRoom.qml +++ b/linphone-app/ui/views/App/Main/Dialogs/NewChatRoom.qml @@ -29,7 +29,7 @@ DialogPlus { onClicked: exit(0) }, TextButtonB { - //enabled: toAddView.count >= conferenceManager.minParticipants + enabled: selectedParticipants.count >= conferenceManager.minParticipants && subject.text != '' && AccountSettingsModel.conferenceURI != '' //: 'Launch' : Start button text: qsTr('startButton') capitalization: Font.AllUppercase @@ -38,6 +38,23 @@ DialogPlus { if(CallsListModel.createChatRoom(subject.text, secureSwitch.checked, selectedParticipants.getParticipants() )) exit(1) } + TooltipArea{ + visible: AccountSettingsModel.conferenceURI == '' || subject.text == '' || selectedParticipants.count < conferenceManager.minParticipants + maxWidth: participantView.width + text: { + var txt = '\n'; + if( subject.text == '') + //: 'You need to fill a subject.' : Tooltip to warn a user on missing field. + txt ='- ' + qsTr('missingSubject') + '\n' + if( selectedParticipants.count < conferenceManager.minParticipants) + //: 'You need at least %1 participant.' : Tooltip to warn a user that there are not enough participants for the chat creation. + txt += '- ' + qsTr('missingParticipants', '', conferenceManager.minParticipants) + '\n' + if( AccountSettingsModel.conferenceURI == '') + //: 'You need to set the conference URI in your account settings to create a conference based chat room.' : Tooltip to warn the user that a setting is missong in its configuration. + txt += '- ' + qsTr('missingConferenceURI') + '\n' + return txt; + } + } } ]