diff --git a/linphone-app/assets/assistant/create-app-sip-account.rc b/linphone-app/assets/assistant/create-app-sip-account.rc index dd016d96d..a97f878b2 100644 --- a/linphone-app/assets/assistant/create-app-sip-account.rc +++ b/linphone-app/assets/assistant/create-app-sip-account.rc @@ -1,5 +1,8 @@ +
+ 10000000 +
1 0 diff --git a/linphone-app/assets/assistant/use-app-sip-account.rc b/linphone-app/assets/assistant/use-app-sip-account.rc index 6a3470d28..faebe3684 100644 --- a/linphone-app/assets/assistant/use-app-sip-account.rc +++ b/linphone-app/assets/assistant/use-app-sip-account.rc @@ -1,5 +1,8 @@ +
+ 10000000 +
1 0 diff --git a/linphone-app/assets/assistant/use-other-sip-account.rc b/linphone-app/assets/assistant/use-other-sip-account.rc index 2c9978ca8..060355d4b 100644 --- a/linphone-app/assets/assistant/use-other-sip-account.rc +++ b/linphone-app/assets/assistant/use-other-sip-account.rc @@ -1,5 +1,8 @@ +
+ 10000000 +
0 0 diff --git a/linphone-app/assets/languages/en.ts b/linphone-app/assets/languages/en.ts index 49519b982..9e0c447ac 100644 --- a/linphone-app/assets/languages/en.ts +++ b/linphone-app/assets/languages/en.ts @@ -1970,6 +1970,21 @@ Click here: <a href="%1">%1</a> 'Enable notifications': settings label for enabling notifications. Enable notifications + + AutoDownload + 'Auto download' : Label for a slider about auto download mode + Auto download + + + autoDownloadNever + 'Never' : auto download mode description for deactivated feature. + Never + + + autoDownloadAlways + 'Always' : auto download mode description for activated feature without any constraints. + Always + SettingsLdap diff --git a/linphone-app/src/app/App.cpp b/linphone-app/src/app/App.cpp index 8369e1001..c9e47b260 100644 --- a/linphone-app/src/app/App.cpp +++ b/linphone-app/src/app/App.cpp @@ -496,6 +496,9 @@ bool App::hasFocus () const { } void App::stateChanged(Qt::ApplicationState pState) { DesktopTools::applicationStateChanged(pState); + auto core = CoreManager::getInstance(); + if(core) + core->stateChanged(pState); } // ----------------------------------------------------------------------------- diff --git a/linphone-app/src/components/chat-events/ChatMessageModel.cpp b/linphone-app/src/components/chat-events/ChatMessageModel.cpp index 1d40c2ff5..2474e881e 100644 --- a/linphone-app/src/components/chat-events/ChatMessageModel.cpp +++ b/linphone-app/src/components/chat-events/ChatMessageModel.cpp @@ -81,8 +81,8 @@ std::shared_ptr ChatMessageListener::onFileTransferSend(const emit fileTransferSend(message, content, offset, size); return nullptr; } -void ChatMessageListener::onFileTransferProgressIndication (const std::shared_ptr &message, const std::shared_ptr & content, size_t offset, size_t i){ - emit fileTransferProgressIndication(message, content, offset, i); +void ChatMessageListener::onFileTransferProgressIndication (const std::shared_ptr &message, const std::shared_ptr & content, size_t offset, size_t total){ + emit fileTransferProgressIndication(message, content, offset, total); } void ChatMessageListener::onMsgStateChanged (const std::shared_ptr &message, linphone::ChatMessage::State state){ emit msgStateChanged(message, state); @@ -298,6 +298,8 @@ void ChatMessageModel::deleteEvent(){ if(mChatMessage) mChatMessage->getChatRoom()->deleteMessage(mChatMessage); } + + void ChatMessageModel::updateFileTransferInformation(){ mContentListModel->updateContents(this); } @@ -311,20 +313,23 @@ std::shared_ptr ChatMessageModel::onFileTransferSend (const st return nullptr; } -void ChatMessageModel::onFileTransferProgressIndication (const std::shared_ptr &message,const std::shared_ptr &content,size_t offset,size_t) { +void ChatMessageModel::onFileTransferProgressIndication (const std::shared_ptr &message,const std::shared_ptr &content,size_t offset,size_t total) { auto contentModel = mContentListModel->getContentModel(content); - if(contentModel) + if(contentModel) { contentModel->setFileOffset(offset); + if (total == offset && mChatMessage && !mChatMessage->isOutgoing()) { + mContentListModel->downloaded(); + bool allAreDownloaded = true; + for(auto content : mContentListModel->getContents()) + allAreDownloaded &= content->mWasDownloaded; + setWasDownloaded(allAreDownloaded); + App::getInstance()->getNotifier()->notifyReceivedFileMessage(message, content); + } + } } void ChatMessageModel::onMsgStateChanged (const std::shared_ptr &message, linphone::ChatMessage::State state) { updateFileTransferInformation();// On message state, file transfert information Content can be changed - // File message downloaded. - if (mChatMessage && state == linphone::ChatMessage::State::FileTransferDone && !mChatMessage->isOutgoing()) { - mContentListModel->downloaded(); - setWasDownloaded(true); - App::getInstance()->getNotifier()->notifyReceivedFileMessage(message); - } emit stateChanged(); } void ChatMessageModel::onParticipantImdnStateChanged(const std::shared_ptr & message, const std::shared_ptr & state){ @@ -335,6 +340,8 @@ void ChatMessageModel::onEphemeralMessageTimerStarted(const std::shared_ptr & message) { //emit remove(mSelf.lock()); + if(!isOutgoing()) + mContentListModel->removeDownloadedFiles(); emit remove(this); } //------------------------------------------------------------------------------------------------------- diff --git a/linphone-app/src/components/chat-room/ChatRoomModel.cpp b/linphone-app/src/components/chat-room/ChatRoomModel.cpp index f76825b0d..f34cbccac 100644 --- a/linphone-app/src/components/chat-room/ChatRoomModel.cpp +++ b/linphone-app/src/components/chat-room/ChatRoomModel.cpp @@ -470,8 +470,8 @@ int ChatRoomModel::getState() const { return mChatRoom ? (int)mChatRoom->getState() : 0; } -bool ChatRoomModel::hasBeenLeft() const{ - return mChatRoom && mChatRoom->hasBeenLeft(); +bool ChatRoomModel::isReadOnly() const{ + return mChatRoom && mChatRoom->isReadOnly(); } bool ChatRoomModel::isEphemeralEnabled() const{ @@ -1367,7 +1367,7 @@ void ChatRoomModel::onConferenceJoined(const std::shared_ptr updateLastUpdateTime(); emit usernameChanged(); emit conferenceJoined(chatRoom, eventLog); - emit hasBeenLeftChanged(); + emit isReadOnlyChanged(); } void ChatRoomModel::onConferenceLeft(const std::shared_ptr & chatRoom, const std::shared_ptr & eventLog){ @@ -1384,7 +1384,7 @@ void ChatRoomModel::onConferenceLeft(const std::shared_ptr & } updateLastUpdateTime(); emit conferenceLeft(chatRoom, eventLog); - emit hasBeenLeftChanged(); + emit isReadOnlyChanged(); } } diff --git a/linphone-app/src/components/chat-room/ChatRoomModel.hpp b/linphone-app/src/components/chat-room/ChatRoomModel.hpp index 1fb3df6c0..573f022e9 100644 --- a/linphone-app/src/components/chat-room/ChatRoomModel.hpp +++ b/linphone-app/src/components/chat-room/ChatRoomModel.hpp @@ -133,7 +133,7 @@ public: Q_PROPERTY(bool isComposing READ getIsRemoteComposing NOTIFY isRemoteComposingChanged) Q_PROPERTY(QList composers READ getComposers NOTIFY isRemoteComposingChanged) - Q_PROPERTY(bool hasBeenLeft READ hasBeenLeft NOTIFY hasBeenLeftChanged) + Q_PROPERTY(bool isReadOnly READ isReadOnly NOTIFY isReadOnlyChanged) Q_PROPERTY(QString sipAddress READ getFullPeerAddress NOTIFY fullPeerAddressChanged) Q_PROPERTY(QString sipAddressUriOnly READ getPeerAddress NOTIFY fullPeerAddressChanged) @@ -180,7 +180,7 @@ public: QString getAvatar () const; int getPresenceStatus() const; int getState() const; - bool hasBeenLeft() const; + bool isReadOnly() const; bool isEphemeralEnabled() const; long getEphemeralLifetime() const; bool canBeEphemeral(); @@ -320,7 +320,7 @@ signals: void groupEnabledChanged(bool groupEnabled); void isMeAdminChanged(); void stateChanged(int state); - void hasBeenLeftChanged(); + void isReadOnlyChanged(); void ephemeralEnabledChanged(); void ephemeralLifetimeChanged(); void canBeEphemeralChanged(); diff --git a/linphone-app/src/components/content/ContentListModel.cpp b/linphone-app/src/components/content/ContentListModel.cpp index cd22115c0..3e402f4cd 100644 --- a/linphone-app/src/components/content/ContentListModel.cpp +++ b/linphone-app/src/components/content/ContentListModel.cpp @@ -150,6 +150,13 @@ void ContentListModel::clear(){ endResetModel(); } +void ContentListModel::removeDownloadedFiles(){ + for(auto contentModel : mList){ + contentModel->removeDownloadedFile(); + contentModel->removeThumbnail(); + } +} + std::shared_ptr ContentListModel::getContentModel(std::shared_ptr content){ for(auto c : mList) if(c->getContent() == content) diff --git a/linphone-app/src/components/content/ContentListModel.hpp b/linphone-app/src/components/content/ContentListModel.hpp index 6ed96b002..48a3eb537 100644 --- a/linphone-app/src/components/content/ContentListModel.hpp +++ b/linphone-app/src/components/content/ContentListModel.hpp @@ -48,6 +48,7 @@ public: Q_INVOKABLE void remove(ContentModel * model); void clear(); + void removeDownloadedFiles(); std::shared_ptr getContentModel(std::shared_ptr content);// Return the contentModel by checking Content, or if it is the same file. QList> getContents(); diff --git a/linphone-app/src/components/content/ContentModel.cpp b/linphone-app/src/components/content/ContentModel.cpp index d82f4ef58..3b6b6011b 100644 --- a/linphone-app/src/components/content/ContentModel.cpp +++ b/linphone-app/src/components/content/ContentModel.cpp @@ -65,7 +65,14 @@ quint64 ContentModel::getFileSize() const{ } QString ContentModel::getName() const{ - return QString::fromStdString(mContent->getName()); + QString name = QString::fromStdString(mContent->getName()); + if( name == "") { // Try to find the name from file Path + QString fileName = QString::fromStdString(mContent->getFilePath()); + if(fileName != ""){ + name = QFileInfo(fileName).baseName(); + } + } + return name; } QString ContentModel::getThumbnail() const{ @@ -101,6 +108,7 @@ void ContentModel::setWasDownloaded(bool wasDownloaded){ void ContentModel::setContent(std::shared_ptr content){ mContent = content; + emit nameChanged(); if(isFile() || isFileEncrypted() || isFileTransfer() ){ QString path = Utils::coreStringToAppString(mContent->getFilePath()); if (!path.isEmpty()) @@ -204,6 +212,13 @@ void ContentModel::removeThumbnail(){ mAppData.mData.clear(); } +void ContentModel::removeDownloadedFile(){ + QString path = getFilePath(); + if( path != ""){ + QFile(path).remove(); + } +} + void ContentModel::downloadFile(){ switch (mChatMessageModel->getState()) { case LinphoneEnums::ChatMessageStateDelivered: diff --git a/linphone-app/src/components/content/ContentModel.hpp b/linphone-app/src/components/content/ContentModel.hpp index d379a70ce..e382c8907 100644 --- a/linphone-app/src/components/content/ContentModel.hpp +++ b/linphone-app/src/components/content/ContentModel.hpp @@ -70,6 +70,7 @@ public: void createThumbnail (const bool& force = false); void removeThumbnail (); + void removeDownloadedFile(); Q_INVOKABLE void downloadFile(); Q_INVOKABLE void openFile (bool showDirectory = false); diff --git a/linphone-app/src/components/core/CoreManager.cpp b/linphone-app/src/components/core/CoreManager.cpp index b4e309c7c..a21a333a4 100644 --- a/linphone-app/src/components/core/CoreManager.cpp +++ b/linphone-app/src/components/core/CoreManager.cpp @@ -180,6 +180,15 @@ void CoreManager::forceRefreshRegisters () { void CoreManager::updateUnreadMessageCount(){ mEventCountNotifier->updateUnreadMessageCount(); } + +void CoreManager::stateChanged(Qt::ApplicationState pState){ + if(mCbsTimer){ + if(pState == Qt::ApplicationActive) + mCbsTimer->setInterval( Constants::CbsCallInterval); + else + mCbsTimer->setInterval( Constants::CbsCallInterval * 10); + } +} // ----------------------------------------------------------------------------- void CoreManager::sendLogs () const { diff --git a/linphone-app/src/components/core/CoreManager.hpp b/linphone-app/src/components/core/CoreManager.hpp index fed449ed6..43ffaf06d 100644 --- a/linphone-app/src/components/core/CoreManager.hpp +++ b/linphone-app/src/components/core/CoreManager.hpp @@ -163,6 +163,7 @@ public: Q_INVOKABLE void forceRefreshRegisters (); void updateUnreadMessageCount(); + void stateChanged(Qt::ApplicationState pState); Q_INVOKABLE void sendLogs () const; Q_INVOKABLE void cleanLogs () const; diff --git a/linphone-app/src/components/notifier/Notifier.cpp b/linphone-app/src/components/notifier/Notifier.cpp index 6a7e5d238..9bcf5315e 100644 --- a/linphone-app/src/components/notifier/Notifier.cpp +++ b/linphone-app/src/components/notifier/Notifier.cpp @@ -295,16 +295,16 @@ void Notifier::notifyReceivedMessage (const shared_ptr &m CREATE_NOTIFICATION(Notifier::ReceivedMessage, map) } -void Notifier::notifyReceivedFileMessage (const shared_ptr &message) { +void Notifier::notifyReceivedFileMessage (const shared_ptr &message, const shared_ptr &content) { QVariantMap map; shared_ptr chatRoom(message->getChatRoom()); map["timelineModel"].setValue(CoreManager::getInstance()->getTimelineListModel()->getTimeline(chatRoom, true).get()); - map["fileUri"] = Utils::coreStringToAppString(message->getFileTransferInformation()->getFilePath()); + map["fileUri"] = Utils::coreStringToAppString(content->getFilePath()); if( Utils::getImage(map["fileUri"].toString()).isNull()) map["imageUri"] = ""; else map["imageUri"] = map["fileUri"]; - map["fileSize"] = quint64(message->getFileTransferInformation()->getSize() +message->getFileTransferInformation()->getFileSize()); + map["fileSize"] = quint64(content->getSize() + content->getFileSize()); CREATE_NOTIFICATION(Notifier::ReceivedFileMessage, map) } diff --git a/linphone-app/src/components/notifier/Notifier.hpp b/linphone-app/src/components/notifier/Notifier.hpp index 990e1bba7..04493142a 100644 --- a/linphone-app/src/components/notifier/Notifier.hpp +++ b/linphone-app/src/components/notifier/Notifier.hpp @@ -55,7 +55,7 @@ public: }; void notifyReceivedMessage (const std::shared_ptr &message); - void notifyReceivedFileMessage (const std::shared_ptr &message); + void notifyReceivedFileMessage (const std::shared_ptr &message, const std::shared_ptr &content); void notifyReceivedCall (const std::shared_ptr &call); void notifyNewVersionAvailable (const QString &version, const QString &url); void notifySnapshotWasTaken (const QString &filePath); diff --git a/linphone-app/src/components/settings/SettingsModel.cpp b/linphone-app/src/components/settings/SettingsModel.cpp index 7cb98be13..3c07303c1 100644 --- a/linphone-app/src/components/settings/SettingsModel.cpp +++ b/linphone-app/src/components/settings/SettingsModel.cpp @@ -649,6 +649,15 @@ void SettingsModel::setAutomaticallyRecordCalls (bool status) { emit automaticallyRecordCallsChanged(status); } +int SettingsModel::getAutoDownloadMaxSize() const{ + return CoreManager::getInstance()->getCore()->getMaxSizeForAutoDownloadIncomingFiles(); +} + +void SettingsModel::setAutoDownloadMaxSize(int maxSize){ + CoreManager::getInstance()->getCore()->setMaxSizeForAutoDownloadIncomingFiles(maxSize); + emit autoDownloadMaxSizeChanged(maxSize); +} + // ----------------------------------------------------------------------------- bool SettingsModel::getCallPauseEnabled () const { diff --git a/linphone-app/src/components/settings/SettingsModel.hpp b/linphone-app/src/components/settings/SettingsModel.hpp index a006737f9..7e6bd83c2 100644 --- a/linphone-app/src/components/settings/SettingsModel.hpp +++ b/linphone-app/src/components/settings/SettingsModel.hpp @@ -109,6 +109,7 @@ class SettingsModel : public QObject { Q_PROPERTY(bool callRecorderEnabled READ getCallRecorderEnabled WRITE setCallRecorderEnabled NOTIFY callRecorderEnabledChanged) Q_PROPERTY(bool automaticallyRecordCalls READ getAutomaticallyRecordCalls WRITE setAutomaticallyRecordCalls NOTIFY automaticallyRecordCallsChanged) + Q_PROPERTY(int autoDownloadMaxSize READ getAutoDownloadMaxSize WRITE setAutoDownloadMaxSize NOTIFY autoDownloadMaxSizeChanged) Q_PROPERTY(bool callPauseEnabled READ getCallPauseEnabled WRITE setCallPauseEnabled NOTIFY callPauseEnabledChanged) Q_PROPERTY(bool muteMicrophoneEnabled READ getMuteMicrophoneEnabled WRITE setMuteMicrophoneEnabled NOTIFY muteMicrophoneEnabledChanged) @@ -357,6 +358,9 @@ public: bool getAutomaticallyRecordCalls () const; void setAutomaticallyRecordCalls (bool status); + int getAutoDownloadMaxSize() const; + void setAutoDownloadMaxSize(int maxSize); + bool getCallPauseEnabled () const; void setCallPauseEnabled (bool status); @@ -625,6 +629,7 @@ signals: void callRecorderEnabledChanged (bool status); void automaticallyRecordCallsChanged (bool status); + void autoDownloadMaxSizeChanged (int maxSize); void callPauseEnabledChanged (bool status); void muteMicrophoneEnabledChanged (bool status); diff --git a/linphone-app/src/components/timeline/TimelineListModel.cpp b/linphone-app/src/components/timeline/TimelineListModel.cpp index 262aa25d2..1b3d1f0ce 100644 --- a/linphone-app/src/components/timeline/TimelineListModel.cpp +++ b/linphone-app/src/components/timeline/TimelineListModel.cpp @@ -309,7 +309,7 @@ void TimelineListModel::remove(std::shared_ptr model){ } } void TimelineListModel::removeChatRoomModel(std::shared_ptr model){ - if(!model || (model->getChatRoom()->isEmpty() && (model->hasBeenLeft() || !model->isGroupEnabled()))){ + if(!model || (model->getChatRoom()->isEmpty() && (model->isReadOnly() || !model->isGroupEnabled()))){ auto itTimeline = mTimelines.begin(); while(itTimeline != mTimelines.end()) { if((*itTimeline)->mChatRoomModel == model){ diff --git a/linphone-app/src/components/timeline/TimelineModel.cpp b/linphone-app/src/components/timeline/TimelineModel.cpp index 1c8db2f91..752c9819a 100644 --- a/linphone-app/src/components/timeline/TimelineModel.cpp +++ b/linphone-app/src/components/timeline/TimelineModel.cpp @@ -129,7 +129,7 @@ void TimelineModel::setSelected(const bool& selected){ << ", ephemeralEnabled:" << mChatRoomModel->isEphemeralEnabled() << ", isAdmin:"<< mChatRoomModel->isMeAdmin() << ", canHandleParticipants:"<< mChatRoomModel->canHandleParticipants() - << ", hasBeenLeft:" << mChatRoomModel->hasBeenLeft(); + << ", isReadOnly:" << mChatRoomModel->isReadOnly(); } emit selectedChanged(mSelected); } diff --git a/linphone-app/ui/modules/Linphone/Chat/Chat.qml b/linphone-app/ui/modules/Linphone/Chat/Chat.qml index ded7b7121..673805afb 100644 --- a/linphone-app/ui/modules/Linphone/Chat/Chat.qml +++ b/linphone-app/ui/modules/Linphone/Chat/Chat.qml @@ -459,12 +459,12 @@ Rectangle { Layout.leftMargin: ChatStyle.sendArea.backgroundBorder.width borderColor: ChatStyle.sendArea.border.color topWidth: ChatStyle.sendArea.border.width - visible: proxyModel.chatRoomModel && !proxyModel.chatRoomModel.hasBeenLeft && (!proxyModel.chatRoomModel.haveEncryption && SettingsModel.standardChatEnabled || proxyModel.chatRoomModel.haveEncryption && SettingsModel.secureChatEnabled) + visible: proxyModel.chatRoomModel && !proxyModel.chatRoomModel.isReadOnly && (!proxyModel.chatRoomModel.haveEncryption && SettingsModel.standardChatEnabled || proxyModel.chatRoomModel.haveEncryption && SettingsModel.secureChatEnabled) DroppableTextArea { id: textArea - enabled:proxyModel && proxyModel.chatRoomModel ? !proxyModel.chatRoomModel.hasBeenLeft:false + enabled:proxyModel && proxyModel.chatRoomModel ? !proxyModel.chatRoomModel.isReadOnly:false isEphemeral : proxyModel && proxyModel.chatRoomModel ? proxyModel.chatRoomModel.ephemeralEnabled:false anchors.left: parent.left diff --git a/linphone-app/ui/modules/Linphone/Chat/ChatFileMessage.qml b/linphone-app/ui/modules/Linphone/Chat/ChatFileMessage.qml index d25dfb080..f919c4241 100644 --- a/linphone-app/ui/modules/Linphone/Chat/ChatFileMessage.qml +++ b/linphone-app/ui/modules/Linphone/Chat/ChatFileMessage.qml @@ -246,7 +246,7 @@ Row { icon: ChatStyle.entry.message.file.download.icon iconSize: ChatStyle.entry.message.file.download.iconSize overwriteColor: isOutgoing ? ChatStyle.entry.message.file.download.outgoingColor : ChatStyle.entry.message.file.download.incomingColor - visible: (mainRow.contentModel? !mainRow.contentModel.wasDownloaded : false) + visible: !progressBar.visible && (mainRow.contentModel? !mainRow.contentModel.wasDownloaded : false) } MouseArea { @@ -257,7 +257,10 @@ Row { } anchors.fill: parent - visible: downloadButton.visible || ((rectangle.isUploaded || rectangle.isRead) && !isOutgoing) || isOutgoing + visible: true + //downloadButton.visible || ((rectangle.isUploaded || rectangle.isRead) && !isOutgoing) || isOutgoing + //onVisibleChanged: console.log("Mouse of "+mainRow.contentModel.name+" / "+downloadButton.visible + // +"/"+rectangle.isUploaded +"/"+rectangle.isRead) onClicked: { if (Utils.pointIsInItem(this, thumbnailProvider, mouse)) { diff --git a/linphone-app/ui/views/App/Main/Conversation.qml b/linphone-app/ui/views/App/Main/Conversation.qml index 4c2ddbc5e..0c5bb190c 100644 --- a/linphone-app/ui/views/App/Main/Conversation.qml +++ b/linphone-app/ui/views/App/Main/Conversation.qml @@ -178,7 +178,7 @@ ColumnLayout { } onUsernameClicked: { - if(!conversation.hasBeenLeft) { + if(!conversation.isReadOnly) { usernameEdit.visible = !usernameEdit.visible usernameEdit.forceActiveFocus() } @@ -198,7 +198,7 @@ ColumnLayout { iconSize:30 MouseArea{ anchors.fill:parent - visible: !conversation.hasBeenLeft + visible: !conversation.isReadOnly onClicked : { window.detachVirtualWindow() window.attachVirtualWindow(Qt.resolvedUrl('Dialogs/InfoEncryption.qml') @@ -294,7 +294,7 @@ ColumnLayout { backgroundRadius: 1000 colorSet: ConversationStyle.bar.actions.groupChat - visible: SettingsModel.outgoingCallsEnabled && conversation.haveMoreThanOneParticipants && conversation.haveLessThanMinParticipantsForCall && !conversation.hasBeenLeft + visible: SettingsModel.outgoingCallsEnabled && conversation.haveMoreThanOneParticipants && conversation.haveLessThanMinParticipantsForCall && !conversation.isReadOnly onClicked: Logic.openConferenceManager({chatRoomModel:conversation.chatRoomModel, autoCall:true}) //: "Call all chat room's participants" : tooltip on a button for calling all participant in the current chat room diff --git a/linphone-app/ui/views/App/Main/Dialogs/InfoChatRoom.qml b/linphone-app/ui/views/App/Main/Dialogs/InfoChatRoom.qml index fdfd49750..a7853a9b9 100644 --- a/linphone-app/ui/views/App/Main/Dialogs/InfoChatRoom.qml +++ b/linphone-app/ui/views/App/Main/Dialogs/InfoChatRoom.qml @@ -27,7 +27,7 @@ DialogPlus { chatRoomModel.leaveChatRoom(); exit(0) } - enabled: !chatRoomModel.hasBeenLeft + enabled: !chatRoomModel.isReadOnly visible: !chatRoomModel.isOneToOne },Item{ Layout.fillWidth: true @@ -38,7 +38,7 @@ DialogPlus { capitalization: Font.AllUppercase onClicked: { - if(!chatRoomModel.hasBeenLeft) + if(!chatRoomModel.isReadOnly) chatRoomModel.updateParticipants(selectedParticipants.getParticipants()) // Remove/New exit(1) } @@ -58,7 +58,7 @@ DialogPlus { height: InfoChatRoomStyle.height width: InfoChatRoomStyle.width - readonly property bool adminMode : chatRoomModel.isMeAdmin && !chatRoomModel.hasBeenLeft + readonly property bool adminMode : chatRoomModel.isMeAdmin && !chatRoomModel.isReadOnly // --------------------------------------------------------------------------- ColumnLayout { diff --git a/linphone-app/ui/views/App/Settings/SettingsCallsChat.qml b/linphone-app/ui/views/App/Settings/SettingsCallsChat.qml index 0fcff494f..066638ed9 100644 --- a/linphone-app/ui/views/App/Settings/SettingsCallsChat.qml +++ b/linphone-app/ui/views/App/Settings/SettingsCallsChat.qml @@ -1,10 +1,12 @@ import QtQuick 2.7 +import QtQuick.Layouts 1.3 import Common 1.0 import Linphone 1.0 import Utils 1.0 import App.Styles 1.0 +import Common.Styles 1.0 // ============================================================================= @@ -240,7 +242,7 @@ TabContainer { onClicked: SettingsModel.secureChatEnabled = !checked } } - + FormGroup { label: qsTr('conferenceEnabledLabel') @@ -316,6 +318,79 @@ TabContainer { } } + } + FormLine { + FormGroup { + //: 'Auto download' : Label for a slider about auto download mode + label: qsTr('AutoDownload') + + RowLayout{ + Layout.fillHeight: true + Layout.fillWidth: true + spacing: 0 + Slider { + Layout.fillHeight: true + Layout.fillWidth: true + id: autoDownloadModes + width: parent.width + + function toSlider(value){ + if( value == -1) + return autoDownloadModes.from; + else if(value == 0) + return autoDownloadModes.to; + else + return value/1000000+autoDownloadModes.from + } + function fromSlider(value){ + if( value == autoDownloadModes.from) + return -1 + else if( value == autoDownloadModes.to) + return 0 + else + return (value - autoDownloadModes.from) * 1000000 + } + + onValueChanged: { + SettingsModel.autoDownloadMaxSize = fromSlider(value) + autoDownloadText.updateText(value) + } + from: 1 + to: 500 + stepSize: 1 + value: toSlider(SettingsModel.autoDownloadMaxSize) + } + Text { + id: autoDownloadText + property int preferredWidth : 0 + Layout.preferredWidth: preferredWidth + color: FormHGroupStyle.legend.color + font.pointSize: FormHGroupStyle.legend.pointSize + + function updateText(value){ + //: 'Never' : auto download mode description for deactivated feature. + text = value == autoDownloadModes.from ? qsTr('autoDownloadNever') + //: 'Always' : auto download mode description for activated feature without any constraints. + : value == autoDownloadModes.to ? qsTr('autoDownloadAlways') + : ' < '+ ( autoDownloadModes.fromSlider(value) ).toFixed(0)/1000000 + ' Mb' + } + Component.onCompleted: updateMaxSize() + function updateMaxSize(){ + autoDownloadText.visible = false + updateText(autoDownloadModes.from) + var maxWidth = autoDownloadText.implicitWidth + updateText(autoDownloadModes.to) + maxWidth = Math.max( maxWidth, autoDownloadText.implicitWidth) + updateText(autoDownloadModes.to-1) + maxWidth = Math.max( maxWidth, autoDownloadText.implicitWidth) + autoDownloadText.preferredWidth = maxWidth + updateText(autoDownloadModes.value) + autoDownloadText.visible = true + } + } + } + } + } FormLine { diff --git a/linphone-sdk b/linphone-sdk index 9b46b4998..e198368c1 160000 --- a/linphone-sdk +++ b/linphone-sdk @@ -1 +1 @@ -Subproject commit 9b46b4998337f0e80daeca2030b5ccad120d8724 +Subproject commit e198368c1254aff728c643ce8cba1541cdb5dc10