Cleanup and prepare translations.

This commit is contained in:
Julien Wadel 2022-05-13 17:26:24 +02:00
parent 3e29faa15c
commit 708a605825
107 changed files with 584 additions and 1645 deletions

View file

@ -153,7 +153,6 @@ set(SOURCES
src/components/calls/CallsListProxyModel.cpp
src/components/camera/Camera.cpp
src/components/camera/CameraDummy.cpp
src/components/camera/CameraPreview.cpp
src/components/chat/ChatModel.cpp
src/components/chat-events/ChatCallModel.cpp
src/components/chat-events/ChatEvent.cpp
@ -172,7 +171,6 @@ set(SOURCES
src/components/conference/ConferenceModel.cpp
src/components/conference/ConferenceProxyModel.cpp
src/components/conferenceInfo/ConferenceInfoModel.cpp
src/components/conferenceInfo/ConferenceInfoListModel.cpp
src/components/conferenceInfo/ConferenceInfoMapModel.cpp
src/components/conferenceInfo/ConferenceInfoProxyListModel.cpp
src/components/conferenceInfo/ConferenceInfoProxyModel.cpp
@ -287,7 +285,6 @@ set(HEADERS
src/components/calls/CallsListProxyModel.hpp
src/components/camera/Camera.hpp
src/components/camera/CameraDummy.hpp
src/components/camera/CameraPreview.hpp
src/components/chat/ChatModel.hpp
src/components/chat-events/ChatCallModel.hpp
src/components/chat-events/ChatEvent.hpp
@ -307,7 +304,6 @@ set(HEADERS
src/components/conference/ConferenceModel.hpp
src/components/conference/ConferenceProxyModel.hpp
src/components/conferenceInfo/ConferenceInfoModel.hpp
src/components/conferenceInfo/ConferenceInfoListModel.hpp
src/components/conferenceInfo/ConferenceInfoMapModel.hpp
src/components/conferenceInfo/ConferenceInfoProxyListModel.hpp
src/components/conferenceInfo/ConferenceInfoProxyModel.hpp

View file

@ -416,7 +416,6 @@
<file>ui/views/App/Calls/Dialogs/CallSipAddress.qml</file>
<file>ui/views/App/Calls/Dialogs/CallTransfer.qml</file>
<file>ui/views/App/Calls/Dialogs/ConferenceManager.qml</file>
<file>ui/views/App/Calls/Dialogs/MultimediaParameters.qml</file>
<file>ui/views/App/Calls/EndedCall.qml</file>
<file>ui/views/App/Calls/IncallFullscreenWindow.qml</file>
<file>ui/views/App/Calls/Incall.js</file>
@ -490,7 +489,6 @@
<file>ui/views/App/Styles/Calls/Dialogs/CallSipAddressStyle.qml</file>
<file>ui/views/App/Styles/Calls/Dialogs/CallTransferStyle.qml</file>
<file>ui/views/App/Styles/Calls/Dialogs/ConferenceManagerStyle.qml</file>
<file>ui/views/App/Styles/Calls/Dialogs/MultimediaParametersStyle.qml</file>
<file>ui/views/App/Styles/Dialog/NewConferenceStyle.qml</file>
<file>ui/views/App/Styles/Main/Assistant/ActivateAppSipAccountWithEmailStyle.qml</file>
<file>ui/views/App/Styles/Main/Assistant/ActivateAppSipAccountWithPhoneNumberStyle.qml</file>

View file

@ -628,7 +628,6 @@ void App::registerTypes () {
registerType<AuthenticationNotifier>("AuthenticationNotifier");
registerType<CallsListProxyModel>("CallsListProxyModel");
registerType<Camera>("Camera");
registerType<CameraPreview>("CameraPreview");
registerType<ChatRoomProxyModel>("ChatRoomProxyModel");
registerType<ConferenceHelperModel>("ConferenceHelperModel");
registerType<ConferenceProxyModel>("ConferenceProxyModel");
@ -673,7 +672,6 @@ void App::registerTypes () {
registerUncreatableType<ImageModel>("ImageModel");
registerUncreatableType<ConferenceHelperModel::ConferenceAddModel>("ConferenceAddModel");
registerUncreatableType<ConferenceModel>("ConferenceModel");
registerUncreatableType<ConferenceInfoListModel>("ConferenceInfoListModel");
registerUncreatableType<ContactModel>("ContactModel");
registerUncreatableType<ContactsImporterModel>("ContactsImporterModel");
registerUncreatableType<ContentModel>("ContentModel");

View file

@ -46,6 +46,7 @@ public:
roles[Qt::DisplayRole+1] = "$modelKey";
return roles;
}
virtual QVariant data (const QModelIndex &index, int role = Qt::DisplayRole) const override{
int row = index.row();
auto it = mMappedList.begin() + row;
@ -57,50 +58,6 @@ public:
return QVariant();
}
/*
virtual Y getAt(const int& index) const{
mList.
return mList[index];
}*/
// Add functions
/*
virtual void add(T item){
int row = mList.count();
beginInsertRows(QModelIndex(), row, row);
mList << item;
endInsertRows();
}
virtual void prepend(T item){
beginInsertRows(QModelIndex(), 0, 0);
mList.prepend(item);
endInsertRows();
}
virtual void prepend(QList<T> items){
beginInsertRows(QModelIndex(), 0, items.size()-1);
items << mList;
mList = items;
endInsertRows();
}
// Remove functions
virtual bool removeRow (int row, const QModelIndex &parent = QModelIndex()){
return removeRows(row, 1, parent);
}
virtual bool removeRows (int row, int count, const QModelIndex &parent = QModelIndex()) override{
int limit = row + count - 1;
if (row < 0 || count < 0 || limit >= mList.count())
return false;
beginRemoveRows(parent, row, limit);
for (int i = 0; i < count; ++i)
mList.takeAt(row);
endRemoveRows();
return true;
}
*/
virtual void resetData() override{
beginResetModel();
mMappedList.clear();

View file

@ -43,20 +43,3 @@ QSharedPointer<QObject> ProxyListModel::get(QObject * itemToGet, int * index) co
}
// -----------------------------------------------------------------------------
/*
bool ProxyListModel::remove(QObject *itemToRemove) {
bool removed = false;
qInfo() << QStringLiteral("Removing ") << itemToRemove->metaObject()->className() << QStringLiteral(" : ") << itemToRemove;
int index = 0;
for(auto item : mList)
if( item.get() == itemToRemove) {
removed = removeRow(index);
break;
}else
++index;
if( !removed)
qWarning() << QStringLiteral("Unable to remove ") << itemToRemove->metaObject()->className() << QStringLiteral(" : ") << itemToRemove;
return removed;
}*/
// -----------------------------------------------------------------------------

View file

@ -41,9 +41,9 @@ public:
Q_INVOKABLE QVariant getAt(int row);
QAbstractItemModel *getModel();
void setModel(QAbstractItemModel * model);
//void add(std::shared_ptr<QObject> model);
public slots:
void add(std::shared_ptr<QAbstractItemModel> model);

View file

@ -27,7 +27,6 @@
#include "calls/CallsListModel.hpp"
#include "calls/CallsListProxyModel.hpp"
#include "camera/Camera.hpp"
#include "camera/CameraPreview.hpp"
#include "components/chat-events/ChatCallModel.hpp"
#include "components/chat-events/ChatMessageModel.hpp"
#include "components/chat-events/ChatNoticeModel.hpp"
@ -38,7 +37,6 @@
#include "conference/ConferenceModel.hpp"
#include "conference/ConferenceProxyModel.hpp"
#include "conferenceInfo/ConferenceInfoModel.hpp"
#include "conferenceInfo/ConferenceInfoListModel.hpp"
#include "conferenceInfo/ConferenceInfoProxyModel.hpp"
#include "conferenceScheduler/ConferenceScheduler.hpp"
#include "contact/ContactModel.hpp"

View file

@ -430,7 +430,7 @@ void CallModel::handleCallStateChanged (const shared_ptr<linphone::Call> &call,
break;
case linphone::Call::State::UpdatedByRemote:
qWarning() << "UpdatedByRemote :" << (mCall ? mCall->getCurrentParams()->videoEnabled() + QString(" ")+mCall->getRemoteParams()->videoEnabled() : " call NULL");
qDebug() << "UpdatedByRemote : " << (mCall ? QString( "Video enabled ? CurrentParams:") + mCall->getCurrentParams()->videoEnabled() + QString(", RemoteParams:")+mCall->getRemoteParams()->videoEnabled() : " call NULL");
if (mCall && !mCall->getCurrentParams()->videoEnabled() && mCall->getRemoteParams()->videoEnabled()) {
mCall->deferUpdate();
emit videoRequested();
@ -448,6 +448,7 @@ void CallModel::handleCallStateChanged (const shared_ptr<linphone::Call> &call,
case linphone::Call::State::Updating:
case linphone::Call::State::EarlyUpdatedByRemote:
case linphone::Call::State::EarlyUpdating:
case linphone::Call::State::PushIncomingReceived:
break;
}
@ -712,9 +713,7 @@ bool CallModel::getRemoteVideoEnabled () const {
bool CallModel::getVideoEnabled () const {
if(mCall){
shared_ptr<const linphone::CallParams> params = mCall->getCurrentParams();
bool t = params && params->videoEnabled();// && getStatus() == CallStatusConnected && mCall->getState() == linphone::Call::State::StreamsRunning;
qWarning() << t << " => " << (params && params->videoEnabled()) << ", " << (int)getStatus() << ", " << (int)mCall->getState();
return t;
return params && params->videoEnabled();
}else
return true;
}

View file

@ -198,7 +198,7 @@ void CallsListModel::launchVideoCall (const QString &sipAddress, const QString&
auto call = core->inviteAddressWithParams(address, params);
call->setSpeakerMuted(!enableSpeaker);
qWarning() << "Launch " << (enableVideo ? "video" : "audio") << " call; camera: " << enableCamera<< " speaker:" << enableSpeaker << ", micro:" << params->micEnabled() << ", layout:" << (int)layout;
qInfo() << "Launch " << (enableVideo ? "video" : "audio") << " call; camera: " << enableCamera<< " speaker:" << enableSpeaker << ", micro:" << params->micEnabled() << ", layout:" << (int)layout;
CallModel::prepareTransfert(call, prepareTransfertAddress);
}
@ -374,18 +374,6 @@ QVariantMap CallsListModel::createChatRoom(const QString& subject, const int& se
return result;
}
QVariantMap CallsListModel::createConference(ConferenceInfoModel * conferenceInfo, const int& securityLevel, const int& inviteMode, const bool& selectAfterCreation) {
QVariantMap result;
CoreManager::getInstance()->getTimelineListModel()->mAutoSelectAfterCreation = selectAfterCreation;
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
std::shared_ptr<linphone::Conference> conference;
QList< std::shared_ptr<linphone::Address>> admins;
auto timelineList = CoreManager::getInstance()->getTimelineListModel();
qInfo() << "Conference creation of " << conferenceInfo->getSubject() << " at " << securityLevel << " security";// and with " << conferenceInfo->getConferenceInfo()->getParticipants().size();
auto conferenceScheduler = core->createConferenceScheduler();
conferenceScheduler->setInfo(conferenceInfo->getConferenceInfo());
return result;
}
void CallsListModel::prepareConferenceCall(ConferenceInfoModel * model){
auto app = App::getInstance();

View file

@ -55,8 +55,6 @@ public:
QVariantMap createChatRoom(const QString& subject, const int& securityLevel, std::shared_ptr<linphone::Address> localAddress, const QVariantList& participants, const bool& selectAfterCreation) const;
Q_INVOKABLE QVariantMap createChatRoom(const QString& subject, const int& securityLevel, const QVariantList& participants, const bool& selectAfterCreation) const;
//Q_INVOKABLE QVariantMap createConference(const QString& subject, const int& securityLevel, const QVariantList& participants, const int& inviteMode, const bool& selectAfterCreation);
Q_INVOKABLE QVariantMap createConference(ConferenceInfoModel * conferenceInfo, const int& securityLevel, const int& inviteMode, const bool& selectAfterCreation);
Q_INVOKABLE void prepareConferenceCall(ConferenceInfoModel * model);

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2010-2020 Belledonne Communications SARL.
* Copyright (c) 2010-2022 Belledonne Communications SARL.
*
* This file is part of linphone-desktop
* (see https://www.linphone.org).
@ -61,7 +61,7 @@ Camera::Camera (QQuickItem *parent) : QQuickFramebufferObject(parent) {
}
Camera::~Camera(){
qWarning() << "Camera destructor" << this;
qDebug() << "Camera destructor" << this;
if(mIsPreview)
deactivatePreview();
setWindowIdLocation(None);
@ -97,7 +97,7 @@ void Camera::resetWindowId() const{
if(oldRenderer)
CoreManager::getInstance()->getCore()->setNativeVideoWindowId(NULL);
}
qWarning() << "Removed " << oldRenderer << " at " << mWindowIdLocation << " for " << this;
qDebug() << "Removed " << oldRenderer << " at " << mWindowIdLocation << " for " << this;
mIsWindowIdSet = false;
}
}
@ -141,14 +141,14 @@ QQuickFramebufferObject::Renderer *Camera::createRenderer () const {
QQuickFramebufferObject::Renderer * renderer = NULL;
if(mWindowIdLocation == CorePreview){
qWarning() << "Setting Camera to Preview";
qDebug() << "Setting Camera to Preview";
renderer=(QQuickFramebufferObject::Renderer *)CoreManager::getInstance()->getCore()->createNativePreviewWindowId();
if(renderer)
CoreManager::getInstance()->getCore()->setNativePreviewWindowId(renderer);
}else if(mWindowIdLocation == Call){
auto call = mCallModel->getCall();
if(call){
qWarning() << "Setting Camera to CallModel";
qDebug() << "Setting Camera to CallModel";
renderer = (QQuickFramebufferObject::Renderer *) call->createNativeVideoWindowId();
if(renderer)
call->setNativeVideoWindowId(renderer);
@ -156,14 +156,14 @@ QQuickFramebufferObject::Renderer *Camera::createRenderer () const {
}else if( mWindowIdLocation == Device) {
auto participantDevice = mParticipantDeviceModel->getDevice();
if(participantDevice){
qWarning() << "Setting Camera to Participant Device";
qWarning() << "Trying to create new window ID for " << participantDevice->getName().c_str() << ", addr=" << participantDevice->getAddress()->asString().c_str();
qDebug() << "Setting Camera to Participant Device";
qDebug() << "Trying to create new window ID for " << participantDevice->getName().c_str() << ", addr=" << participantDevice->getAddress()->asString().c_str();
renderer = (QQuickFramebufferObject::Renderer *) participantDevice->createNativeVideoWindowId();
if(renderer)
participantDevice->setNativeVideoWindowId(renderer);
}
}else if( mWindowIdLocation == Core){
qWarning() << "Setting Camera to Default Window";
qDebug() << "Setting Camera to Default Window";
renderer = (QQuickFramebufferObject::Renderer *) CoreManager::getInstance()->getCore()->createNativeVideoWindowId();
if(renderer)
CoreManager::getInstance()->getCore()->setNativeVideoWindowId(renderer);
@ -176,7 +176,7 @@ QQuickFramebufferObject::Renderer *Camera::createRenderer () const {
}else{
mIsWindowIdSet = true;
qWarning() << "Added " << renderer << " at " << mWindowIdLocation << " for " << this;
qDebug() << "Added " << renderer << " at " << mWindowIdLocation << " for " << this;
QTimer::singleShot(1, this, &Camera::isReady);// Workaround for const createRenderer
}
return renderer;

View file

@ -1,90 +0,0 @@
/*
* Copyright (c) 2010-2020 Belledonne Communications SARL.
*
* This file is part of linphone-desktop
* (see https://www.linphone.org).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QOpenGLFramebufferObject>
#include <QQuickWindow>
#include <QThread>
#include <QTimer>
#include "components/core/CoreManager.hpp"
#include "CameraPreview.hpp"
#include "CameraDummy.hpp"
// =============================================================================
using namespace std;
namespace {
constexpr int MaxFps = 30;
}
// -----------------------------------------------------------------------------
QMutex CameraPreview::mCounterMutex;
int CameraPreview::mCounter;
// -----------------------------------------------------------------------------
CameraPreview::CameraPreview (QQuickItem *parent) : QQuickFramebufferObject(parent) {
mCounterMutex.lock();
if (++mCounter == 1)
CoreManager::getInstance()->getCore()->enableVideoPreview(true);
mCounterMutex.unlock();
setTextureFollowsItemSize(true);
// The fbo content must be y-mirrored because the ms rendering is y-inverted.
setMirrorVertically(true);
mRefreshTimer = new QTimer(this);
mRefreshTimer->setInterval(1000 / MaxFps);
QObject::connect(
mRefreshTimer, &QTimer::timeout,
this, &QQuickFramebufferObject::update,
Qt::DirectConnection
);
mRefreshTimer->start();
}
CameraPreview::~CameraPreview () {
auto core = CoreManager::getInstance()->getCore();
if(core){
mCounterMutex.lock();
if (--mCounter == 0)
core->enableVideoPreview(false);
mCounterMutex.unlock();
core->setNativePreviewWindowId(NULL);
}
}
QQuickFramebufferObject::Renderer *CameraPreview::createRenderer () const {
QQuickFramebufferObject::Renderer * renderer = (QQuickFramebufferObject::Renderer *)CoreManager::getInstance()->getCore()->getNativePreviewWindowId();
if(renderer)
CoreManager::getInstance()->getCore()->setNativePreviewWindowId(NULL);// Reset
renderer = (QQuickFramebufferObject::Renderer *) CoreManager::getInstance()->getCore()->createNativePreviewWindowId();
if( !renderer ) {
qWarning() << "Preview stream couldn't start for Rendering. Retrying in 1s";
renderer = new CameraDummy();
QTimer::singleShot(1000, this, &CameraPreview::requestNewRenderer);
}else
CoreManager::getInstance()->getCore()->setNativePreviewWindowId(renderer);
return renderer;
}

View file

@ -1,48 +0,0 @@
/*
* Copyright (c) 2010-2020 Belledonne Communications SARL.
*
* This file is part of linphone-desktop
* (see https://www.linphone.org).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CAMERA_PREVIEW_H_
#define CAMERA_PREVIEW_H_
#include <QMutex>
#include <QQuickFramebufferObject>
// =============================================================================
class CameraPreview : public QQuickFramebufferObject {
Q_OBJECT
public:
CameraPreview (QQuickItem *parent = Q_NULLPTR);
~CameraPreview ();
QQuickFramebufferObject::Renderer *createRenderer () const override;
signals:
void requestNewRenderer();
private:
QTimer *mRefreshTimer = nullptr;
static QMutex mCounterMutex;
static int mCounter;
};
#endif // CAMERA_PREVIEW_H_

View file

@ -47,7 +47,6 @@ QSharedPointer<ChatCallModel> ChatCallModel::create(std::shared_ptr<linphone::Ca
auto model = QSharedPointer<ChatCallModel>::create(callLog, isStart, parent);
if(model ){
model->update();
model->mSelf = model;
return model;
}else
return nullptr;

View file

@ -62,7 +62,6 @@ signals:
private:
std::shared_ptr<linphone::CallLog> mCallLog;
QWeakPointer<ChatCallModel> mSelf; // Used to pass to functions that need a shared_ptr
};
Q_DECLARE_METATYPE(QSharedPointer<ChatCallModel>)
Q_DECLARE_METATYPE(ChatCallModel*)

View file

@ -50,7 +50,6 @@ ChatNoticeModel::~ChatNoticeModel(){
QSharedPointer<ChatNoticeModel> ChatNoticeModel::create(std::shared_ptr<linphone::EventLog> eventLog, QObject * parent){
auto model = QSharedPointer<ChatNoticeModel>::create(eventLog, parent);
if(model && model->update()){
model->mSelf = model;
return model;
}else
return nullptr;
@ -59,7 +58,6 @@ QSharedPointer<ChatNoticeModel> ChatNoticeModel::create(std::shared_ptr<linphone
QSharedPointer<ChatNoticeModel> ChatNoticeModel::create(NoticeType noticeType, const QDateTime& timestamp, const QString& txt, QObject * parent){
auto model = QSharedPointer<ChatNoticeModel>::create(noticeType, timestamp, txt, parent);
if(model ){
model->mSelf = model;
return model;
}else
return nullptr;

View file

@ -70,7 +70,6 @@ signals:
private:
std::shared_ptr<linphone::EventLog> mEventLog;
QWeakPointer<ChatNoticeModel> mSelf; // Used to pass to functions that need a shared_ptr
};
Q_DECLARE_METATYPE(QSharedPointer<ChatNoticeModel>)

View file

@ -285,8 +285,6 @@ private:
void handleCallStateChanged (const std::shared_ptr<linphone::Call> &call, linphone::Call::State state);
void handleCallCreated(const std::shared_ptr<linphone::Call> &call);// Count an event call
void handlePresenceStatusReceived(std::shared_ptr<linphone::Friend> contact);
//void handleIsComposingChanged (const std::shared_ptr<linphone::ChatRoom> &chatRoom);
//void handleMessageReceived (const std::shared_ptr<linphone::ChatMessage> &message);
std::shared_ptr<linphone::ChatRoom> mChatRoom;
std::shared_ptr<ChatRoomListener> mChatRoomListener; // This need to be a shared_ptr because of adding it to linphone

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2010-2020 Belledonne Communications SARL.
* Copyright (c) 2010-2022 Belledonne Communications SARL.
*
* This file is part of linphone-desktop
* (see https://www.linphone.org).
@ -180,27 +180,25 @@ bool ChatRoomProxyModel::lessThan (const QModelIndex &left, const QModelIndex &r
// -----------------------------------------------------------------------------
QString ChatRoomProxyModel::getPeerAddress () const {
return mChatRoomModel ? mChatRoomModel->getPeerAddress() : mPeerAddress;//QString("");
return mChatRoomModel ? mChatRoomModel->getPeerAddress() : mPeerAddress;
}
void ChatRoomProxyModel::setPeerAddress (const QString &peerAddress) {
mPeerAddress = peerAddress;
emit peerAddressChanged(mPeerAddress);
//reload();
}
QString ChatRoomProxyModel::getLocalAddress () const {
return mChatRoomModel ? mChatRoomModel->getLocalAddress() : mLocalAddress;//QString("");
return mChatRoomModel ? mChatRoomModel->getLocalAddress() : mLocalAddress;
}
void ChatRoomProxyModel::setLocalAddress (const QString &localAddress) {
mLocalAddress = localAddress;
emit localAddressChanged(mLocalAddress);
//reload();
}
QString ChatRoomProxyModel::getFullPeerAddress () const {
return mChatRoomModel ? mChatRoomModel->getFullPeerAddress() : mFullPeerAddress;//QString("");
return mChatRoomModel ? mChatRoomModel->getFullPeerAddress() : mFullPeerAddress;
}
void ChatRoomProxyModel::setFullPeerAddress (const QString &peerAddress) {
@ -209,7 +207,7 @@ void ChatRoomProxyModel::setFullPeerAddress (const QString &peerAddress) {
}
QString ChatRoomProxyModel::getFullLocalAddress () const {
return mChatRoomModel ? mChatRoomModel->getFullLocalAddress() : mFullLocalAddress;//QString("");
return mChatRoomModel ? mChatRoomModel->getFullLocalAddress() : mFullLocalAddress;
}
void ChatRoomProxyModel::setFullLocalAddress (const QString &localAddress) {
@ -268,7 +266,6 @@ void ChatRoomProxyModel::reload (ChatRoomModel *chatRoomModel) {
mChatRoomModel->initEntries();// This way, we don't load huge chat rooms (that lead to freeze GUI)
}
}
//invalidate();
}
void ChatRoomProxyModel::resetMessageCount(){
@ -341,7 +338,6 @@ void ChatRoomProxyModel::handleMessageReceived (const shared_ptr<linphone::ChatM
if (mChatRoomModel){
if(window && window->isActive())
mChatRoomModel->resetMessageCount();
//else if( message->getFromAddress()->weakEqual(CoreManager::getInstance()->getCore()->getDefaultAccount()->getParams()->getIdentityAddress()))
}
}

View file

@ -38,12 +38,8 @@ class ChatRoomProxyModel : public QSortFilterProxyModel {
Q_PROPERTY(QString localAddress READ getLocalAddress WRITE setLocalAddress NOTIFY localAddressChanged)
Q_PROPERTY(QString fullPeerAddress READ getFullPeerAddress WRITE setFullPeerAddress NOTIFY fullPeerAddressChanged)
Q_PROPERTY(QString fullLocalAddress READ getFullLocalAddress WRITE setFullLocalAddress NOTIFY fullLocalAddressChanged)
//Q_PROPERTY(int isSecure READ isSecure WRITE setIsSecure NOTIFY isSecureChanged)
Q_PROPERTY(ChatRoomModel *chatRoomModel READ getChatRoomModel WRITE setChatRoomModel NOTIFY chatRoomModelChanged)
//Q_PROPERTY(bool isSecure MEMBER mIsSecure NOTIFY isSecureChanged)
//Q_PROPERTY(bool isRemoteComposing READ getIsRemoteComposing NOTIFY isRemoteComposingChanged)
Q_PROPERTY(QList<QString> composers READ getComposers NOTIFY isRemoteComposingChanged)
//Q_PROPERTY(bool isSecure READ getIsSecure NOTIFY isSecureChanged)
Q_PROPERTY(QString cachedText READ getCachedText)
Q_PROPERTY(QString filterText MEMBER mFilterText WRITE setFilterText NOTIFY filterTextChanged)
@ -54,6 +50,7 @@ public:
int getEntryTypeFilter ();
Q_INVOKABLE void setEntryTypeFilter (int type);
Q_INVOKABLE void setFilterText(const QString& text);
Q_INVOKABLE QString getDisplayNameComposers()const;
Q_INVOKABLE QVariant getAt(int row);
@ -66,15 +63,10 @@ public:
Q_INVOKABLE void removeRow (int index);
Q_INVOKABLE void sendMessage (const QString &message);
Q_INVOKABLE void forwardMessage(ChatMessageModel * model);
Q_INVOKABLE void compose (const QString& text);
Q_INVOKABLE void resetMessageCount();
Q_INVOKABLE void setFilterText(const QString& text);
Q_INVOKABLE int loadTillMessage(ChatMessageModel * message);// Load all entries till message and return its index in displayed list (-1 if not found)
public slots:
@ -116,9 +108,6 @@ private:
bool markAsReadEnabled() const;
void enableMarkAsRead(const bool& enable);
//bool isSecure () const;
//void setIsSecure (const int &secure);
ChatRoomModel *getChatRoomModel() const;
void setChatRoomModel (ChatRoomModel *chatRoomModel);

View file

@ -60,7 +60,6 @@ QSharedPointer<ConferenceModel> ConferenceModel::create(std::shared_ptr<linphone
ConferenceModel::ConferenceModel (std::shared_ptr<linphone::Conference> conference, QObject *parent) : QObject(parent) {
App::getInstance()->getEngine()->setObjectOwnership(this, QQmlEngine::CppOwnership);// Avoid QML to destroy it when passing by Q_INVOKABLE
mConference = conference;
//updateLocalParticipant();
mParticipantListModel = QSharedPointer<ParticipantListModel>::create(this);
mConferenceListener = std::make_shared<ConferenceListener>();
connectTo(mConferenceListener.get());
@ -80,7 +79,7 @@ bool ConferenceModel::updateLocalParticipant(){
localParticipant = mConference->getMe();
if( localParticipant){
mLocalParticipant = QSharedPointer<ParticipantModel>::create(localParticipant);
qWarning() << "Is Admin: " << localParticipant->isAdmin() << " " << mLocalParticipant->getAdminStatus();
qDebug() << "Is Admin: " << localParticipant->isAdmin() << " " << mLocalParticipant->getAdminStatus();
changed = true;
}
return changed;
@ -104,9 +103,9 @@ qint64 ConferenceModel::getElapsedSeconds() const {
ParticipantModel* ConferenceModel::getLocalParticipant() const{
if( mLocalParticipant) {
qWarning() << "LocalParticipant admin : " << mLocalParticipant->getAdminStatus() << " " << (mLocalParticipant->getParticipant() ? mLocalParticipant->getParticipant()->isAdmin() : -1);
qDebug() << "LocalParticipant admin : " << mLocalParticipant->getAdminStatus() << " " << (mLocalParticipant->getParticipant() ? mLocalParticipant->getParticipant()->isAdmin() : -1);
}else
qWarning() << "NULL";
qDebug() << "No LocalParticipant";
return mLocalParticipant.get();
}
@ -137,7 +136,7 @@ void ConferenceModel::onParticipantRemoved(const std::shared_ptr<const linphone:
emit participantRemoved(participant);
}
void ConferenceModel::onParticipantAdminStatusChanged(const std::shared_ptr<const linphone::Participant> & participant){
qWarning() << "onParticipantAdminStatusChanged: " << participant->getAddress()->asString().c_str();
qDebug() << "onParticipantAdminStatusChanged: " << participant->getAddress()->asString().c_str();
if(participant == mLocalParticipant->getParticipant())
emit mLocalParticipant->adminStatusChanged();
emit participantAdminStatusChanged(participant);

View file

@ -1,51 +0,0 @@
/*
* Copyright (c) 2021 Belledonne Communications SARL.
*
* This file is part of linphone-desktop
* (see https://www.linphone.org).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QQmlApplicationEngine>
#include <QQuickWindow>
#include <QTimer>
#include "app/App.hpp"
#include "components/conference/ConferenceAddModel.hpp"
#include "components/conference/ConferenceHelperModel.hpp"
#include "components/core/CoreHandlers.hpp"
#include "components/core/CoreManager.hpp"
#include "components/settings/SettingsModel.hpp"
#include "utils/Utils.hpp"
#include "ConferenceInfoListModel.hpp"
#include "ConferenceInfoModel.hpp"
// =============================================================================
ConferenceInfoListModel::ConferenceInfoListModel (QObject *parent) : ProxyListModel(parent) {
//auto conferenceInfos = CoreManager::getInstance()->getCore()->getConferenceInformationList();
//for(auto conferenceInfo : conferenceInfos){
//auto conferenceInfoModel = ConferenceInfoModel::create( conferenceInfo );
//mList << conferenceInfoModel;
//mMappedList[conferenceInfoModel->getDateTime().date()].push_back(conferenceInfoModel.get());
//}
}
/*
ConferenceInfoModel* ConferenceInfoListModel::getAt(const int& index) const {
return ProxyListModel::getAt(index).objectCast<ConferenceInfoModel>().get();
}
*/
// -----------------------------------------------------------------------------

View file

@ -1,41 +0,0 @@
/*
* Copyright (c) 2021-2022 Belledonne Communications SARL.
*
* This file is part of linphone-desktop
* (see https://www.linphone.org).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _CONFERENCE_INFO_LIST_MODEL_H_
#define _CONFERENCE_INFO_LIST_MODEL_H_
#include <linphone++/linphone.hh>
#include "app/proxyModel/ProxyListModel.hpp"
#include <QDate>
// =============================================================================
class ConferenceInfoModel;
class ConferenceInfoListModel : public ProxyListModel {
Q_OBJECT
public:
ConferenceInfoListModel (QObject *parent = Q_NULLPTR);
// ConferenceInfoModel* getAt(const int& index) const;
};
Q_DECLARE_METATYPE(QList<ConferenceInfoModel*>*)
#endif

View file

@ -33,13 +33,12 @@
#include "utils/Utils.hpp"
#include "ConferenceInfoProxyModel.hpp"
#include "ConferenceInfoListModel.hpp"
#include "ConferenceInfoModel.hpp"
#include "ConferenceInfoProxyListModel.hpp"
// =============================================================================
ConferenceInfoMapModel::ConferenceInfoMapModel (QObject *parent) : ProxyAbstractMapModel<QDate,SortFilterAbstractProxyModel<ConferenceInfoListModel>*>(parent) {
ConferenceInfoMapModel::ConferenceInfoMapModel (QObject *parent) : ProxyAbstractMapModel<QDate,SortFilterAbstractProxyModel<ProxyListModel>*>(parent) {
auto conferenceInfos = CoreManager::getInstance()->getCore()->getConferenceInformationList();
auto me = CoreManager::getInstance()->getCore()->getDefaultAccount()->getParams()->getIdentityAddress();
for(auto conferenceInfo : conferenceInfos){

View file

@ -25,13 +25,12 @@
#include <QDate>
#include "app/proxyModel/ProxyAbstractMapModel.hpp"
#include "app/proxyModel/ProxyListModel.hpp"
#include "app/proxyModel/SortFilterAbstractProxyModel.hpp"
class ConferenceInfoListModel;
// =============================================================================
class ConferenceInfoMapModel : public ProxyAbstractMapModel<QDate,SortFilterAbstractProxyModel<ConferenceInfoListModel>*> {
class ConferenceInfoMapModel : public ProxyAbstractMapModel<QDate,SortFilterAbstractProxyModel<ProxyListModel>*> {
Q_OBJECT
public:

View file

@ -78,8 +78,8 @@ QSharedPointer<ConferenceInfoModel> ConferenceInfoModel::create(std::shared_ptr<
return QSharedPointer<ConferenceInfoModel>::create(conferenceInfo);
}
// Callable from QML
ConferenceInfoModel::ConferenceInfoModel (QObject * parent) : QObject(parent){
//App::getInstance()->getEngine()->setObjectOwnership(this, QQmlEngine::CppOwnership);// Avoid QML to destroy it when passing by Q_INVOKABLE
mTimeZone = QTimeZone::systemTimeZone();
mConferenceInfo = linphone::Factory::get()->createConferenceInfo();
QDateTime currentDateTime = QDateTime::currentDateTime();
@ -92,6 +92,7 @@ ConferenceInfoModel::ConferenceInfoModel (QObject * parent) : QObject(parent){
mConferenceInfo->setOrganizer(accountAddress);
}
// Callable from C++
ConferenceInfoModel::ConferenceInfoModel (std::shared_ptr<linphone::ConferenceInfo> conferenceInfo, QObject * parent) : QObject(parent){
App::getInstance()->getEngine()->setObjectOwnership(this, QQmlEngine::CppOwnership);// Avoid QML to destroy it when passing by Q_INVOKABLE
mTimeZone = QTimeZone::systemTimeZone();
@ -106,7 +107,6 @@ std::shared_ptr<linphone::ConferenceInfo> ConferenceInfoModel::getConferenceInfo
return mConferenceInfo;
}
//------------------------------------------------------------------------------------------------
@ -231,14 +231,14 @@ void ConferenceInfoModel::createConference(const int& securityLevel, const int&
CoreManager::getInstance()->getTimelineListModel()->mAutoSelectAfterCreation = false;
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
static std::shared_ptr<linphone::Conference> conference;
qInfo() << "Conference creation of " << getSubject() << " at " << securityLevel << " security, organized by " << getOrganizer();// and with " << conferenceInfo->getConferenceInfo()->getParticipants().size();
qInfo() << "Conference creation of " << getSubject() << " at " << securityLevel << " security, organized by " << getOrganizer();
if( true || isScheduled()){
mConferenceScheduler = ConferenceScheduler::create();
connect(mConferenceScheduler.get(), &ConferenceScheduler::invitationsSent, this, &ConferenceInfoModel::onInvitationsSent);
connect(mConferenceScheduler.get(), &ConferenceScheduler::stateChanged, this, &ConferenceInfoModel::onStateChanged);
mConferenceScheduler->getConferenceScheduler()->setInfo(mConferenceInfo);
}else{
}else{// TODO?
auto conferenceParameters = core->createConferenceParams(nullptr);
conferenceParameters->enableAudio(true);
conferenceParameters->enableVideo(true);
@ -247,18 +247,7 @@ void ConferenceInfoModel::createConference(const int& securityLevel, const int&
conferenceParameters->setStartTime(mConferenceInfo->getDateTime());
conferenceParameters->setEndTime(mConferenceInfo->getDateTime() + (mConferenceInfo->getDuration() * 60));
conferenceParameters->enableLocalParticipant(true);
//conferenceParameters->enableOneParticipantConference(true);
/*
if(true) {//Remote
conferenceParameters->setConferenceFactoryUri(core->getDefaultAccount()->getContactAddress()->asStringUriOnly());
}else
conferenceParameters->setConferenceFactoryUri(nullptr);
*/
conference = core->createConferenceWithParams(conferenceParameters);
//auto parameters = CoreManager::getInstance()->getCore()->createCallParams(nullptr);
//parameters->enableVideo(true);
//conference->inviteParticipants(mConferenceInfo->getParticipants(), parameters);
}
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Belledonne Communications SARL.
* Copyright (c) 2022 Belledonne Communications SARL.
*
* This file is part of linphone-desktop
* (see https://www.linphone.org).
@ -45,9 +45,7 @@ public:
Q_PROPERTY(QString displayNamesToString READ displayNamesToString NOTIFY participantsChanged)
Q_PROPERTY(QString uri READ getUri NOTIFY uriChanged)
Q_PROPERTY(bool isScheduled READ isScheduled WRITE setIsScheduled NOTIFY isScheduledChanged)
//Q_PROPERTY(participants READ getParticipants WRITE setParticipants NOTIFY participantsChanged)
static QSharedPointer<ConferenceInfoModel> create(std::shared_ptr<linphone::ConferenceInfo> conferenceInfo);
ConferenceInfoModel (QObject * parent = nullptr);
ConferenceInfoModel (std::shared_ptr<linphone::ConferenceInfo> conferenceInfo, QObject * parent = nullptr);

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Belledonne Communications SARL.
* Copyright (c) 2022 Belledonne Communications SARL.
*
* This file is part of linphone-desktop
* (see https://www.linphone.org).
@ -17,13 +17,13 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "app/proxyModel/ProxyListModel.hpp"
#include "ConferenceInfoProxyListModel.hpp"
#include "components/call/CallModel.hpp"
#include "components/core/CoreManager.hpp"
#include "ConferenceInfoListModel.hpp"
#include "ConferenceInfoMapModel.hpp"
#include "utils/Utils.hpp"
@ -35,13 +35,11 @@ using namespace std;
//---------------------------------------------------------------------------------------------
ConferenceInfoProxyListModel::ConferenceInfoProxyListModel (QObject *parent) : SortFilterAbstractProxyModel<ConferenceInfoListModel>(new ConferenceInfoListModel(parent), parent) {
//setFilterType(0);
//connect(this, &ConferenceInfoProxyListModel::filterTypeChanged, qobject_cast<ConferenceInfoListModel*>(sourceModel()), &ConferenceInfoListModel::filterTypeChanged);
ConferenceInfoProxyListModel::ConferenceInfoProxyListModel (QObject *parent) : SortFilterAbstractProxyModel<ProxyListModel>(new ProxyListModel(parent), parent) {
}
bool ConferenceInfoProxyListModel::filterAcceptsRow (int sourceRow, const QModelIndex &sourceParent) const {
auto listModel = qobject_cast<ConferenceInfoListModel*>(sourceModel());
auto listModel = qobject_cast<ProxyListModel*>(sourceModel());
if(listModel){
QModelIndex index = listModel->index(sourceRow, 0, QModelIndex());
const ConferenceInfoModel* ics = sourceModel()->data(index).value<ConferenceInfoModel*>();
@ -58,46 +56,8 @@ bool ConferenceInfoProxyListModel::filterAcceptsRow (int sourceRow, const QModel
}
}
return true;
/*
bool show = false;
QModelIndex index = sourceModel()->index(sourceRow, 0, QModelIndex());
const ConferenceInfoListModel* ics = sourceModel()->data(index).value<ConferenceInfoListModel*>();
if( mEntryTypeFilter == ConferenceType::Ended && ics->eventModel.value<ChatCallModel*>() != nullptr)
show = true;
else if( mEntryTypeFilter == ChatRoomModel::EntryType::MessageEntry && eventModel.value<ChatMessageModel*>() != nullptr)
show = true;
else if( mEntryTypeFilter == ChatRoomModel::EntryType::NoticeEntry && eventModel.value<ChatNoticeModel*>() != nullptr)
show = true;
}
if( show && mFilterText != ""){
QModelIndex index = sourceModel()->index(sourceRow, 0, sourceParent);
auto eventModel = sourceModel()->data(index);
ChatMessageModel * chatModel = eventModel.value<ChatMessageModel*>();
if( chatModel){
QRegularExpression search(QRegularExpression::escape(mFilterText), QRegularExpression::CaseInsensitiveOption | QRegularExpression::UseUnicodePropertiesOption);
show = chatModel->mContent.contains(search);
}
}
return show;*/
}
bool ConferenceInfoProxyListModel::lessThan (const QModelIndex &left, const QModelIndex &right) const {
return true;
/*
const ConferenceInfoListModel* deviceA = sourceModel()->data(left).value<ConferenceInfoListModel*>();
const ConferenceInfoListModel* deviceB = sourceModel()->data(right).value<ConferenceInfoListModel*>();
return deviceA->getAt<ConferenceInfoModel>(0)->getDateTime() < deviceB->getAt<ConferenceInfoModel>(0)->getDateTime();
*/
}
/*
QVariant ConferenceInfoProxyModel::getAt(int row){
QModelIndex sourceIndex = mapToSource(this->index(row, 0));
return sourceModel()->data(sourceIndex);
}
void ConferenceInfoProxyModel::add(QSharedPointer<ConferenceInfoModel> conferenceInfoModel){
qobject_cast<ConferenceInfoListModel*>(sourceModel())->add(conferenceInfoModel);
}*/
}

View file

@ -31,10 +31,10 @@
// =============================================================================
class QWindow;
class ConferenceInfoListModel;
class ProxyListModel;
class ConferenceInfoProxyListModel : public SortFilterAbstractProxyModel<ConferenceInfoListModel> {
class ConferenceInfoProxyListModel : public SortFilterAbstractProxyModel<ProxyListModel> {
Q_OBJECT
public:

View file

@ -24,7 +24,6 @@
#include "components/core/CoreManager.hpp"
#include "components/settings/AccountSettingsModel.hpp"
#include "ConferenceInfoListModel.hpp"
#include "ConferenceInfoMapModel.hpp"
#include "ConferenceInfoProxyListModel.hpp"
@ -61,46 +60,8 @@ bool ConferenceInfoProxyModel::filterAcceptsRow (int sourceRow, const QModelInde
return r > 0;
}
return false;
/*
bool show = false;
QModelIndex index = sourceModel()->index(sourceRow, 0, QModelIndex());
const ConferenceInfoListModel* ics = sourceModel()->data(index).value<ConferenceInfoListModel*>();
if( mEntryTypeFilter == ConferenceType::Ended && ics->eventModel.value<ChatCallModel*>() != nullptr)
show = true;
else if( mEntryTypeFilter == ChatRoomModel::EntryType::MessageEntry && eventModel.value<ChatMessageModel*>() != nullptr)
show = true;
else if( mEntryTypeFilter == ChatRoomModel::EntryType::NoticeEntry && eventModel.value<ChatNoticeModel*>() != nullptr)
show = true;
}
if( show && mFilterText != ""){
QModelIndex index = sourceModel()->index(sourceRow, 0, sourceParent);
auto eventModel = sourceModel()->data(index);
ChatMessageModel * chatModel = eventModel.value<ChatMessageModel*>();
if( chatModel){
QRegularExpression search(QRegularExpression::escape(mFilterText), QRegularExpression::CaseInsensitiveOption | QRegularExpression::UseUnicodePropertiesOption);
show = chatModel->mContent.contains(search);
}
}
return show;*/
}
bool ConferenceInfoProxyModel::lessThan (const QModelIndex &left, const QModelIndex &right) const {
return true;
/*
const ConferenceInfoListModel* deviceA = sourceModel()->data(left).value<ConferenceInfoListModel*>();
const ConferenceInfoListModel* deviceB = sourceModel()->data(right).value<ConferenceInfoListModel*>();
return deviceA->getAt<ConferenceInfoModel>(0)->getDateTime() < deviceB->getAt<ConferenceInfoModel>(0)->getDateTime();
*/
}
/*
QVariant ConferenceInfoProxyModel::getAt(int row){
QModelIndex sourceIndex = mapToSource(this->index(row, 0));
return sourceModel()->data(sourceIndex);
}
void ConferenceInfoProxyModel::add(QSharedPointer<ConferenceInfoModel> conferenceInfoModel){
qobject_cast<ConferenceInfoListModel*>(sourceModel())->add(conferenceInfoModel);
}*/
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Belledonne Communications SARL.
* Copyright (c) 2022 Belledonne Communications SARL.
*
* This file is part of linphone-desktop
* (see https://www.linphone.org).
@ -52,7 +52,7 @@ std::shared_ptr<linphone::ConferenceScheduler> ConferenceScheduler::getConferenc
}
void ConferenceScheduler::onStateChanged(linphone::ConferenceSchedulerState state) {
qWarning() << "ConferenceScheduler::onStateChanged : " << (int)state;
qDebug() << "ConferenceScheduler::onStateChanged : " << (int)state;
emit stateChanged(state);
if( state == linphone::ConferenceSchedulerState::Ready) {
std::shared_ptr<linphone::ChatRoomParams> params = CoreManager::getInstance()->getCore()->createDefaultChatRoomParams();
@ -62,6 +62,6 @@ void ConferenceScheduler::onStateChanged(linphone::ConferenceSchedulerState stat
}
void ConferenceScheduler::onInvitationsSent( const std::list<std::shared_ptr<linphone::Address>> & failedInvitations) {
qWarning() << "ConferenceScheduler::onInvitationsSent";
qDebug() << "ConferenceScheduler::onInvitationsSent";
emit invitationsSent(failedInvitations);
}

View file

@ -34,11 +34,11 @@ ConferenceSchedulerListener::~ConferenceSchedulerListener () {
void ConferenceSchedulerListener::onStateChanged(const std::shared_ptr<linphone::ConferenceScheduler> & conferenceScheduler, linphone::ConferenceSchedulerState state) {
qWarning() << "ConferenceSchedulerListener::onStateChanged" << (int) state;
qDebug() << "ConferenceSchedulerListener::onStateChanged" << (int) state;
emit stateChanged(state);
}
void ConferenceSchedulerListener::onInvitationsSent(const std::shared_ptr<linphone::ConferenceScheduler> & conferenceScheduler, const std::list<std::shared_ptr<linphone::Address>> & failedInvitations) {
qWarning() << "ConferenceSchedulerListener::onInvitationsSent";
qDebug() << "ConferenceSchedulerListener::onInvitationsSent";
emit invitationsSent(failedInvitations);
}

View file

@ -101,12 +101,6 @@ QSharedPointer<ContactModel> ContactsListModel::findContactModelFromSipAddress (
return mOptimizedSearch[sipAddress];
else
return nullptr;
/*
auto it = find_if(mList.begin(), mList.end(), [&sipAddress](ContactModel *contactModel) {
return contactModel->getVcardModel()->getSipAddresses().contains(sipAddress);
});
return it != mList.end() ? *it : nullptr;
*/
}
QSharedPointer<ContactModel> ContactsListModel::findContactModelFromUsername (const QString &username) const {

View file

@ -326,62 +326,5 @@ void CoreHandlers::onEcCalibrationResult(
//------------------------------ CONFERENCE INFO
void CoreHandlers::onConferenceInfoReceived(const std::shared_ptr<linphone::Core> & core, const std::shared_ptr<const linphone::ConferenceInfo> & conferenceInfo) {
qWarning() << "onConferenceInfoReceived";
/*
qWarning() << "onConferenceInfoReceived : sending invitation only for known participants (API fail? this should be done from SDK)";
qWarning() << "onConferenceInfoReceived : Duration: " << conferenceInfo->getDuration();
for(auto participant : conferenceInfo->getParticipants()){
std::shared_ptr<linphone::ChatRoomParams> params = core->createDefaultChatRoomParams();
std::list<std::shared_ptr<linphone::Address>> participants;
std::shared_ptr<linphone::ChatRoom> chatRoom;
chatRoom = core->searchChatRoom(params, conferenceInfo->getOrganizer()
, participant
, participants);
if(chatRoom) {
auto timeLine = CoreManager::getInstance()->getTimelineListModel()->getChatRoomModel(chatRoom, true);
if(timeLine)
timeLine->sendMessage("Conference invitation : " +QString::fromStdString(conferenceInfo->getUri()->asString()));
else
qWarning() << "Cannot use a timeline for invitation";
}else
qWarning() << "Cannot use a chatroom for invitation";
}
*/
qDebug() << "onConferenceInfoReceived (not implemented)";
}
/*
void CoreHandlers::onConferenceInfoCreated(const std::shared_ptr<linphone::Core> & core, const std::shared_ptr<const linphone::ConferenceInfo> & conferenceInfo){
qWarning() << "onConferenceInfoCreated : sending invitation only for known participants (API fail? this should be done from SDK)";
qWarning() << "onConferenceInfoCreated : Duration: " << conferenceInfo->getDuration();
for(auto participant : conferenceInfo->getParticipants()){
std::shared_ptr<linphone::ChatRoomParams> params = core->createDefaultChatRoomParams();
std::list<std::shared_ptr<linphone::Address>> participants;
std::shared_ptr<linphone::ChatRoom> chatRoom;
chatRoom = core->searchChatRoom(params, conferenceInfo->getOrganizer()
, participant
, participants);
if(chatRoom) {
auto timeLine = CoreManager::getInstance()->getTimelineListModel()->getChatRoomModel(chatRoom, true);
if(timeLine)
timeLine->sendMessage("Conference invitation : " +QString::fromStdString(conferenceInfo->getUri()->asString()));
else
qWarning() << "Cannot use a timeline for invitation";
}else
qWarning() << "Cannot use a chatroom for invitation";
}
}
void CoreHandlers::onConferenceInfoOnSent(const std::shared_ptr<linphone::Core> & core, const std::shared_ptr<const linphone::ConferenceInfo> & conferenceInfo){
qWarning() << "onConferenceInfoOnSent";
}
void CoreHandlers::onConferenceInfoParticipantSent(const std::shared_ptr<linphone::Core> & core, const std::shared_ptr<const linphone::ConferenceInfo> & conferenceInfo, const std::shared_ptr<const linphone::Address> & participant){
qWarning() << "onConferenceInfoParticipantSent";
}
void CoreHandlers::onConferenceInfoParticipantError(const std::shared_ptr<linphone::Core> & core, const std::shared_ptr<const linphone::ConferenceInfo> & conferenceInfo, const std::shared_ptr<const linphone::Address> & participant, linphone::ConferenceInfoError error){
qWarning() << "onConferenceInfoParticipantError";
}
*/

View file

@ -180,13 +180,6 @@ private:
// Conference Info
virtual void onConferenceInfoReceived(const std::shared_ptr<linphone::Core> & core, const std::shared_ptr<const linphone::ConferenceInfo> & conferenceInfo) override;
/*
virtual void onConferenceInfoCreated(const std::shared_ptr<linphone::Core> & core, const std::shared_ptr<const linphone::ConferenceInfo> & conferenceInfo);
virtual void onConferenceInfoOnSent(const std::shared_ptr<linphone::Core> & core, const std::shared_ptr<const linphone::ConferenceInfo> & conferenceInfo);
virtual void onConferenceInfoParticipantSent(const std::shared_ptr<linphone::Core> & core, const std::shared_ptr<const linphone::ConferenceInfo> & conferenceInfo, const std::shared_ptr<const linphone::Address> & participant);
virtual void onConferenceInfoParticipantError(const std::shared_ptr<linphone::Core> & core, const std::shared_ptr<const linphone::ConferenceInfo> & conferenceInfo, const std::shared_ptr<const linphone::Address> & participant, linphone::ConferenceInfoError error);
*/
};
#endif // CORE_HANDLERS_H_

View file

@ -32,8 +32,6 @@
ParticipantDeviceListModel::ParticipantDeviceListModel (std::shared_ptr<linphone::Participant> participant, QObject *parent) : ProxyListModel(parent) {
std::list<std::shared_ptr<linphone::ParticipantDevice>> devices = participant->getDevices() ;
//auto previewModel = ParticipantDeviceModel::create(nullptr, true);
//mList << previewModel;
mCallModel = nullptr;
for(auto device : devices){
auto deviceModel = ParticipantDeviceModel::create(mCallModel, device, isMe(device));
@ -47,8 +45,6 @@ ParticipantDeviceListModel::ParticipantDeviceListModel (CallModel * callModel, Q
if(callModel && callModel->isConference()) {
mCallModel = callModel;
auto conferenceModel = callModel->getConferenceSharedModel();
//auto previewModel = ParticipantDeviceModel::create(nullptr, true);
//mList << previewModel;
std::list<std::shared_ptr<linphone::ParticipantDevice>> devices = conferenceModel->getConference()->getParticipantDeviceList();
for(auto device : devices){
auto deviceModel = ParticipantDeviceModel::create(mCallModel, device, isMe(device));
@ -56,16 +52,6 @@ ParticipantDeviceListModel::ParticipantDeviceListModel (CallModel * callModel, Q
connect(deviceModel.get(), &ParticipantDeviceModel::isSpeakingChanged, this, &ParticipantDeviceListModel::onParticipantDeviceSpeaking);
mList << deviceModel;
}
/*
mList << ParticipantDeviceModel::create(callModel, true);// Add Me in device list
qWarning() << "Me devices : " << conferenceModel->getConference()->getMe()->getDevices().size();
// auto meDevices = conferenceModel->getConference()->getMe()->getDevices();
// if(meDevices.size() > 0)
std::list<std::shared_ptr<linphone::ParticipantDevice>> devices = conferenceModel->getConference()->getParticipantDeviceList();
updateDevices(devices);
qWarning() << "Instanciate Participant Device list model with " << mList.size() << " devices";
*/
connect(conferenceModel.get(), &ConferenceModel::participantAdded, this, &ParticipantDeviceListModel::onParticipantAdded);
connect(conferenceModel.get(), &ConferenceModel::participantRemoved, this, &ParticipantDeviceListModel::onParticipantRemoved);
connect(conferenceModel.get(), &ConferenceModel::participantDeviceAdded, this, &ParticipantDeviceListModel::onParticipantDeviceAdded);
@ -81,11 +67,9 @@ ParticipantDeviceListModel::ParticipantDeviceListModel (CallModel * callModel, Q
void ParticipantDeviceListModel::updateDevices(std::shared_ptr<linphone::Participant> participant){
std::list<std::shared_ptr<linphone::ParticipantDevice>> devices = participant->getDevices() ;
//auto previewModel = ParticipantDeviceModel::create(nullptr, true);
beginResetModel();
qWarning() << "Update devices from participant";
qDebug() << "Update devices from participant";
mList.clear();
//mList << previewModel;
for(auto device : devices){
auto deviceModel = ParticipantDeviceModel::create(mCallModel, device, isMe(device));
connect(this, &ParticipantDeviceListModel::securityLevelChanged, deviceModel.get(), &ParticipantDeviceModel::onSecurityLevelChanged);
@ -96,38 +80,10 @@ void ParticipantDeviceListModel::updateDevices(std::shared_ptr<linphone::Partici
}
void ParticipantDeviceListModel::updateDevices(const std::list<std::shared_ptr<linphone::ParticipantDevice>>& devices, const bool& isMe){
/*
QList<std::shared_ptr<ParticipantDeviceModel>> devicesToAdd;
//auto meDevices = mCallModel->getConferenceSharedModel()->getConference()->getMe()->getDevices();
for(auto device : devices){
auto deviceAddress = device->getAddress();
//bool isMe = false;
//for(auto meDevice : meDevices)
//isMe |= meDevice->getAddress() == deviceAddress;
//if( !isMe) {
auto exist = std::find_if(mList.begin(), mList.end(), [deviceAddress](const std::shared_ptr<ParticipantDeviceModel>& activeDevice){
return deviceAddress == activeDevice->getDevice()->getAddress();
});
if(exist == mList.end()){
auto deviceModel = ParticipantDeviceModel::create(device, isMe);
connect(this, &ParticipantDeviceListModel::securityLevelChanged, deviceModel.get(), &ParticipantDeviceModel::onSecurityLevelChanged);
devicesToAdd << deviceModel;
}
//}
}
qWarning() << "Update devices from devices : " << devicesToAdd.size();
if(devicesToAdd.size() > 0){
int row = mList.count();
beginInsertRows(QModelIndex(), row, row+devicesToAdd.size()-1);
mList << devicesToAdd;
endInsertRows();
emit countChanged();
}
*/
}
bool ParticipantDeviceListModel::add(std::shared_ptr<linphone::ParticipantDevice> deviceToAdd){
qWarning() << "Adding device " << deviceToAdd->getAddress()->asString().c_str();
qDebug() << "Adding device " << deviceToAdd->getAddress()->asString().c_str();
for(auto item : mList) {
auto deviceModel = item.objectCast<ParticipantDeviceModel>();
if(deviceModel->getDevice() == deviceToAdd) {
@ -141,7 +97,7 @@ bool ParticipantDeviceListModel::add(std::shared_ptr<linphone::ParticipantDevice
connect(this, &ParticipantDeviceListModel::securityLevelChanged, deviceModel.get(), &ParticipantDeviceModel::onSecurityLevelChanged);
connect(deviceModel.get(), &ParticipantDeviceModel::isSpeakingChanged, this, &ParticipantDeviceListModel::onParticipantDeviceSpeaking);
ProxyListModel::add<ParticipantDeviceModel>(deviceModel);
qWarning() << "Device added. Count=" << mList.count();
qDebug() << "Device added. Count=" << mList.count();
return true;
}
@ -151,7 +107,6 @@ bool ParticipantDeviceListModel::remove(std::shared_ptr<const linphone::Particip
auto device = item.objectCast<ParticipantDeviceModel>();
if( device->getDevice() == deviceToRemove){
device->updateVideoEnabled();
//device->setIsLeft(true);
removeRow(row);
return true;
}else
@ -216,7 +171,7 @@ void ParticipantDeviceListModel::onParticipantRemoved(const std::shared_ptr<cons
}
void ParticipantDeviceListModel::onParticipantDeviceAdded(const std::shared_ptr<const linphone::ParticipantDevice> & participantDevice){
qWarning() << "Adding new device : " << mList.count();
qDebug() << "Adding new device : " << mList.count();
auto conferenceModel = mCallModel->getConferenceSharedModel();
std::list<std::shared_ptr<linphone::ParticipantDevice>> devices = conferenceModel->getConference()->getParticipantDeviceList();
for(auto realParticipantDevice : devices){
@ -225,13 +180,13 @@ void ParticipantDeviceListModel::onParticipantDeviceAdded(const std::shared_ptr<
return;
}
}
qWarning() << "No participant device found from const linphone::ParticipantDevice at onParticipantDeviceAdded";
qWarning() << "No participant device found from linphone::ParticipantDevice at onParticipantDeviceAdded";
}
void ParticipantDeviceListModel::onParticipantDeviceRemoved(const std::shared_ptr<const linphone::ParticipantDevice> & participantDevice){
qWarning() << "Removing participant device : " << mList.count();
qDebug() << "Removing participant device : " << mList.count();
if(!remove(participantDevice))
qWarning() << "No participant device found from const linphone::ParticipantDevice at onParticipantDeviceRemoved";
qWarning() << "No participant device found from linphone::ParticipantDevice at onParticipantDeviceRemoved";
}
void ParticipantDeviceListModel::onParticipantDeviceJoined(const std::shared_ptr<const linphone::ParticipantDevice> & participantDevice){
@ -243,14 +198,6 @@ void ParticipantDeviceListModel::onParticipantDeviceJoined(const std::shared_ptr
}
}
onParticipantDeviceAdded(participantDevice);
/*
for(auto item : mList) {
auto device = item.objectCast<ParticipantDeviceModel>();
if(device->getDevice() == participantDevice) {
emit device->videoEnabledChanged();
return;
}
}*/
}
void ParticipantDeviceListModel::onParticipantDeviceLeft(const std::shared_ptr<const linphone::ParticipantDevice> & participantDevice){
@ -270,27 +217,6 @@ void ParticipantDeviceListModel::onConferenceStateChanged(linphone::Conference::
updateDevices(conferenceModel->getConference()->getMe()->getDevices(), true);
updateDevices(conferenceModel->getConference()->getParticipantDeviceList(), false);
}
/*
auto devices = mCallModel->getConferenceModel()->getConference()->getMe()->getDevices();
if(devices.size() > 0 && mList.size() == 1){
//qWarning() << "Adding Me in list. Count=" << mList.size();
beginInsertRows(QModelIndex(), 0, 0);
mList.push_front(ParticipantDeviceModel::create(mCallModel, true));// Add Me in device list
endInsertRows();
emit countChanged();
emit layoutChanged();
qWarning() << "M added in list. Count=" << mList.size() << ".\n\tConfVideo is enabled:" << mCallModel->getConferenceModel()->getConference()->getCurrentParams()->videoEnabled()
<< "\n\tCallVideo is enabled: " << mCallModel->getVideoEnabled();
}else
qWarning() << "Me cannot be add : no Me device.";
}else {
if(!mCallModel)
qWarning() << "Cannot add me : no call.";
else
qWarning() << "Cannot add me : No in conf.";
}
*/
}
}

View file

@ -29,22 +29,22 @@ ParticipantDeviceListener::ParticipantDeviceListener(QObject *parent) : QObject(
//--------------------------------------------------------------------
void ParticipantDeviceListener::onIsSpeakingChanged(const std::shared_ptr<linphone::ParticipantDevice> & participantDevice, bool isSpeaking) {
qWarning() << "onIsSpeakingChanged " << isSpeaking;
qDebug() << "onIsSpeakingChanged " << isSpeaking;
emit isSpeakingChanged(participantDevice, isSpeaking);
}
void ParticipantDeviceListener::onIsMuted(const std::shared_ptr<linphone::ParticipantDevice> & participantDevice, bool isMutedVar) {
qWarning() << "onIsMuted " << isMutedVar << " vs " << participantDevice->getIsMuted();
qDebug() << "onIsMuted " << isMutedVar << " vs " << participantDevice->getIsMuted();
emit isMuted(participantDevice, isMutedVar);
}
void ParticipantDeviceListener::onConferenceJoined(const std::shared_ptr<linphone::ParticipantDevice> & participantDevice) {
qWarning() << "onConferenceJoined: " << participantDevice->getAddress()->asString().c_str() << " isInConf?[" << participantDevice->isInConference() << "]";
qDebug() << "onConferenceJoined: " << participantDevice->getAddress()->asString().c_str() << " isInConf?[" << participantDevice->isInConference() << "]";
emit conferenceJoined(participantDevice);
}
void ParticipantDeviceListener::onConferenceLeft(const std::shared_ptr<linphone::ParticipantDevice> & participantDevice) {
qWarning() << "onConferenceLeft: " << participantDevice->getAddress()->asString().c_str() << " isInConf?[" << participantDevice->isInConference() << "]";
qDebug() << "onConferenceLeft: " << participantDevice->getAddress()->asString().c_str() << " isInConf?[" << participantDevice->isInConference() << "]";
emit conferenceLeft(participantDevice);
}
void ParticipantDeviceListener::onStreamCapabilityChanged(const std::shared_ptr<linphone::ParticipantDevice> & participantDevice, linphone::MediaDirection direction, linphone::StreamType streamType) {

View file

@ -36,7 +36,6 @@ class ParticipantDeviceListener : public QObject, public linphone::ParticipantDe
public:
ParticipantDeviceListener (QObject *parent = nullptr);
//void deviceSecurityLevelChanged(std::shared_ptr<const linphone::Address> device);
virtual void onIsSpeakingChanged(const std::shared_ptr<linphone::ParticipantDevice> & participantDevice, bool isSpeaking) override;
virtual void onIsMuted(const std::shared_ptr<linphone::ParticipantDevice> & participantDevice, bool isMuted) override;
virtual void onConferenceJoined(const std::shared_ptr<linphone::ParticipantDevice> & participantDevice) override;

View file

@ -52,14 +52,6 @@ ParticipantDeviceModel::ParticipantDeviceModel (CallModel * callModel, std::shar
mIsVideoEnabled = false;
updateVideoEnabled();
}
/*
ParticipantDeviceModel::ParticipantDeviceModel (CallModel * call, const bool& isMe, QObject *parent) : QObject(parent) {
App::getInstance()->getEngine()->setObjectOwnership(this, QQmlEngine::CppOwnership);// Avoid QML to destroy it when passing by Q_INVOKABLE
mIsMe = isMe;
mCall = call;
if( call)
connect(call, &CallModel::statusChanged, this, &ParticipantDeviceModel::videoEnabledChanged);
}*/
ParticipantDeviceModel::~ParticipantDeviceModel(){
if( mParticipantDevice)
@ -74,15 +66,6 @@ QSharedPointer<ParticipantDeviceModel> ParticipantDeviceModel::create(CallModel
}
return nullptr;
}
/*
std::shared_ptr<ParticipantDeviceModel> ParticipantDeviceModel::create(CallModel * call, const bool& isMe, QObject *parent){
std::shared_ptr<ParticipantDeviceModel> model = std::make_shared<ParticipantDeviceModel>(call, isMe, parent);
if(model){
model->mSelf = model;
return model;
}
return nullptr;
}*/
// -----------------------------------------------------------------------------

View file

@ -39,10 +39,8 @@ class ParticipantDeviceModel : public QObject {
public:
ParticipantDeviceModel (CallModel * callModel, std::shared_ptr<linphone::ParticipantDevice> device, const bool& isMe = false, QObject *parent = nullptr);
virtual ~ParticipantDeviceModel();
//ParticipantDeviceModel (CallModel * call, const bool& isMe = true, QObject *parent = nullptr);
static QSharedPointer<ParticipantDeviceModel> create(CallModel* callModel, std::shared_ptr<linphone::ParticipantDevice> device, const bool& isMe = false, QObject *parent = nullptr);
//static std::shared_ptr<ParticipantDeviceModel> create(CallModel * call, const bool& isMe = true, QObject *parent = nullptr);
Q_PROPERTY(QString displayName READ getDisplayName CONSTANT)
Q_PROPERTY(QString name READ getName CONSTANT)
@ -71,7 +69,6 @@ public:
void setPaused(bool paused);
void setIsSpeaking(bool speaking);
//void deviceSecurityLevelChanged(std::shared_ptr<const linphone::Address> device);
virtual void onIsSpeakingChanged(const std::shared_ptr<linphone::ParticipantDevice> & participantDevice, bool isSpeaking);
virtual void onIsMuted(const std::shared_ptr<linphone::ParticipantDevice> & participantDevice, bool isMuted);
virtual void onConferenceJoined(const std::shared_ptr<linphone::ParticipantDevice> & participantDevice);

View file

@ -40,14 +40,9 @@ bool ParticipantDeviceProxyModel::filterAcceptsRow (
Q_UNUSED(sourceRow)
Q_UNUSED(sourceParent)
auto listModel = qobject_cast<ParticipantDeviceListModel*>(sourceModel());
/*
if(mFilterType == 1 && listModel->rowCount() <= 2){
return sourceRow == 0;
}else{*/
const QModelIndex index = listModel->index(sourceRow, 0, sourceParent);
const ParticipantDeviceModel *device = index.data().value<ParticipantDeviceModel *>();
return device && (isShowMe() || !device->isMe());
//}
const QModelIndex index = listModel->index(sourceRow, 0, sourceParent);
const ParticipantDeviceModel *device = index.data().value<ParticipantDeviceModel *>();
return device && (isShowMe() || !device->isMe());
}
bool ParticipantDeviceProxyModel::lessThan (const QModelIndex &left, const QModelIndex &right) const {
@ -100,8 +95,4 @@ void ParticipantDeviceProxyModel::setShowMe(const bool& show){
}
void ParticipantDeviceProxyModel::onCountChanged(){
auto listModel = qobject_cast<ParticipantDeviceListModel*>(sourceModel());
if(mFilterType == 1 || mFilterType == 2){
//if( listModel->getCount()
}
}

View file

@ -27,6 +27,7 @@
#include <QObject>
#include <QDateTime>
#include <QString>
#include <QSharedPointer>
#include "app/proxyModel/SortFilterProxyModel.hpp"
class ParticipantDeviceListModel;

View file

@ -34,20 +34,15 @@
ParticipantListModel::ParticipantListModel (ChatRoomModel * chatRoomModel, QObject *parent) : ProxyListModel(parent) {
if( chatRoomModel) {
mChatRoomModel = chatRoomModel;//CoreManager::getInstance()->getChatRoomModel(chatRoomModel);
mChatRoomModel = chatRoomModel;
connect(mChatRoomModel, &ChatRoomModel::securityEvent, this, &ParticipantListModel::onSecurityEvent);
connect(mChatRoomModel, &ChatRoomModel::conferenceJoined, this, &ParticipantListModel::onConferenceJoined);
connect(mChatRoomModel, &ChatRoomModel::participantAdded, this, QOverload<const std::shared_ptr<const linphone::EventLog> &>::of(&ParticipantListModel::onParticipantAdded));
connect(mChatRoomModel, &ChatRoomModel::participantRemoved, this, QOverload<const std::shared_ptr<const linphone::EventLog> &>::of(&ParticipantListModel::onParticipantRemoved));
connect(mChatRoomModel, &ChatRoomModel::participantAdminStatusChanged, this, QOverload<const std::shared_ptr<const linphone::EventLog> &>::of(&ParticipantListModel::onParticipantAdminStatusChanged));
connect(mChatRoomModel, &ChatRoomModel::participantDeviceAdded, this, &ParticipantListModel::onParticipantDeviceAdded);
connect(mChatRoomModel, &ChatRoomModel::participantDeviceRemoved, this, &ParticipantListModel::onParticipantDeviceRemoved);
connect(mChatRoomModel, &ChatRoomModel::participantRegistrationSubscriptionRequested, this, &ParticipantListModel::onParticipantRegistrationSubscriptionRequested);
connect(mChatRoomModel, &ChatRoomModel::participantRegistrationUnsubscriptionRequested, this, &ParticipantListModel::onParticipantRegistrationUnsubscriptionRequested);
@ -57,16 +52,12 @@ ParticipantListModel::ParticipantListModel (ChatRoomModel * chatRoomModel, QObje
ParticipantListModel::ParticipantListModel (ConferenceModel * conferenceModel, QObject *parent) : ProxyListModel(parent) {
if( conferenceModel) {
mConferenceModel = conferenceModel;//CoreManager::getInstance()->getChatRoomModel(chatRoomModel);
mConferenceModel = conferenceModel;
connect(mConferenceModel, &ConferenceModel::participantAdded, this, QOverload<const std::shared_ptr<const linphone::Participant> &>::of(&ParticipantListModel::onParticipantAdded));
connect(mConferenceModel, &ConferenceModel::participantRemoved, this, QOverload<const std::shared_ptr<const linphone::Participant> &>::of(&ParticipantListModel::onParticipantRemoved));
connect(mConferenceModel, &ConferenceModel::participantAdminStatusChanged, this, QOverload<const std::shared_ptr<const linphone::Participant> &>::of(&ParticipantListModel::onParticipantAdminStatusChanged));
connect(mConferenceModel, &ConferenceModel::conferenceStateChanged, this, &ParticipantListModel::onStateChanged);
//connect(mConferenceModel, &ConferenceModel::participantDeviceAdded, this, &ParticipantListModel::onParticipantDeviceAdded);
//connect(mConferenceModel, &ConferenceModel::participantDeviceRemoved, this, &ParticipantListModel::onParticipantDeviceRemoved);
updateParticipants();
}
@ -149,17 +140,7 @@ void ParticipantListModel::updateParticipants () {
if( mChatRoomModel || mConferenceModel) {
bool changed = false;
auto dbParticipants = (mChatRoomModel ? mChatRoomModel->getParticipants() : mConferenceModel->getParticipantList());
/*
std::shared_ptr<linphone::Participant> me;
if( mChatRoomModel )
me = mChatRoomModel->getChatRoom()->getMe();
else if( mConferenceModel->getLocalParticipant())
me = mConferenceModel->getLocalParticipant()->getParticipant();
if(me)
dbParticipants.push_front(me);
*/
//Remove left participants
//for(auto participant : mList){
auto itParticipant = mList.begin();
while(itParticipant != mList.end()) {
auto itDbParticipant = dbParticipants.begin();
@ -303,17 +284,17 @@ void ParticipantListModel::onConferenceJoined(){
}
void ParticipantListModel::onParticipantAdded(const std::shared_ptr<const linphone::EventLog> & eventLog){
qWarning() << "onParticipantAdded event: " << eventLog->getParticipantAddress()->asString().c_str();
qDebug() << "onParticipantAdded event: " << eventLog->getParticipantAddress()->asString().c_str();
add(eventLog->getParticipantAddress());
}
void ParticipantListModel::onParticipantAdded(const std::shared_ptr<const linphone::Participant> & participant){
qWarning() << "onParticipantAdded part: " << participant->getAddress()->asString().c_str();
qDebug() << "onParticipantAdded part: " << participant->getAddress()->asString().c_str();
add(participant);
}
void ParticipantListModel::onParticipantAdded(const std::shared_ptr<const linphone::Address>& address){
qWarning() << "onParticipantAdded addr: " << address->asString().c_str();
qDebug() << "onParticipantAdded addr: " << address->asString().c_str();
add(address);
}

View file

@ -52,6 +52,7 @@ public:
void add(const std::shared_ptr<const linphone::Participant> & participant);
void add(const std::shared_ptr<const linphone::Address> & participantAddress);
void updateParticipants(); // Update list from Chat Room
// Remove a chatroom
Q_INVOKABLE void remove (ParticipantModel *importer);
Q_INVOKABLE ChatRoomModel* getChatRoomModel() const;

View file

@ -76,7 +76,6 @@ QDateTime ParticipantModel::getCreationTime() const{
return (mParticipant ? QDateTime::fromSecsSinceEpoch(mParticipant->getCreationTime()) : QDateTime::currentDateTime());
}
//std::list<std::shared_ptr<linphone::ParticipantDevice>> ParticipantModel::getDevices() const;
bool ParticipantModel::getAdminStatus() const{
return (mParticipant ? mParticipant->isAdmin() : mAdminStatus);
}

View file

@ -53,7 +53,6 @@ public:
ContactModel *getContactModel() const;
QString getSipAddress() const;
QDateTime getCreationTime() const;
//std::list<std::shared_ptr<linphone::ParticipantDevice>> getDevices() const;
bool getAdminStatus() const;
bool isFocus() const;
int getSecurityLevel() const;
@ -69,8 +68,6 @@ public:
std::shared_ptr<linphone::Participant> getParticipant();
Q_INVOKABLE ParticipantDeviceProxyModel * getProxyDevices();
QSharedPointer<ParticipantDeviceListModel> getParticipantDevices();
//linphone::ChatRoomSecurityLevel getSecurityLevel() const;
//std::shared_ptr<linphone::ParticipantDevice> findDevice(const std::shared_ptr<const linphone::Address> & address) const;
void startInvitation(const int& secondes = 30); // Start a timer to remove the model if the invitation didn't ended after some time
@ -91,9 +88,6 @@ signals:
void invitationTimeout(ParticipantModel* model);
// void contactUpdated ();
private:
std::shared_ptr<linphone::Participant> mParticipant;
@ -104,7 +98,6 @@ private:
bool mAdminStatus;
};
//Q_DECLARE_METATYPE(ParticipantModel *);
Q_DECLARE_METATYPE(QSharedPointer<ParticipantModel>);
#endif // PARTICIPANT_MODEL_H_

View file

@ -144,7 +144,6 @@ void ParticipantProxyModel::addAddress(const QString& address){
participant->startInvitation();
}
if( mConferenceModel && mConferenceModel->getConference()){
//mConferenceModel->getConference()->addParticipant(Utils::interpretUrl(address));
std::list<std::shared_ptr<linphone::Address>> addressesToInvite;
addressesToInvite.push_back(Utils::interpretUrl(address));
auto callParameters = CoreManager::getInstance()->getCore()->createCallParams(mConferenceModel->getConference()->getCall());
@ -182,8 +181,6 @@ bool ParticipantProxyModel::filterAcceptsRow (int sourceRow, const QModelIndex &
const ParticipantModel* a = sourceModel()->data(sourceModel()->index(sourceRow, 0, sourceParent)).value<ParticipantModel*>();
return !a->isMe();
}
//const QModelIndex index = sourceModel()->index(sourceRow, 0, sourceParent);
//return true;
}
bool ParticipantProxyModel::lessThan (const QModelIndex &left, const QModelIndex &right) const {

View file

@ -62,7 +62,7 @@ SearchSipAddressesModel::~SearchSipAddressesModel(){
// -----------------------------------------------------------------------------
void SearchSipAddressesModel::setFilter(const QString& filter){
mMagicSearch->getContactListFromFilterAsync(filter.toStdString(),"");
mMagicSearch->getContactsListAsync(filter.toStdString(),"", (int)linphone::MagicSearchSource::All, linphone::MagicSearchAggregation::None);
//searchReceived(mMagicSearch->getContactListFromFilter(Utils::appStringToCoreString(filter),"")); // Just to show how to use sync method
}

View file

@ -42,7 +42,6 @@ public:
Q_INVOKABLE void setFilter (const QString &pattern);
//QList<std::shared_ptr<SearchResultModel> > mAddresses;
// And instance of Magic search
std::shared_ptr<linphone::MagicSearch> mMagicSearch;
// Callback when searching

View file

@ -60,17 +60,19 @@ SettingsModel::SettingsModel (QObject *parent) : QObject(parent) {
configureRlsUri();
}
SettingsModel::~SettingsModel()
{
if(mSimpleCaptureGraph )
{
if(mSimpleCaptureGraph ) {
delete mSimpleCaptureGraph;
mSimpleCaptureGraph = nullptr;
}
}
void SettingsModel::settingsWindowClosing(void) {
onSettingsTabChanged(-1);
}
//Provides tabbar per-tab setup/teardown mechanism for specific settings views
void SettingsModel::onSettingsTabChanged(int idx) {
int prevIdx = mCurrentSettingsTab;

View file

@ -239,6 +239,7 @@ bool SipAddressesModel::sipAddressIsValid (const QString &sipAddress) {
shared_ptr<linphone::Address> address = linphone::Factory::get()->createAddress(Utils::appStringToCoreString(sipAddress));
return address && !address->getUsername().empty();
}
// Return at most : sip:username@domain
QString SipAddressesModel::cleanSipAddress (const QString &sipAddress) {
return Utils::cleanSipAddress(sipAddress);
@ -289,6 +290,7 @@ void SipAddressesModel::handleHistoryModelCreated (HistoryModel *historyModel) {
handleAllCallCountReset();
});
}
void SipAddressesModel::handleContactAdded (QSharedPointer<ContactModel> contact) {
for (const auto &sipAddress : contact->getVcardModel()->getSipAddresses()) {
addOrUpdateSipAddress(sipAddress.toString(), contact);
@ -412,6 +414,7 @@ void SipAddressesModel::handleLastEntryRemoved (ChatRoomModel *chatRoomModel) {
it2->timestamp = map["timestamp"].toDateTime();
emit dataChanged(index(row, 0), index(row, 0));
}
void SipAddressesModel::handleAllCallCountReset () {
for( auto peer = mPeerAddressToSipAddressEntry.begin() ; peer != mPeerAddressToSipAddressEntry.end() ; ++peer){
for( auto local = peer->localAddressToConferenceEntry.begin() ; local != peer->localAddressToConferenceEntry.end() ; ++local){
@ -422,6 +425,7 @@ void SipAddressesModel::handleAllCallCountReset () {
emit dataChanged(index(row, 0), index(row, 0));
}
}
void SipAddressesModel::handleMessageCountReset (ChatRoomModel *chatRoomModel) {
const QString &peerAddress = Utils::cleanSipAddress(chatRoomModel->getPeerAddress());
auto it = mPeerAddressToSipAddressEntry.find(peerAddress);

View file

@ -34,7 +34,6 @@ class SipAddressesSorter : public QObject{
public:
SipAddressesSorter (QObject *parent = Q_NULLPTR);
//static bool lessThan( const QString& filter, const QVariantMap &left, const QVariantMap &right);
static bool lessThan (const QString& filter, const SearchResultModel *left, const SearchResultModel *right);
private:

View file

@ -27,22 +27,22 @@
// =============================================================================
class TelephoneNumbersModel : public QAbstractListModel {
Q_OBJECT;
Q_PROPERTY(int defaultIndex READ getDefaultIndex CONSTANT);
Q_OBJECT
Q_PROPERTY(int defaultIndex READ getDefaultIndex CONSTANT)
public:
TelephoneNumbersModel (QObject *parent = Q_NULLPTR);
int rowCount (const QModelIndex &index = QModelIndex()) const override;
QHash<int, QByteArray> roleNames () const override;
QVariant data (const QModelIndex &index, int role = Qt::DisplayRole) const override;
TelephoneNumbersModel (QObject *parent = Q_NULLPTR);
int rowCount (const QModelIndex &index = QModelIndex()) const override;
QHash<int, QByteArray> roleNames () const override;
QVariant data (const QModelIndex &index, int role = Qt::DisplayRole) const override;
private:
int getDefaultIndex () const;
static const QList<QPair<QLocale::Country, QString>> mCountryCodes;
int getDefaultIndex () const;
static const QList<QPair<QLocale::Country, QString>> mCountryCodes;
};
#endif // ifndef TELEPHONE_NUMBERS_MODEL_H_

View file

@ -111,37 +111,16 @@ QSharedPointer<TimelineModel> TimelineListModel::getTimeline(std::shared_ptr<lin
if(create){
QSharedPointer<TimelineModel> model = TimelineModel::create(chatRoom);
if(model){
//std::shared_ptr<TimelineModel> model = std::make_shared<TimelineModel>(chatRoom);
connect(model.get(), SIGNAL(selectedChanged(bool)), this, SLOT(onSelectedHasChanged(bool)));
connect(model->getChatRoomModel(), &ChatRoomModel::allEntriesRemoved, this, &TimelineListModel::removeChatRoomModel);
add(model);
//connect(model.get(), SIGNAL(conferenceLeft()), this, SLOT(selectedHasChanged(bool)));
return model;
}
}
}
return nullptr;
}
/*
std::shared_ptr<TimelineModel> TimelineListModel::getTimeline(std::shared_ptr<linphone::Conference> conference, const bool &create){
if(chatRoom){
for(auto it = mList.begin() ; it != mList.end() ; ++it){
if( (*it)->isConference() && (*it)->getConferenceModel()->getConference() == conference){
return *it;
}
}
if(create){
std::shared_ptr<TimelineModel> model = TimelineModel::create(conference);
//std::shared_ptr<TimelineModel> model = std::make_shared<TimelineModel>(chatRoom);
connect(model.get(), SIGNAL(selectedChanged(bool)), this, SLOT(onSelectedHasChanged(bool)));
//connect(model->getConferenceModel(), &ChatRoomModel::allEntriesRemoved, this, &TimelineListModel::removeChatRoomModel);
add(model);
return model;
}
}
return nullptr;
}
*/
QVariantList TimelineListModel::getLastChatRooms(const int& maxCount) const{
QVariantList contacts;
QMultiMap<qint64, ChatRoomModel*> sortedData;
@ -182,8 +161,6 @@ QSharedPointer<ChatRoomModel> TimelineListModel::getChatRoomModel(std::shared_pt
if(model){
connect(model.get(), SIGNAL(selectedChanged(bool)), this, SLOT(onSelectedHasChanged(bool)));
connect(model->getChatRoomModel(), &ChatRoomModel::allEntriesRemoved, this, &TimelineListModel::removeChatRoomModel);
//connect(model.get(), SIGNAL(conferenceLeft()), this, SLOT(selectedHasChanged(bool)));
add(model);
return model->mChatRoomModel;
}
@ -388,8 +365,3 @@ void TimelineListModel::onCallCreated(const std::shared_ptr<linphone::Call> &cal
}
}
}
/*
void TimelineListModel::onConferenceLeft(const std::shared_ptr<linphone::ChatRoom> &chatRoom, , const std::shared_ptr<const linphone::EventLog> & eventLog){
remove(getTimeline(chatRoom, false).get());
}*/

View file

@ -44,7 +44,6 @@ public:
void selectAll(const bool& selected);
TimelineModel * getAt(const int& index);
QSharedPointer<TimelineModel> getTimeline(std::shared_ptr<linphone::ChatRoom> chatRoom, const bool &create);
//std::shared_ptr<TimelineModel> getTimeline(std::shared_ptr<linphone::Conference> chatRoom, const bool &create);
Q_INVOKABLE QVariantList getLastChatRooms(const int& maxCount) const;
QSharedPointer<ChatRoomModel> getChatRoomModel(std::shared_ptr<linphone::ChatRoom> chatRoom, const bool &create);
QSharedPointer<ChatRoomModel> getChatRoomModel(ChatRoomModel * chatRoom);
@ -64,9 +63,6 @@ public slots:
void onChatRoomStateChanged(const std::shared_ptr<linphone::ChatRoom> &chatRoom,linphone::ChatRoom::State state);
void onCallStateChanged (const std::shared_ptr<linphone::Call> &call, linphone::Call::State state) ;
void onCallCreated(const std::shared_ptr<linphone::Call> &call);
//void onConferenceLeft();
signals:
void countChanged();

View file

@ -46,11 +46,6 @@ public:
Q_PROPERTY(QString fullLocalAddress READ getFullLocalAddress NOTIFY fullLocalAddressChanged)
Q_PROPERTY(ChatRoomModel* chatRoomModel READ getChatRoomModel CONSTANT)
// Contact
//Q_PROPERTY(QString sipAddress READ getFullPeerAddress NOTIFY fullPeerAddressChanged)
//Q_PROPERTY(QString username READ getUsername NOTIFY usernameChanged)
//Q_PROPERTY(QString avatar READ getAvatar NOTIFY avatarChanged)
//Q_PROPERTY(int presenceStatus READ getPresenceStatus NOTIFY presenceStatusChanged)
Q_PROPERTY(bool selected MEMBER mSelected WRITE setSelected NOTIFY selectedChanged)
@ -99,7 +94,6 @@ public:
public slots:
void updateUnreadCount();
void onDefaultAccountChanged();
//void chatRoomDeleted();
signals:
void fullPeerAddressChanged();

View file

@ -49,12 +49,10 @@ TimelineProxyModel::TimelineProxyModel (QObject *parent) : QSortFilterProxyModel
QObject::connect(accountSettingsModel, &AccountSettingsModel::defaultAccountChanged, this, [this]() {
qobject_cast<TimelineListModel*>(sourceModel())->update();
invalidate();
//updateCurrentSelection();
});
QObject::connect(coreManager->getSipAddressesModel(), &SipAddressesModel::sipAddressReset, this, [this]() {
qobject_cast<TimelineListModel*>(sourceModel())->reset();
invalidate();// Invalidate and reload GUI if the model has been reset
//updateCurrentSelection();
});
setSourceModel(model);

View file

@ -54,7 +54,6 @@ public:
Q_INVOKABLE void unselectAll();
Q_INVOKABLE void setFilterFlags(const int& filterFlags);
Q_INVOKABLE void setFilterText(const QString& text);
//Q_INVOKABLE TimelineModel * getTimeline();
signals:
void countChanged();
@ -75,9 +74,6 @@ protected:
private:
int mFilterFlags = 0;
QString mFilterText;
//std::shared_ptr<ChatRoomModel> mCurrentChatRoomModel;
};
#endif // TIMELINE_PROXY_MODEL_H_

View file

@ -39,7 +39,6 @@ Item {
}
color: DialogStyle.description.color
//font.pointSize: DialogStyle.description.pointSize
font.pointSize: !flat ? Units.dp * 10 : Units.dp * 14
font.weight: !flat ? Font.Normal : Font.Bold
horizontalAlignment: Text.AlignHCenter

View file

@ -67,8 +67,8 @@ Item {
// ---------------------------------------------------------------------------
height: button.contentItem.implicitHeight + 25//AbstractTextButtonStyle.background.height
width: button.contentItem.implicitWidth +60 //AbstractTextButtonStyle.background.width
height: button.contentItem.implicitHeight + 25
width: button.contentItem.implicitWidth + 60
// ---------------------------------------------------------------------------
@ -91,7 +91,6 @@ Item {
capitalization: button.capitalization
}
wrapMode: Text.WordWrap
//elide: Text.ElideRight
horizontalAlignment: Text.AlignHCenter
text: button.text
verticalAlignment: Text.AlignVCenter

View file

@ -5,62 +5,64 @@ import Common.Styles 1.0
// =============================================================================
Row {
id: item
// ---------------------------------------------------------------------------
property int selectedButton: 0
property var texts
// ---------------------------------------------------------------------------
// Emitted when the selected button is changed.
// Gives the selected button id.
signal clicked (int button)
// ---------------------------------------------------------------------------
spacing: ExclusiveButtonsStyle.buttonsSpacing
Keys.onLeftPressed: {
if (selectedButton > 0) {
clicked(--selectedButton)
}
}
Keys.onRightPressed: {
if (selectedButton < repeater.count - 1) {
clicked(++selectedButton)
}
}
// ---------------------------------------------------------------------------
Repeater {
id: repeater
model: texts
SmallButton {
anchors.verticalCenter: parent.verticalCenter
backgroundColor: selectedButton === index
? ExclusiveButtonsStyle.button.color.selected
: (down
? ExclusiveButtonsStyle.button.color.pressed
: (hovered
? ExclusiveButtonsStyle.button.color.hovered
: ExclusiveButtonsStyle.button.color.normal
)
)
text: modelData
radius: height/2
onClicked: {
if (selectedButton !== index) {
selectedButton = index
item.clicked(index)
}
}
}
}
id: item
// ---------------------------------------------------------------------------
property int selectedButton: 0
property var texts
property int capitalization
// ---------------------------------------------------------------------------
// Emitted when the selected button is changed.
// Gives the selected button id.
signal clicked (int button)
// ---------------------------------------------------------------------------
spacing: ExclusiveButtonsStyle.buttonsSpacing
Keys.onLeftPressed: {
if (selectedButton > 0) {
clicked(--selectedButton)
}
}
Keys.onRightPressed: {
if (selectedButton < repeater.count - 1) {
clicked(++selectedButton)
}
}
// ---------------------------------------------------------------------------
Repeater {
id: repeater
model: texts
SmallButton {
capitalization: item.capitalization
anchors.verticalCenter: parent.verticalCenter
backgroundColor: selectedButton === index
? ExclusiveButtonsStyle.button.color.selected
: (down
? ExclusiveButtonsStyle.button.color.pressed
: (hovered
? ExclusiveButtonsStyle.button.color.hovered
: ExclusiveButtonsStyle.button.color.normal
)
)
text: modelData
radius: height/2
onClicked: {
if (selectedButton !== index) {
selectedButton = index
item.clicked(index)
}
}
}
}
}

View file

@ -11,6 +11,7 @@ Button {
property alias backgroundColor: background.color
property alias radius: background.radius
property int capitalization
background: Rectangle {
id: background
@ -28,6 +29,7 @@ Button {
color: SmallButtonStyle.text.color
font.pointSize: SmallButtonStyle.text.pointSize
font.weight: Font.Bold
font.capitalization: button.capitalization
horizontalAlignment: Text.AlignHCenter
text: button.text
verticalAlignment: Text.AlignVCenter

View file

@ -23,7 +23,7 @@ Controls.ComboBox {
property var rootItem
property int yPopup: rootItem ? -mapToItem(rootItem,x,y).y : height + 1
property int maxPopupHeight : rootItem ? rootItem.height : 400
property int selectionWidth: width
clip: true
@ -92,44 +92,19 @@ Controls.ComboBox {
}
// ---------------------------------------------------------------------------
/*
delegate: CommonItemDelegate {
id: item
clip: true
container: comboBox
flattenedModel: comboBox.textRole.length &&
(typeof modelData !== 'undefined' ? modelData : model)
itemIcon: Logic.getItemIcon(item)
width: comboBox.selectionWidth
onWidthChanged: console.log(width)
}*/
popup: Controls.Popup{
y: comboBox.yPopup
width: comboBox.selectionWidth
//height: comboBox.maxPopupHeight
//height: contentItem.contentHeight
implicitHeight: contentItem.contentHeight
topPadding: 0
bottomPadding: 0
leftPadding: 0
rightPadding: 0
contentItem: ListItemSelector{
//implicitHeight: contentHeight
model: comboBox.popup.visible ? comboBox.model : null
currentIndex: comboBox.highlightedIndex
textRole: comboBox.textRole
onActivated: {comboBox.activated(index);comboBox.currentIndex = index;comboBox.popup.close()}
/*
delegate: CommonItemDelegate {
id: item
clip: true
container: comboBox
flattenedModel: comboBox.textRole.length &&
(typeof modelData !== 'undefined' ? modelData : model)
itemIcon: Logic.getItemIcon(item)
width: comboBox.selectionWidth
onWidthChanged: console.log(width)
}*/
}
}
}

View file

@ -13,11 +13,9 @@ ScrollableListViewField {
property alias model: view.model
property alias textRole: view.textRole
property alias contentHeight: view.contentHeight
//property alias implicitHeight: view.implicitHeight
//implicitHeight: view.implicitHeight
signal activated (int index)
color: 'red'
radius: 0
ScrollableListView {
id: view

View file

@ -15,27 +15,17 @@ ColumnLayout{
property bool squaredDisplay: false
function appendItem(item){
console.log("Adding "+item)
mainLayout.delegateModel.model.append(item)
/*
if( bottomRowList.model.count < grid.columns - 1)
bottomRowList.model.append(item)
else
while(bottomRowList.model.count > 0 && tryToAdd(bottomRowList.model.get(0))){
bottomRowList.model.remove(0,1)
}*/
}
function add(item){
if( !grid.isLayoutWillChanged() || !transitionningTimer.running)
//grid.model.append(item)
appendItem(item)
else
bufferModels.append(item)
}
function remove(index){
console.log("Removing at "+index)
if(mainLayout.delegateModel.model.count > index)
mainLayout.delegateModel.model.remove( index, 1)
}
@ -78,11 +68,6 @@ ColumnLayout{
}
}
/*
Item{// Spacer
Layout.fillWidth: true
Layout.fillHeight: true
}*/
GridView{
id: grid
property int margin: 10
@ -109,27 +94,14 @@ ColumnLayout{
return columns !== getColumnCount(itemCount+1) || rows !== getRowCount(itemCount+1)
}
//Layout.fillHeight: true
//Layout.fillWidth: true
Layout.preferredWidth: cellWidth * columns
Layout.preferredHeight: cellHeight * rows
Layout.alignment: Qt.AlignCenter
interactive: false
model: DelegateModel{}
/*
model: ListModel{}
//delegate: internalComponent
delegate: Component{
Loader{
property int modelIndex: index
height: grid.cellHeight-5
width: grid.cellWidth-5
sourceComponent: mainLayout.delegate
}
}*/
//------------------- ANIMATIONS
//------------------- ANIMATIONS
property Transition defaultTransition: Transition {
SequentialAnimation {
ScriptAction {
@ -184,41 +156,6 @@ ColumnLayout{
}
onItemCountChanged: {
updateLayoutDelay.restart()
console.log("Mosaic "+model+" itemCount: " +itemCount +" => " + (model.count ? " count="+model.count :( model.length ? " length":" no" )))
}
}/*
Item{// Spacer
Layout.fillWidth: true
Layout.fillHeight: true
}*/
/*
ListView{
id: bottomRowList
Layout.preferredWidth: grid.cellWidth * model.count
Layout.preferredHeight: grid.cellHeight
Layout.alignment: Qt.AlignCenter
orientation: Qt.Horizontal
model: ListModel{}
delegate: Component{
Loader{
property int modelIndex: index
height: grid.cellHeight - 5
width: grid.cellWidth - 5
sourceComponent: mainLayout.delegate
}
}*/
/*
delegate:Rectangle{
width: grid.cellWidth
height: grid.cellHeight
onWidthChanged: console.log(width)
onHeightChanged: console.log(height)
color: '#'+ Math.floor(Math.random()*255).toString(16)
+Math.floor(Math.random()*255).toString(16)
+Math.floor(Math.random()*255).toString(16)
}*/
//}
}
}

View file

@ -20,8 +20,6 @@ Control.RadioButton{
indicator: Rectangle {
height: fontMetrics.height - 5
width: height
//onHeightChanged: height = fontMetrics.height - 5
//onWidthChanged: width = fontMetrics.height - 5
x: parent.leftPadding
y: parent.height / 2 - height / 2
radius: width/2

View file

@ -23,299 +23,298 @@ import Utils 1.0
// =============================================================================
Item {
id: container
// ---------------------------------------------------------------------------
property alias childA: contentA.data
property alias childAItem: contentA
property alias childB: contentB.data
property bool defaultClosed: false
property bool resizeAInPriority: false
property int closingEdge: Qt.LeftEdge // `LeftEdge` or `RightEdge`.
property int defaultChildAWidth
// User limits: string or int values.
// By default: no limits.
property var maximumLeftLimit
property var maximumRightLimit
property var minimumLeftLimit: 0
property var minimumRightLimit: 0
property bool _isClosed
// Internal limits.
property var _maximumLeftLimit
property var _maximumRightLimit
property var _minimumLeftLimit
property var _minimumRightLimit
// ---------------------------------------------------------------------------
// Public functions.
// ---------------------------------------------------------------------------
function isClosed () {
return _isClosed
}
function open () {
if (_isClosed) {
openingTransition.running = true
}
}
function close () {
if (!_isClosed) {
_close()
}
}
// ---------------------------------------------------------------------------
// Private functions.
// ---------------------------------------------------------------------------
function _getLimitValue (limit) {
if (limit == null) {
return
}
return limit.isDynamic
? width * limit.value
: limit.value
}
function _parseLimit (limit) {
if (limit == null) {
return
}
if (Utils.isString(limit)) {
var arr = limit.split('%')
if (arr[1] === '') {
return {
isDynamic: true,
value: +arr[0] / 100
}
}
}
return {
value: limit
}
}
function _applyLimits () {
var maximumLeftLimit = _getLimitValue(_maximumLeftLimit)
var maximumRightLimit = _getLimitValue(_maximumRightLimit)
var minimumLeftLimit = _getLimitValue(_minimumLeftLimit)
var minimumRightLimit = _getLimitValue(_minimumRightLimit)
var theoreticalBWidth = container.width - contentA.width - handle.width
// If closed, set correctly the handle position to left or right.
if (_isClosed) {
contentA.width = (closingEdge !== Qt.LeftEdge)
? container.width - handle.width
: 0
}
// width(A) < minimum width(A).
else if (contentA.width < minimumLeftLimit) {
contentA.width = minimumLeftLimit
}
// width(A) > maximum width(A).
else if (maximumLeftLimit != null && contentA.width > maximumLeftLimit) {
contentA.width = maximumLeftLimit
}
// width(B) < minimum width(B).
else if (theoreticalBWidth < minimumRightLimit) {
contentA.width = container.width - handle.width - minimumRightLimit
}
// width(B) > maximum width(B).
else if (maximumRightLimit != null && theoreticalBWidth > maximumRightLimit) {
contentA.width = container.width - handle.width - maximumRightLimit
} else if (resizeAInPriority) {
contentA.width = container.width - handle.width - contentB.width
}
}
// ---------------------------------------------------------------------------
function _applyLimitsOnUserMove (offset) {
var minimumRightLimit = _getLimitValue(_minimumRightLimit)
var minimumLeftLimit = _getLimitValue(_minimumLeftLimit)
// One area is closed.
if (_isClosed) {
if (closingEdge === Qt.LeftEdge) {
if (offset > minimumLeftLimit / 2) {
_open()
}
} else {
if (-offset > minimumRightLimit / 2) {
_open()
}
}
return
}
// Check limits.
var maximumLeftLimit = _getLimitValue(_maximumLeftLimit)
var maximumRightLimit = _getLimitValue(_maximumRightLimit)
var theoreticalBWidth = container.width - offset - contentA.width - handle.width
// width(A) < minimum width(A).
if (contentA.width + offset < minimumLeftLimit) {
contentA.width = minimumLeftLimit
if (closingEdge === Qt.LeftEdge && -offset > minimumLeftLimit / 2) {
if (_isClosed) {
_open()
} else {
_close()
}
}
}
// width(A) > maximum width(A).
else if (maximumLeftLimit != null && contentA.width + offset > maximumLeftLimit) {
contentA.width = maximumLeftLimit
}
// width(B) < minimum width(B).
else if (theoreticalBWidth < minimumRightLimit) {
contentA.width = container.width - handle.width - minimumRightLimit
if (closingEdge !== Qt.LeftEdge && offset > minimumRightLimit / 2) {
if (_isClosed) {
_open()
} else {
_close()
}
}
}
// width(B) > maximum width(B).
else if (maximumRightLimit != null && theoreticalBWidth > maximumRightLimit) {
contentA.width = container.width - handle.width - maximumRightLimit
}
// Resize A/B.
else {
contentA.width = contentA.width + offset
}
}
// ---------------------------------------------------------------------------
function _open () {
_isClosed = false
_applyLimits()
}
function _close () {
_isClosed = true
closingTransition.running = true
}
function _inverseClosingState () {
if (!_isClosed) {
// Save state and close.
_close()
} else {
// Restore old state.
openingTransition.running = true
}
}
function _isVisible (edge) {
return (
!_isClosed ||
openingTransition.running ||
closingTransition.running
) || closingEdge !== edge
}
// ---------------------------------------------------------------------------
onWidthChanged: _applyLimits()
Component.onCompleted: {
// Unable to modify these properties after creation.
// It's a desired choice.
_maximumLeftLimit = _parseLimit(maximumLeftLimit)
_maximumRightLimit = _parseLimit(maximumRightLimit)
_minimumLeftLimit = _parseLimit(minimumLeftLimit)
_minimumRightLimit = _parseLimit(minimumRightLimit)
contentA.width = (defaultChildAWidth == null)
? _getLimitValue(_minimumLeftLimit)
: defaultChildAWidth
_isClosed = defaultClosed
}
Item {
id: contentA
height: parent.height
visible: _isVisible(Qt.LeftEdge)
onVisibleChanged: console.log(visible)
}
MouseArea {
id: handle
property int _mouseStart
anchors.left: contentA.right
cursorShape: Qt.SplitHCursor
height: parent.height
hoverEnabled: true
width: PanedStyle.handle.width
onDoubleClicked: _inverseClosingState()
onMouseXChanged: pressed &&
_applyLimitsOnUserMove(mouseX - _mouseStart)
onPressed: _mouseStart = mouseX
Rectangle {
anchors.fill: parent
color: parent.pressed
? PanedStyle.handle.color.pressed
: (parent.containsMouse
? PanedStyle.handle.color.hovered
: PanedStyle.handle.color.normal
)
}
}
Item {
id: contentB
anchors.left: handle.right
height: parent.height
visible: _isVisible(Qt.RightEdge)
width: container.width - contentA.width - handle.width
}
PropertyAnimation {
id: openingTransition
duration: PanedStyle.transitionDuration
property: 'width'
target: contentA
to: closingEdge === Qt.LeftEdge
? minimumLeftLimit
: container.width - minimumRightLimit - handle.width
onRunningChanged: !running && _open()
}
PropertyAnimation {
id: closingTransition
duration: PanedStyle.transitionDuration
property: 'width'
target: contentA
to: closingEdge === Qt.LeftEdge ? 0 : container.width - handle.width
}
id: container
// ---------------------------------------------------------------------------
property alias childA: contentA.data
property alias childAItem: contentA
property alias childB: contentB.data
property bool defaultClosed: false
property bool resizeAInPriority: false
property int closingEdge: Qt.LeftEdge // `LeftEdge` or `RightEdge`.
property int defaultChildAWidth
// User limits: string or int values.
// By default: no limits.
property var maximumLeftLimit
property var maximumRightLimit
property int minimumLeftLimit: 0
property int minimumRightLimit: 0
property bool _isClosed
// Internal limits.
property var _maximumLeftLimit
property var _maximumRightLimit
property var _minimumLeftLimit
property var _minimumRightLimit
// ---------------------------------------------------------------------------
// Public functions.
// ---------------------------------------------------------------------------
function isClosed () {
return _isClosed
}
function open () {
if (_isClosed) {
openingTransition.running = true
}
}
function close () {
if (!_isClosed) {
_close()
}
}
// ---------------------------------------------------------------------------
// Private functions.
// ---------------------------------------------------------------------------
function _getLimitValue (limit) {
if (limit == null) {
return
}
return limit.isDynamic
? width * limit.value
: limit.value
}
function _parseLimit (limit) {
if (limit == null) {
return
}
if (Utils.isString(limit)) {
var arr = limit.split('%')
if (arr[1] === '') {
return {
isDynamic: true,
value: +arr[0] / 100
}
}
}
return {
value: limit
}
}
function _applyLimits () {
var maximumLeftLimit = _getLimitValue(_maximumLeftLimit)
var maximumRightLimit = _getLimitValue(_maximumRightLimit)
var minimumLeftLimit = _getLimitValue(_minimumLeftLimit)
var minimumRightLimit = _getLimitValue(_minimumRightLimit)
var theoreticalBWidth = container.width - contentA.width - handle.width
// If closed, set correctly the handle position to left or right.
if (_isClosed) {
contentA.width = (closingEdge !== Qt.LeftEdge)
? container.width - handle.width
: 0
}
// width(A) < minimum width(A).
else if (contentA.width < minimumLeftLimit) {
contentA.width = minimumLeftLimit
}
// width(A) > maximum width(A).
else if (maximumLeftLimit != null && contentA.width > maximumLeftLimit) {
contentA.width = maximumLeftLimit
}
// width(B) < minimum width(B).
else if (theoreticalBWidth < minimumRightLimit) {
contentA.width = container.width - handle.width - minimumRightLimit
}
// width(B) > maximum width(B).
else if (maximumRightLimit != null && theoreticalBWidth > maximumRightLimit) {
contentA.width = container.width - handle.width - maximumRightLimit
} else if (resizeAInPriority) {
contentA.width = container.width - handle.width - contentB.width
}
}
// ---------------------------------------------------------------------------
function _applyLimitsOnUserMove (offset) {
var minimumRightLimit = _getLimitValue(_minimumRightLimit)
var minimumLeftLimit = _getLimitValue(_minimumLeftLimit)
// One area is closed.
if (_isClosed) {
if (closingEdge === Qt.LeftEdge) {
if (offset > minimumLeftLimit / 2) {
_open()
}
} else {
if (-offset > minimumRightLimit / 2) {
_open()
}
}
return
}
// Check limits.
var maximumLeftLimit = _getLimitValue(_maximumLeftLimit)
var maximumRightLimit = _getLimitValue(_maximumRightLimit)
var theoreticalBWidth = container.width - offset - contentA.width - handle.width
// width(A) < minimum width(A).
if (contentA.width + offset < minimumLeftLimit) {
contentA.width = minimumLeftLimit
if (closingEdge === Qt.LeftEdge && -offset > minimumLeftLimit / 2) {
if (_isClosed) {
_open()
} else {
_close()
}
}
}
// width(A) > maximum width(A).
else if (maximumLeftLimit != null && contentA.width + offset > maximumLeftLimit) {
contentA.width = maximumLeftLimit
}
// width(B) < minimum width(B).
else if (theoreticalBWidth < minimumRightLimit) {
contentA.width = container.width - handle.width - minimumRightLimit
if (closingEdge !== Qt.LeftEdge && offset > minimumRightLimit / 2) {
if (_isClosed) {
_open()
} else {
_close()
}
}
}
// width(B) > maximum width(B).
else if (maximumRightLimit != null && theoreticalBWidth > maximumRightLimit) {
contentA.width = container.width - handle.width - maximumRightLimit
}
// Resize A/B.
else {
contentA.width = contentA.width + offset
}
}
// ---------------------------------------------------------------------------
function _open () {
_isClosed = false
_applyLimits()
}
function _close () {
_isClosed = true
closingTransition.running = true
}
function _inverseClosingState () {
if (!_isClosed) {
// Save state and close.
_close()
} else {
// Restore old state.
openingTransition.running = true
}
}
function _isVisible (edge) {
return (
!_isClosed ||
openingTransition.running ||
closingTransition.running
) || closingEdge !== edge
}
// ---------------------------------------------------------------------------
onWidthChanged: _applyLimits()
Component.onCompleted: {
// Unable to modify these properties after creation.
// It's a desired choice.
_maximumLeftLimit = _parseLimit(maximumLeftLimit)
_maximumRightLimit = _parseLimit(maximumRightLimit)
_minimumLeftLimit = _parseLimit(minimumLeftLimit)
_minimumRightLimit = _parseLimit(minimumRightLimit)
contentA.width = (defaultChildAWidth == null)
? _getLimitValue(_minimumLeftLimit)
: defaultChildAWidth
_isClosed = defaultClosed
}
Item {
id: contentA
height: parent.height
visible: _isVisible(Qt.LeftEdge)
}
MouseArea {
id: handle
property int _mouseStart
anchors.left: contentA.right
cursorShape: Qt.SplitHCursor
height: parent.height
hoverEnabled: true
width: PanedStyle.handle.width
onDoubleClicked: _inverseClosingState()
onMouseXChanged: pressed &&
_applyLimitsOnUserMove(mouseX - _mouseStart)
onPressed: _mouseStart = mouseX
Rectangle {
anchors.fill: parent
color: parent.pressed
? PanedStyle.handle.color.pressed
: (parent.containsMouse
? PanedStyle.handle.color.hovered
: PanedStyle.handle.color.normal
)
}
}
Item {
id: contentB
anchors.left: handle.right
height: parent.height
visible: _isVisible(Qt.RightEdge)
width: container.width - contentA.width - handle.width
}
PropertyAnimation {
id: openingTransition
duration: PanedStyle.transitionDuration
property: 'width'
target: contentA
to: closingEdge === Qt.LeftEdge
? minimumLeftLimit
: container.width - minimumRightLimit - handle.width
onRunningChanged: !running && _open()
}
PropertyAnimation {
id: closingTransition
duration: PanedStyle.transitionDuration
property: 'width'
target: contentA
to: closingEdge === Qt.LeftEdge ? 0 : container.width - handle.width
}
}

View file

@ -43,8 +43,6 @@ Item{
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
//Layout.fillWidth: true
//Layout.fillHeight: true
property int maxYears: 5 // Max years to be requested.

View file

@ -56,10 +56,8 @@ Item{
path: Path {
id: outPath
//property int xStep: middleMinSize * Math.sin(2 * Math.PI / outer.count)
property int yStep: middleMinSize * Math.cos(2 * Math.PI / outer.count)
//startX: xStep + mainItem.width/2; startY: yStep + mainItem.height/2
startX: mainItem.centerPosition
startY: mainItem.centerPosition - outPath.yStep
PathArc {
@ -111,8 +109,7 @@ Item{
path: Path {
id: innerPath
//property int xStep: middleMinSize * Math.sin(2 * Math.PI / inner.count)
property int yStep: middleMinSize * Math.cos(2 * Math.PI / inner.count)
property int yStep: middleMinSize * Math.cos(2 * Math.PI / inner.count)
startX: mainItem.centerPosition; startY: mainItem.centerPosition - innerPath.yStep
PathArc {
x: mainItem.centerPosition; y: mainItem.centerPosition + innerPath.yStep

View file

@ -31,7 +31,6 @@ Column {
// ----------------------------------------------------------------------------
//height: errorBlock.implicitHeight + busy.height// RequestBlockStyle.height
TextEdit {
id: errorBlock
readOnly: true
@ -58,7 +57,6 @@ Column {
id: busy
anchors {
horizontalCenter: parent.horizontalCenter
//top: parent.top
}
height: visible ? RequestBlockStyle.loadingIndicator.height : 0

View file

@ -20,7 +20,7 @@ Item {
property CallModel callModel
property bool isPreview: !callModel || !container.currentDevice || container.currentDevice.isMe
property bool isFullscreen: false
property bool hideCamera: false //callModel.pausedByUser
property bool hideCamera: false
property bool isPaused: false
property bool isVideoEnabled: enabled
&& (!callModel || callModel.videoEnabled)
@ -31,14 +31,8 @@ Item {
property bool b: container.currentDevice && container.currentDevice.videoEnabled
property bool c: container.currentDevice && container.currentDevice.isMe
property bool d : callModel && callModel.cameraEnabled
onAChanged: console.log("A: " + a + ", " +callModel)
onBChanged: console.log("B: " + b + ", " +container.currentDevice)
onCChanged: console.log("C: " + c + ", " +container.currentDevice)
onDChanged: console.log("D: " + d + ", " +callModel)
onIsVideoEnabledChanged: console.log('VideoIsEnabled: '+isVideoEnabled)
//onIsVideoEnabledChanged: console.log(callModel.videoEnabled + ","+container.currentDevice.videoEnabled+','+container.currentDevice.isMe+','+callModel.cameraEnabled)
property bool isReady: cameraLoader.item && cameraLoader.item.isReady
onCurrentDeviceChanged: resetActive()
function resetActive(){
resetTimer.resetActive()
@ -50,7 +44,7 @@ Item {
anchors.fill: parent
active: container.enabled && !resetActive && container.isVideoEnabled //avatarCell.currentDevice && (avatarCell.currentDevice.videoEnabled && !conference._fullscreen)
active: container.enabled && !resetActive && container.isVideoEnabled
sourceComponent: container.isVideoEnabled && !container.isPaused? camera : null
Timer{
@ -77,8 +71,6 @@ Item {
isPreview: container.isPreview
onRequestNewRenderer: {resetTimer.resetActive()}
Component.onDestruction: {/*resetWindowId();*/ console.log("Destroyed Camera [" + isPreview + "] : " + camera)}
Component.onCompleted: console.log("Completed Camera [" + isPreview + "] : " + camera)
}
}
}

View file

@ -55,7 +55,7 @@ Item{
Loader {
anchors.centerIn: parent
active: mainItem.currentDevice && !camera.isReady //&& !mainItem.currentDevice.isMe && (!mainItem.currentDevice.videoEnabled || mainItem.isFullscreen)
active: mainItem.currentDevice && !camera.isReady
sourceComponent: avatar
}
}
@ -135,15 +135,6 @@ Item{
font.weight: CameraViewStyle.contactDescription.weight
color: CameraViewStyle.contactDescription.color
}
/*
DropShadow {
anchors.fill: username
source: username
verticalOffset: 2
color: "#80000000"
radius: 1
samples: 3
}*/
Glow {
anchors.fill: username
//spread: 1

View file

@ -441,7 +441,6 @@ Rectangle {
if(proxyModel.chatRoomModel) {
proxyModel.sendMessage(text)
}else{
console.log("Peer : " +proxyModel.peerAddress+ "/"+chat.model.peerAddress)
proxyModel.chatRoomModel = CallsListModel.createChat(proxyModel.peerAddress)
proxyModel.sendMessage(text)
}

View file

@ -27,7 +27,6 @@ Loader{
property ConferenceInfoModel conferenceInfoModel: contentModel ? contentModel.conferenceInfoModel : null
property int maxWidth : parent.width
property int fitHeight: active && item ? item.fitHeight + ChatCalendarMessageStyle.topMargin+ChatCalendarMessageStyle.bottomMargin + (isExpanded? 200 : 0): 0
//property int fitWidth: active && item ? Math.max(item.fitWidth, maxWidth/2) + ChatCalendarMessageStyle.widthMargin*2 : 0
property int fitWidth: active && item ? maxWidth/2 + ChatCalendarMessageStyle.widthMargin*2 : 0
property bool containsMouse: false
property int gotoButtonMode: -1 //-1: hide, 0:goto, 1:MoreInfo
@ -41,7 +40,6 @@ Loader{
property font customFont : SettingsModel.textMessageFont
active: mainItem.conferenceInfoModel
// (mainItem.contentModel && mainItem.contentModel.isIcalendar()) || (!mainItem.contentModel && mainItem.conferenceInfoModel)
sourceComponent: MouseArea{
id: loadedItem
@ -99,21 +97,19 @@ Loader{
}
Text{
Layout.fillWidth: true
//Layout.minimumWidth: implicitWidth
//Layout.preferredWidth: implicitWidth
Layout.rightMargin: 15
horizontalAlignment: Qt.AlignRight
verticalAlignment: Qt.AlignVCenter
color: ChatCalendarMessageStyle.schedule.color
elide: Text.ElideRight
font.pointSize: ChatCalendarMessageStyle.schedule.pointSize
text: 'Organisateur : ' +UtilsCpp.getDisplayName(mainItem.conferenceInfoModel.organizer)
//: 'Organizer' : Label Title for the organizer.
text: qsTr('icsOrganizer') +' : ' +UtilsCpp.getDisplayName(mainItem.conferenceInfoModel.organizer)
}
}
Text{
id: title
Layout.fillWidth: true
//Layout.preferredHeight:
Layout.leftMargin: 10
Layout.alignment: Qt.AlignRight
elide: Text.ElideRight
@ -198,8 +194,8 @@ Loader{
color: ChatCalendarMessageStyle.subject.color
font.pointSize: ChatCalendarMessageStyle.subject.pointSize
font.weight: Font.Bold
text: 'Description :'
//: 'Description' : Title for the conference description.
text: qsTr('icsDescription')
visible: description.text != ''
}
TextAreaField{
@ -215,10 +211,6 @@ Loader{
border.width: 0
visible: description.text != ''
//font.weight: Font.Bold
//elide: Text.ElideRight
//wrapMode: TextEdit.WordWrap
text: mainItem.conferenceInfoModel.description
}
Item{
@ -233,7 +225,8 @@ Loader{
font.pointSize: ChatCalendarMessageStyle.subject.pointSize
font.weight: Font.Bold
text: 'Lien de la conférence'
//: 'Conference address' : Title for the conference address.
text: qsTr('icsconferenceAddressTitle')
}
RowLayout{
Layout.fillWidth: true
@ -269,7 +262,8 @@ Loader{
Layout.fillWidth: true
}
TextButtonC{
text: 'REJOINDRE'
//: 'Join' : Action button to join the conference.
text: qsTr('icsJoinButton').toUpperCase()
onClicked: CallsListModel.prepareConferenceCall(mainItem.conferenceInfoModel)
}
ActionButton{

View file

@ -47,11 +47,14 @@ Loader{
//: 'Read by %1 - %2' Little message to indicate the state of a message
//~ Context %1 is someone, %2 is a date/time. The state that the message has been read.
return qsTr('deliveryDisplayed').arg(displayName).arg(stateChangeTime)
else// if(state == LinphoneEnums.ChatMessageStateNotDelivered)
else if(state == LinphoneEnums.ChatMessageStateNotDelivered)
//: "%1 have nothing received" Little message to indicate the state of a message
//~ Context %1 is someone. The state is that the message hasn't been delivered.
return qsTr('deliveryNotDelivered').arg(displayName)
//else return ''
else
//: "Error while sending to %1" Little message to indicate the state of a message
//~ Context %1 is someone. The state is that the message hasn't been delivered because of an error.
return qsTr('deliveryError').arg(displayName)
}
delegate:Text{
height: ChatStyle.composingText.height-5

View file

@ -105,8 +105,6 @@ Row {
mipmap: SettingsModel.mipmapEnabled
source: 'file:/'+mainRow.contentModel.filePath
fillMode: Image.PreserveAspectFit
//width: 200
//height: 100
}
}
@ -292,9 +290,6 @@ Row {
anchors.fill: parent
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)) {

View file

@ -49,7 +49,6 @@ Item{
width: height * ChatFilePreviewStyle.filePreview.format
anchors.verticalCenter: parent.verticalCenter
anchors.verticalCenterOffset: 7
//anchors.horizontalCenter: parent.horizontalCenter
thumbnail: $modelData.thumbnail
name: $modelData.name
animationScale: 1.1

View file

@ -144,8 +144,6 @@ Item {
delegate: ChatContent{
contentModel: $modelData
textColor: ChatReplyMessageStyle.replyArea.foregroundColor
//textFont.pointSize: Units.dp * (customFont.pointSize + ChatReplyMessageStyle.replyArea.pointSizeOffset)
//textFont.weight: Font.Light
onFitWidthChanged:{
replyMessage.updateWidth()
}

View file

@ -90,7 +90,6 @@ Rectangle{
delegate: ChatContent{
contentModel: $modelData
//textFont.pointSize: Units.dp * (SettingsModel.textMessageFont.pointSize - 2)
Rectangle{
anchors.left: parent.left
anchors.right: parent.right

View file

@ -53,7 +53,6 @@ TextEdit {
textFormat: Text.RichText // To supports links and imgs.
wrapMode: TextEdit.Wrap
//onCursorRectangleChanged: if(!readOnly) Logic.ensureVisible(cursorRectangle)
onLinkActivated: Qt.openUrlExternally(link)
onSelectedTextChanged:{
if(selectedText != '') lastTextSelected = selectedText

View file

@ -129,7 +129,6 @@ Item {
anchors.bottom:parent.bottom
anchors.rightMargin : 5
visible:$chatEntry.isEphemeral
//onVisibleChanged: container.updateHeight()
Text{
id: ephemeralText
anchors.bottom: parent.bottom

View file

@ -19,7 +19,6 @@ Item {
property var _initialsRegex: /^\s*([^\s\.]+)(?:[\s\.]+([^\s\.]+))?/
//onPresenceLevelChanged: console.log(Presence.getPresenceLevelIconName(presenceLevel)+' => '+username)
// ---------------------------------------------------------------------------
function isLoaded () {

View file

@ -43,6 +43,8 @@ DialogPlus {
Component.onDestruction: SettingsModel.stopCaptureGraph()
onCallChanged: !call && exit(0)
//: 'Multimedia parameters' : Menu title to show multimedia devices configuration.
title: qsTr('menuMultimedia')
// ---------------------------------------------------------------------------
Column {

View file

@ -60,8 +60,6 @@ Item {
id: thumbnailProvider
anchors.fill: parent
//Layout.fillHeight: true
//Layout.preferredWidth: parent.height
sourceComponent: (mainItem.active ? (mainItem.thumbnail ? thumbnailImage : extension ): undefined)
@ -90,7 +88,7 @@ Item {
thumbnailProviderAnimator.running = false
}
mainItem.z = 999//Constants.zPopup
mainItem.z = Constants.zPopup
thumbnailProviderAnimator.to = mainItem.animationScale
thumbnailProviderAnimator.running = true
}

View file

@ -90,37 +90,6 @@ Row {
translation = 'unknownCallEvent'
}
}
/*
property string _type: {
var status = $historyEntry.status
if (status === HistoryModel.CallStatusSuccess) {
if (!$historyEntry.isStart) {
return 'ended_call'
}
return $historyEntry.isOutgoing ? 'outgoing_call' : 'incoming_call'
}
if (status === HistoryModel.CallStatusDeclined) {
return $historyEntry.isOutgoing ? 'declined_outgoing_call' : 'declined_incoming_call'
}
if (status === HistoryModel.CallStatusMissed) {
return $historyEntry.isOutgoing ? 'missed_outgoing_call' : 'missed_incoming_call'
}
if (status === HistoryModel.CallStatusAborted) {
return $historyEntry.isOutgoing ? 'outgoing_call' : 'incoming_call'
}
if (status === HistoryModel.CallStatusEarlyAborted) {
return $historyEntry.isOutgoing ? 'missed_outgoing_call' : 'missed_incoming_call'
}
if (status === HistoryModel.CallStatusAcceptedElsewhere) {
return $historyEntry.isOutgoing ? 'outgoing_call' : 'incoming_call'
}
if (status === HistoryModel.CallStatusDeclinedElsewhere) {
return $historyEntry.isOutgoing ? 'declined_outgoing_call' : 'declined_incoming_call'
}
return 'unknown_call_event'
}*/
height: HistoryStyle.entry.lineHeight
spacing: HistoryStyle.entry.message.extraContent.spacing
@ -174,7 +143,6 @@ Row {
}
}
ActionButton {
//height: HistoryStyle.entry.lineHeight
isCustom: true
backgroundRadius: 8
colorSet: HistoryStyle.entry.deleteAction

View file

@ -22,7 +22,6 @@ Rectangle{
property ConferenceModel conferenceModel: callModel.conferenceModel
property ParticipantModel me: conferenceModel.localParticipant
property bool isMeAdmin: me && me.adminStatus
onIsMeAdminChanged: console.log("Is admin : " +isMeAdmin)
property bool isParticipantsMenu: false
signal close()
@ -33,9 +32,14 @@ Rectangle{
// List of title texts in order to allow bindings between all components
property var menuTitles: [
'Régler les périphériques'
, 'Modifier la mise en page'
, mainItem.isMeAdmin ? 'Inviter des participants' : 'Participants'
//: 'Multimedia parameters' : Menu title to show multimedia devices configuration.
qsTr('conferenceMenuMultimedia'),
//: 'Change layout' : Menu title to change the conference layout.
qsTr('conferenceMenuLayout'),
//: 'Invite participants' : Menu title to invite participants in admin mode.
mainItem.isMeAdmin ? qsTr('conferenceMenuInvite')
//: 'Participants list' : Menu title to show participants in non-admin mode.
: qsTr('conferenceMenuParticipants')
]
function showParticipantsMenu(){
@ -55,8 +59,6 @@ Rectangle{
RowLayout{
anchors.fill: parent
ActionButton{
//Layout.minimumHeight: VideoConferenceMenuStyle.buttons.back.iconSize
//Layout.minimumWidth: VideoConferenceMenuStyle.buttons.back.iconSize
backgroundRadius: width/2
isCustom: true
colorSet: VideoConferenceMenuStyle.buttons.back
@ -65,7 +67,7 @@ Rectangle{
}
Text{
id: titleMenu
text: contentsStack.currentItem.title //'Paramètres'
text: contentsStack.currentItem.title
Layout.fillWidth: true
Layout.preferredHeight: implicitHeight
horizontalAlignment: Qt.AlignCenter
@ -90,18 +92,16 @@ Rectangle{
initialItem: settingsMenuComponent
Layout.fillHeight: true
Layout.fillWidth: true
//onPopEnterChanged: if(nViews <= 1 ) title.text = 'Paramètres'
}
Component{
id: settingsMenuComponent
ColumnLayout{
property string objectName: 'settingsMenu'
property string title: 'Paramètres'
//: 'Settings' : Main menu title for settings.
property string title: qsTr('conferenceMenuTitle')
Layout.fillHeight: true
Layout.fillWidth: true
Repeater{
model: [
{titleIndex: 0
@ -186,6 +186,7 @@ Rectangle{
showMargins: true
expandHeight: false
fixedSize: false
showTitleBar: false
onExitStatus: contentsStack.pop()
}
Item{// Spacer
@ -202,9 +203,12 @@ Rectangle{
Layout.fillHeight: true
Layout.fillWidth: true
Repeater{
model: [{text: 'Mode mosaïque', icon: VideoConferenceMenuStyle.modeIcons.gridIcon, value:LinphoneEnums.ConferenceLayoutGrid}
, {text: 'Mode présentateur', icon: VideoConferenceMenuStyle.modeIcons.activeSpeakerIcon, value:LinphoneEnums.ConferenceLayoutActiveSpeaker}
, {text: 'Mode audio', icon: VideoConferenceMenuStyle.modeIcons.audioOnlyIcon, value:2}
//: 'Mosaic mode' : Grid layout for video conference.
model: [{text: qsTr('conferenceMenuGridLayout'), icon: VideoConferenceMenuStyle.modeIcons.gridIcon, value:LinphoneEnums.ConferenceLayoutGrid}
//: 'Active speaker mode' : Active speaker layout for video conference.
, {text: qsTr('conferenceMenuActiveSpeakerLayout'), icon: VideoConferenceMenuStyle.modeIcons.activeSpeakerIcon, value:LinphoneEnums.ConferenceLayoutActiveSpeaker}
//: 'Audio only mode' : Audio only layout for video conference.
, {text: qsTr('conferenceMenuAudioLayout'), icon: VideoConferenceMenuStyle.modeIcons.audioOnlyIcon, value:2}
]
delegate:
Borders{
@ -225,7 +229,6 @@ Rectangle{
checked: mainItem.callModel ? (mainItem.callModel.videoEnabled && modelData.value == mainItem.callModel.conferenceVideoLayout)
|| (!mainItem.callModel.videoEnabled && modelData.value == 2)
: false
onCheckedChanged: console.log(mainItem.callModel ? mainItem.callModel.videoEnabled +","+mainItem.callModel.conferenceVideoLayout : '')
text: modelData.text
onClicked: if(modelData.value == 2) mainItem.callModel.videoEnabled = false
else mainItem.callModel.conferenceVideoLayout = modelData.value
@ -260,11 +263,11 @@ Rectangle{
Layout.fillWidth: true
Layout.leftMargin: 10
Layout.rightMargin: 10
//Layout.minimumHeight: fitHeight
conferenceModel: mainItem.conferenceModel
isAdmin: mainItem.isMeAdmin
Text{
text: 'Vous êtes actuellement seul dans cette conférence'
Text{
//: 'Your are currently alone in this conference' : Message to warn the user when there is no other participant.
text: qsTr('conferenceMenuParticipantsAlone')
visible: parent.count
}
}

View file

@ -27,7 +27,6 @@ Rectangle {
// ---------------------------------------------------------------------------
//signal entrySelected (string entry)
signal entrySelected (TimelineModel entry)
signal entryClicked(TimelineModel entry)
signal showHistoryRequest()
@ -64,7 +63,6 @@ Rectangle {
Layout.alignment: Qt.AlignTop
color: showHistory.containsMouse?TimelineStyle.legend.backgroundColor.hovered:TimelineStyle.legend.backgroundColor.normal
visible: showHistoryButton || showFiltersButtons
//visible:view.count > 0 || timeline.isFilterVisible || timeline.model.filterFlags > 0 || CoreManager.eventCount > 0
MouseArea{// no more showing history
id:showHistory
@ -405,7 +403,6 @@ Rectangle {
preventStealing: false
onClicked: {
if(mouse.button == Qt.LeftButton){
//if($modelData.selected || !view.updateSelectionModels)// Update selection
timeline.entryClicked($modelData)
if(view){
if(view.updateSelectionModels)

View file

@ -25,8 +25,6 @@ ColumnLayout {
property bool isAdmin : (chatRoomModel && chatRoomModel.isMeAdmin && !chatRoomModel.isReadOnly) || (me && me.adminStatus)
property bool canHandleParticipants : isAdmin && ( (chatRoomModel && chatRoomModel.canHandleParticipants) || conferenceModel)
property bool haveEncryption: chatRoomModel && chatRoomModel.haveEncryption
onIsAdminChanged: console.log("participantsListView is admin : "+isAdmin)
onCanHandleParticipantsChanged: console.log("CanHandleParticipants:"+canHandleParticipants)
spacing: ParticipantsListViewStyle.mainLayout.spacing
SmartSearchBar {
@ -41,10 +39,10 @@ ColumnLayout {
maxMenuHeight: MainWindowStyle.searchBox.maxHeight
//: 'Add Participants' : Placeholder in a search bar for adding participant to the chat room
placeholderText: 'addParticipantPlaceholder'
placeholderText: qsTr('addParticipantPlaceholder')
//: 'Search participants in your contact list in order to invite them into the chat room.'
//~ Tooltip Explanation for inviting the selected participants into chat room
tooltipText: 'addParticipantTooltip'
tooltipText: qsTr('addParticipantTooltip')
actions:[{
colorSet: ParticipantsListViewStyle.addParticipant,
secure: mainLayout.haveEncryption,
@ -68,7 +66,6 @@ ColumnLayout {
Layout.fillWidth: true
Layout.bottomMargin: 5
//readOnly: toAddView.count >= conferenceManager.maxParticipants
textFieldStyle: TextFieldStyle.unbordered
ColumnLayout{
@ -103,7 +100,6 @@ ColumnLayout {
id: participantView
Layout.fillHeight: true
Layout.fillWidth: true
//anchors.fill: parent
showContactAddress:false
showSwitch : mainLayout.isAdmin
@ -117,10 +113,10 @@ ColumnLayout {
colorSet: ParticipantsListViewStyle.removeParticipant,
secure:0,
visible:true,
tooltipText: 'Remove this participant from the selection',
//: 'Remove this participant from the list' : Tootltip to explain that the action will lead to remove the participant.
tooltipText: qsTr('participantsListRemoveTooltip'),
handler: function (entry) {
selectedParticipants.removeModel(entry)
// ++lastContacts.reloadCount
}
}]
: []

View file

@ -21,7 +21,6 @@ ScrollableListView {
property string genSipAddress
// Optional parameters.chatRoomModel.isMeAdmin
property string headerButtonDescription
property string headerButtonIcon
property var headerButtonAction
@ -247,7 +246,8 @@ ScrollableListView {
++count
}
if( $modelData.isMe)
txt += (count++ > 0 ? ' - ' : '') + 'Me'
//: 'Me' : One word for myself.
txt += (count++ > 0 ? ' - ' : '') + qsTr('participantsMe')
return txt
}
statusText : showAdminStatus ? getStatus() : ''
@ -277,7 +277,6 @@ ScrollableListView {
Switch{
anchors.verticalCenter: parent.verticalCenter
width:50
//Layout.preferredWidth: 50
indicatorStyle: SwitchStyle.aux
visible: sipAddressesView.showSwitch

View file

@ -1,153 +0,0 @@
import QtQuick 2.7
import QtQuick.Controls 2.7
import QtQuick.Layouts 1.3
import Common 1.0
import Common.Styles 1.0
import Linphone 1.0
import Utils 1.0
import App.Styles 1.0
// =============================================================================
DialogPlus {
property var call
// ---------------------------------------------------------------------------
buttons: [
TextButtonB {
text: qsTr('ok')
onClicked: {
call.updateStreams()
exit(0)
}
}
]
buttonsAlignment: Qt.AlignCenter
height: MultimediaParametersStyle.height+30
width: MultimediaParametersStyle.width
onCallChanged: !call && exit(0)
// ---------------------------------------------------------------------------
Column {
anchors.fill: parent
spacing: MultimediaParametersStyle.column.spacing
RowLayout {
spacing: MultimediaParametersStyle.column.entry.spacing
width: parent.width
Icon {
Layout.alignment: Qt.AlignTop
Layout.preferredHeight: ComboBoxStyle.background.height
icon: MultimediaParametersStyle.column.entry.speaker.icon
overwriteColor: MultimediaParametersStyle.column.entry.speaker.color
iconSize: MultimediaParametersStyle.column.entry.speaker.iconSize
}
Column {
Layout.fillWidth: true
spacing: MultimediaParametersStyle.column.entry.spacing2
ComboBox {
currentIndex: Utils.findIndex(model, function (device) {
return device === SettingsModel.playbackDevice
})
model: SettingsModel.playbackDevices
width: parent.width
onActivated: SettingsModel.playbackDevice = model[index]
}
Slider {
id: playbackSlider
width: parent.width
Component.onCompleted: value = call.speakerVolumeGain
onPositionChanged: call.speakerVolumeGain = position
ToolTip {
parent: playbackSlider.handle
visible: playbackSlider.pressed
text: (playbackSlider.value * 100).toFixed(0) + " %"
}
}
}
}
RowLayout {
spacing: MultimediaParametersStyle.column.entry.spacing
width: parent.width
Icon {
Layout.alignment: Qt.AlignTop
Layout.preferredHeight: ComboBoxStyle.background.height
icon: MultimediaParametersStyle.column.entry.micro.icon
overwriteColor: MultimediaParametersStyle.column.entry.micro.color
iconSize: MultimediaParametersStyle.column.entry.micro.iconSize
}
Column {
Layout.fillWidth: true
spacing: MultimediaParametersStyle.column.entry.spacing2
ComboBox {
currentIndex: Utils.findIndex(model, function (device) {
return device === SettingsModel.captureDevice
})
model: SettingsModel.captureDevices
width: parent.width
onActivated: SettingsModel.captureDevice = model[index]
}
Slider {
id: captureSlider
width: parent.width
Component.onCompleted: value = call.microVolumeGain
onPositionChanged: call.microVolumeGain = position
ToolTip {
parent: captureSlider.handle
visible: captureSlider.pressed
text: "+ " + (captureSlider.value * 100).toFixed(0) + " %"
}
}
}
}
RowLayout {
spacing: MultimediaParametersStyle.column.entry.spacing
width: parent.width
Icon {
icon: MultimediaParametersStyle.column.entry.camera.icon
overwriteColor: MultimediaParametersStyle.column.entry.camera.color
iconSize: MultimediaParametersStyle.column.entry.speaker.iconSize
}
ComboBox {
Layout.fillWidth: true
currentIndex: Number(Utils.findIndex(model, function (device) {
return device === SettingsModel.videoDevice
}))
model: SettingsModel.videoDevices
onActivated: SettingsModel.videoDevice = model[index]
}
}
}
}

View file

@ -66,7 +66,6 @@ function handleStatusChanged (status) {
}
function handleVideoRequested (call) {
console.log("handleVideoRequested")
if (window.virtualWindowVisible || !Linphone.SettingsModel.videoSupported) {
call.rejectVideoRequest()
return
@ -95,9 +94,7 @@ console.log("D")
}, function (status) {
//Utils.clearTimeout(timeout)
call.statusChanged.disconnect(endedHandler)
console.log("E: "+status)
if (status) {
console.log("TOTO")
call.acceptVideoRequest()
} else {
call.rejectVideoRequest()
@ -119,7 +116,7 @@ function openCallStatistics () {
}
function openMediaParameters (window, incall) {
window.attachVirtualWindow(Qt.resolvedUrl('Dialogs/MultimediaParameters.qml'), {
window.attachVirtualWindow(Utils.buildLinphoneDialogUri('MultimediaParametersDialog'), {
call: incall.call
})
}

View file

@ -258,9 +258,7 @@ Rectangle {
width: container.width
Component.onDestruction: {
resetWindowId()
console.log("Camera incall destroyed")
}
Component.onCompleted: console.log("Camera incall completed")
}
}
@ -405,9 +403,7 @@ Rectangle {
isPreview: true
Component.onDestruction: {
resetWindowId()
console.log("Camera preview incall destroyed")
}
Component.onCompleted: console.log("Camera preview incall completed")
}
}
}

View file

@ -70,14 +70,16 @@ Rectangle {
}
Text{
Layout.alignment: Qt.AlignCenter
text: 'Vous êtes actuellement en dehors de la conférence.'
//: 'You are currently out of the conference.' : Pause message in video conference.
text: qsTr('videoConferencePauseWarning')
font.pointSize: VideoConferenceStyle.pauseArea.title.pointSize
font.weight: VideoConferenceStyle.pauseArea.title.weight
color: VideoConferenceStyle.pauseArea.title.color
}
Text{
Layout.alignment: Qt.AlignCenter
text: 'Cliquez sur le bouton "play" pour la rejoindre.'
//: 'Click on play button to join it back.' : Explain what to do when being in pause in conference.
text: qsTr('videoConferencePauseHint')
font.pointSize: VideoConferenceStyle.pauseArea.description.pointSize
font.weight: VideoConferenceStyle.pauseArea.description.weight
color: VideoConferenceStyle.pauseArea.description.color
@ -156,7 +158,10 @@ Rectangle {
? callModel.startRecording()
: callModel.stopRecording()
}
tooltipText: !toggled ? 'Start Recording' : 'Stop Recording'
//: 'Start recording' : Tootltip when straing record.
tooltipText: !toggled ? qsTr('videoConferenceStartRecordTooltip')
//: 'Stop Recording' : Tooltip when stopping record.
: qsTr('videoConferenceStopRecordTooltip')
}
ActionButton{
isCustom: true
@ -164,7 +169,8 @@ Rectangle {
colorSet: VideoConferenceStyle.buttons.screenshot
visible: conference.callModel.snapshotEnabled
onClicked: conference.callModel.takeSnapshot()
tooltipText:'take Snapshot'
//: 'take Snapshot' : Tooltip for takking snapshot.
tooltipText: qsTr('videoConferenceSnapshotTooltip')
}
ActionButton{
isCustom: true
@ -237,7 +243,8 @@ Rectangle {
}
Text{
Layout.alignment: Qt.AlignCenter
text: "Video conference is not ready. Please Wait..."
//: 'Video conference is not ready. Please Wait...' : Waiting message for starting conference.
text: qsTr('videoConferenceWaitMessage')
color: VideoConferenceStyle.buzyColor
}
}

View file

@ -56,11 +56,9 @@ Item {
anchors.rightMargin: 30
anchors.topMargin: 30
anchors.bottomMargin: 30
//property int maxShowedCount: 4
property int cellHeight: 150
width: 16 * cellHeight / 9
onCountChanged: {console.log("Delegate count = "+count+"/"+mainItem.participantDevices.count)}
model: mainItem.participantDevices
spacing: 15
verticalLayoutDirection: ItemView.BottomToTop
@ -76,9 +74,8 @@ Item {
currentDevice: modelData
callModel: mainItem.callModel
isCameraFromDevice: true
isPaused: mainItem.callModel.pausedByUser || currentDevice && currentDevice.isPaused //callModel.pausedByUser
isPaused: mainItem.callModel.pausedByUser || currentDevice && currentDevice.isPaused
onCloseRequested: mainItem.showMe = false
//color: 'black'
}
}
}

View file

@ -107,14 +107,17 @@ Window {
}
Text{
Layout.alignment: Qt.AlignCenter
text: 'Vous êtes actuellement en dehors de la conférence.'
//: 'You are currently out of the conference.' : Pause message in video conference.
text: qsTr('videoConferencePauseWarning')
font.pointSize: VideoConferenceStyle.pauseArea.title.pointSize
font.weight: VideoConferenceStyle.pauseArea.title.weight
color: VideoConferenceStyle.pauseArea.title.color
}
Text{
Layout.alignment: Qt.AlignCenter
text: 'Cliquez sur le bouton "play" pour la rejoindre.'
//: 'Click on play button to join it back.' : Explain what to do when being in pause in conference.
text: qsTr('videoConferencePauseHint')
font.pointSize: VideoConferenceStyle.pauseArea.description.pointSize
font.weight: VideoConferenceStyle.pauseArea.description.weight
color: VideoConferenceStyle.pauseArea.description.color
@ -143,14 +146,7 @@ Window {
visible: !window.hideButtons
height: visible? undefined : 0
/*
ActionButton{
isCustom: true
backgroundRadius: width/2
colorSet: VideoConferenceStyle.buttons.callsList
visible: !listCallsOpened && !window.hideButtons
onClicked: openListCallsRequest()
}*/
ActionButton{
id: keypadButton
isCustom: true
@ -196,7 +192,10 @@ Window {
? callModel.startRecording()
: callModel.stopRecording()
}
tooltipText: !toggled? 'Start Recording' : 'Stop Recording'
//: 'Start recording' : Tootltip when straing record.
tooltipText: !toggled ? qsTr('videoConferenceStartRecordTooltip')
//: 'Stop Recording' : Tooltip when stopping record.
: qsTr('videoConferenceStopRecordTooltip')
}
ActionButton{
isCustom: true
@ -204,7 +203,8 @@ Window {
colorSet: VideoConferenceStyle.buttons.screenshot
visible: conference.callModel.snapshotEnabled
onClicked: conference.callModel.takeSnapshot()
tooltipText:'take Snapshot'
//: 'take Snapshot' : Tooltip for takking snapshot.
tooltipText: qsTr('videoConferenceSnapshotTooltip')
}
ActionButton{
isCustom: true
@ -275,7 +275,8 @@ Window {
}
Text{
Layout.alignment: Qt.AlignCenter
text: "Video conference is not ready. Please Wait..."
//: 'Video conference is not ready. Please Wait...' : Waiting message for starting conference.
text: qsTr('videoConferenceWaitMessage')
color: VideoConferenceStyle.buzyColor
}
}

View file

@ -24,22 +24,7 @@ Mosaic {
property bool cameraEnabled: true
property int participantCount: gridModel.count
squaredDisplay: true
function setTestMode(){
grid.clear()
gridModel.model = gridModel.defaultList
for(var i = 0 ; i < 5 ; ++i)
grid.add({color: '#'+ Math.floor(Math.random()*255).toString(16)
+Math.floor(Math.random()*255).toString(16)
+Math.floor(Math.random()*255).toString(16)})
console.log("Setting test mode : count=" + gridModel.defaultList.count)
}
function setParticipantDevicesMode(){
console.log("Setting participant mode : count=" + gridModel.participantDevices.count)
grid.clear()
gridModel.model = gridModel.participantDevices
}
delegateModel: DelegateModel{
id: gridModel
property ParticipantDeviceProxyModel participantDevices : ParticipantDeviceProxyModel {
@ -49,23 +34,15 @@ Mosaic {
showMe: true
}
model: participantDevices
onCountChanged: {console.log("Delegate count = "+count+"/"+participantDevices.count)}
delegate: Item{
id: avatarCell
property ParticipantDeviceModel currentDevice: gridModel.participantDevices.getAt(index)
onCurrentDeviceChanged: {
console.log("currentDevice changed: " +currentDevice+"/"+cameraView.currentDevice + (currentDevice?", me:"+currentDevice.isMe:'')+" ["+index+"]")
if(index < 0) cameraView.enabled = false // this is a delegate destruction. We need to stop camera before Qt change its currentDevice (and then, let CameraView to delete wrong renderer)
}
//color: 'black' /*!conference.callModel && gridModel.defaultList.get(index).color ? gridModel.defaultList.get(index).color : */
//color: gridModel.model.get(index) && gridModel.model.get(index).color ? gridModel.model.get(index).color : '' // modelIndex is a custom index because by Mosaic modelisation, it is not accessible.
//color: $modelData.color ? $modelData.color : ''
height: grid.cellHeight - 10
width: grid.cellWidth - 10
Component.onCompleted: {
console.log("Completed: ["+index+"] " +(currentDevice?currentDevice.peerAddress+", isMe:"+currentDevice.isMe : '') )
}
CameraView{
id: cameraView
@ -74,9 +51,8 @@ Mosaic {
currentDevice: avatarCell.currentDevice
callModel: participantDevices.callModel
isCameraFromDevice: true
isPaused: grid.callModel.pausedByUser || avatarCell.currentDevice && avatarCell.currentDevice.isPaused //callModel.pausedByUser
onCloseRequested: participantDevices.showMe = false //grid.remove( index)
//color: 'black'
isPaused: grid.callModel.pausedByUser || avatarCell.currentDevice && avatarCell.currentDevice.isPaused
onCloseRequested: participantDevices.showMe = false
}
}
}

View file

@ -74,7 +74,6 @@ Rectangle {
fixedSize: false
onExitStatus: visible = false
visible: false
title: 'Régler les périphériques'
}
}
// -------------------------------------------------------------------------
@ -119,7 +118,6 @@ Rectangle {
backgroundRadius: 90
colorSet: cameraEnabled ? WaitingRoomStyle.buttons.cameraOn : WaitingRoomStyle.buttons.cameraOff
enabled: modeChoice.selectedMode != 2
//updating: cameraEnabled && callModel.updating
onClicked: cameraEnabled = !cameraEnabled
}
}
@ -132,10 +130,6 @@ Rectangle {
colorSet: selectedMode == 0 ? WaitingRoomStyle.buttons.gridLayout :
selectedMode == 1 ? WaitingRoomStyle.buttons.activeSpeakerLayout : WaitingRoomStyle.buttons.audioOnly
onClicked: selectedMode = (selectedMode + 1) % 3
/*
colorSet: callModel.pausedByUser ? WaitingRoomStyle.buttons.play : WaitingRoomStyle.buttons.pause
onClicked: callModel.pausedByUser = !callModel.pausedByUser
*/
}
}
}
@ -147,7 +141,9 @@ Rectangle {
Layout.alignment: Qt.AlignCenter
Layout.bottomMargin: 15
TextButtonA {
text: 'CANCEL'
//: 'Cancel' : Cancel button.
text: qsTr('cancelButton')
capitalization: Font.AllUppercase
onClicked: {
mainItem.close()
@ -155,7 +151,9 @@ Rectangle {
}
}
TextButtonB {
text: 'DEMARRER'
//: 'Start' : Button label for starting the conference.
text: qsTr('startButton')
capitalization: Font.AllUppercase
onClicked: {mainItem.close(); CallsListModel.launchVideoCall(conferenceInfoModel.uri, '', 0,
{ video: modeChoice.selectedMode != 2

View file

@ -18,21 +18,15 @@ import 'qrc:/ui/scripts/Utils/utils.js' as Utils
DialogPlus {
id: conferenceManager
property bool isNew: !conferenceInfoModel || conferenceInfoModel.uri === ''
onIsNewChanged: console.log("Is New:"+isNew+", "+conferenceInfoModel + ", " + (conferenceInfoModel? conferenceInfoModel.uri : 'noUri'))
Component.onCompleted: console.log("Completed: Is New:"+isNew+", "+conferenceInfoModel + ", " + (conferenceInfoModel? conferenceInfoModel.uri : 'noUri'))
property ConferenceInfoModel conferenceInfoModel: ConferenceInfoModel{}
onConferenceInfoModelChanged: selectedParticipants.setAddresses(conferenceInfoModel)
Connections{
target: conferenceInfoModel
onConferenceCreated: {
console.log("Conference has been created.")
creationStatus.icon = 'led_green'
}
onConferenceCreationFailed:{ console.log("Conference failed.")
creationStatus.icon = 'led_red'
}
onConferenceCreationFailed:{ creationStatus.icon = 'led_red' }
onInvitationsSent: {
console.log("Conference => invitations sent. Check in log for invite states.")
exit(1)
}
}
@ -107,12 +101,13 @@ DialogPlus {
},
TextButtonB {
enabled: selectedParticipants.count >= conferenceManager.minParticipants && subject.text != '' && AccountSettingsModel.conferenceURI != ''
//: 'Launch' : Start button
text: conferenceManager.isNew ? qsTr('startButton') : 'Mettre à jour'
//: 'Launch' : Launch button
text: conferenceManager.isNew ? qsTr('launchButton')
//: 'Update' : Update button
: qsTr('updateButton')
capitalization: Font.AllUppercase
function getInviteMode(){
//return inviteAppAccountCheckBox.checked ? LinphoneEnums::
return 0;
}
@ -131,10 +126,6 @@ DialogPlus {
conferenceInfoModel.setParticipants(selectedParticipants.participantListModel)
//var callsWindow = App.getCallsWindow()
//App.smartShowWindow(callsWindow)
//callsWindow.openConference()
//CallsListModel.createConference(conferenceInfoModel, secureSwitch.checked, getInviteMode(), false )
conferenceInfoModel.createConference(false && secureSwitch.checked, getInviteMode()) // TODO remove false when Encryption is ready to use
}
TooltipArea{
@ -168,7 +159,9 @@ DialogPlus {
buttonsAlignment: Qt.AlignRight
buttonsLeftMargin: 15
//: 'Start a video conference' : Title of a popup about creation of a video conference
title: conferenceManager.isNew ? qsTr('newConferenceTitle') : 'Changer la conférence'
title: conferenceManager.isNew ? qsTr('newConferenceTitle')
//: 'Update the conference' : Title of a popup about updating configuration of a video conference.
: qsTr('updateConferenceTitle')
height: window.height - 100
width: window.width - 100
@ -240,7 +233,7 @@ DialogPlus {
Layout.fillWidth: true
Layout.rightMargin: 15
//: 'Would you like to schedule your conference?' : Ask about setting the conference as scheduled.
text: 'Souhaitez-vous programmer cette conférence pour plus tard ?'
text: qsTr('newConferenceScheduleTitle')
color: NewConferenceStyle.titles.textColor
font.pointSize: NewConferenceStyle.titles.pointSize
font.weight: NewConferenceStyle.titles.weight
@ -256,14 +249,15 @@ DialogPlus {
property var locale: Qt.locale()
property date currentDate: new Date()
property int cellWidth: (parent.width-15)/columns
//Component.onCompleted: scheduleForm.updateDateTime()
Text{textFormat: Text.RichText; text: 'Date'+'<span style="color:red">*</span>'; Layout.preferredWidth: parent.cellWidth; wrapMode: Text.WordWrap; color: NewConferenceStyle.titles.textColor; font.weight: NewConferenceStyle.titles.weight; font.pointSize: NewConferenceStyle.titles.pointSize }
Text{textFormat: Text.RichText; text: 'Heure de début'+'<span style="color:red">*</span>'; Layout.preferredWidth: parent.cellWidth; wrapMode: Text.WordWrap; color: NewConferenceStyle.titles.textColor; font.weight: NewConferenceStyle.titles.weight; font.pointSize: NewConferenceStyle.titles.pointSize }
Text{textFormat: Text.RichText; text: 'Durée'; Layout.preferredWidth: parent.cellWidth; wrapMode: Text.WordWrap; color: NewConferenceStyle.titles.textColor; font.weight: NewConferenceStyle.titles.weight; font.pointSize: NewConferenceStyle.titles.pointSize }
Text{textFormat: Text.RichText; text: 'Fuseau horaire'; Layout.preferredWidth: parent.cellWidth; wrapMode: Text.WordWrap; color: NewConferenceStyle.titles.textColor; font.weight: NewConferenceStyle.titles.weight; font.pointSize: NewConferenceStyle.titles.pointSize }
//: 'Date' : Date lebel.
Text{textFormat: Text.RichText; text: qsTr('newConferenceDate')+'<span style="color:red">*</span>'; Layout.preferredWidth: parent.cellWidth; wrapMode: Text.WordWrap; color: NewConferenceStyle.titles.textColor; font.weight: NewConferenceStyle.titles.weight; font.pointSize: NewConferenceStyle.titles.pointSize }
//: 'Time' : Time label.
Text{textFormat: Text.RichText; text: qsTr('newConferenceTimeTitle')+'<span style="color:red">*</span>'; Layout.preferredWidth: parent.cellWidth; wrapMode: Text.WordWrap; color: NewConferenceStyle.titles.textColor; font.weight: NewConferenceStyle.titles.weight; font.pointSize: NewConferenceStyle.titles.pointSize }
//: 'Duration' : Duration label.
Text{textFormat: Text.RichText; text: qsTr('newConferenceDurationTitle'); Layout.preferredWidth: parent.cellWidth; wrapMode: Text.WordWrap; color: NewConferenceStyle.titles.textColor; font.weight: NewConferenceStyle.titles.weight; font.pointSize: NewConferenceStyle.titles.pointSize }
//: 'Timezone' : Timezone label.
Text{textFormat: Text.RichText; text: qsTr('newConferenceTimezoneTitle'); Layout.preferredWidth: parent.cellWidth; wrapMode: Text.WordWrap; color: NewConferenceStyle.titles.textColor; font.weight: NewConferenceStyle.titles.weight; font.pointSize: NewConferenceStyle.titles.pointSize }
TextField{id: dateField; Layout.preferredWidth: parent.cellWidth
color: NewConferenceStyle.fields.textColor; font.weight: NewConferenceStyle.fields.weight; font.pointSize: NewConferenceStyle.fields.pointSize
function getDate(){
@ -320,16 +314,13 @@ DialogPlus {
}
ComboBox{
id: timeZoneField
Layout.preferredWidth: parent.cellWidth;
//color: NewConferenceStyle.fields.textColor; font.weight: NewConferenceStyle.fields.weight; font.pointSize: NewConferenceStyle.fields.pointSize
Layout.preferredWidth: parent.cellWidth;
currentIndex: conferenceManager.conferenceInfoModel ? model.getIndex(conferenceManager.conferenceInfoModel.timeZoneModel) : -1
model: TimeZoneProxyModel{}
onActivated: console.log("activated : " +index)
textRole: "displayText"
selectionWidth: 500
rootItem: conferenceManager
}
//TextField{ text: 'Paris'; readOnly: true; Layout.preferredWidth: parent.cellWidth; color: NewConferenceStyle.fields.textColor; font.weight: NewConferenceStyle.fields.weight; font.pointSize: NewConferenceStyle.fields.pointSize}
function updateDateTime(){
var storedDate
@ -367,7 +358,7 @@ DialogPlus {
Layout.preferredHeight: 20
textFormat: Text.RichText
//: 'Add a description' : Label of a text field about the description of the conference
text : 'Ajouter une description'
text : qsTr('newConferenceDescriptionTitle')
color: NewConferenceStyle.titles.textColor
font.pointSize: NewConferenceStyle.titles.pointSize
font.weight: NewConferenceStyle.titles.weight
@ -377,39 +368,31 @@ DialogPlus {
Layout.fillWidth: true
Layout.fillHeight: true
//: 'Description' : Placeholder in a form about setting a description
placeholderText : 'Description'
placeholderText : qsTr('newConferenceDescriptionPlaceholder')
text: conferenceManager.conferenceInfoModel ? conferenceManager.conferenceInfoModel.description : ''
Keys.onReturnPressed: nextItemInFocusChain().forceActiveFocus()
TooltipArea{
//: 'This description will describe the conference' : Explanation about the description of the conference
text : 'This description will describe the conference'
text : qsTr('newConferenceDescriptionTooltip')
}
}
}
ColumnLayout{
Layout.fillWidth: true
//Layout.preferredHeight: 60
spacing: 5
CheckBoxText {
id: inviteAppAccountCheckBox
text: 'Envoyer l\'invitation via mon compte Linphone'
//: 'Send invite via Linphone' : Label for checkbox for sending invitations with Linphone.
text: qsTr('newConferenceSendLinphoneInviteLabel')
width: parent.width
checked: true
onClicked: {
console.log('Send invite with Linphone account: ' + checked)
}
}
CheckBoxText {
id: inviteEmailCheckBox
visible: false // TODO
text: 'Envoyer l\'invitation via mon adresse mail'
//: 'Send invite via Email' : Label for checkbox for sending invitations with mailer.
text: qsTr('newConferenceSendEmailInviteLabel')
width: parent.width
onClicked: {
console.log('Send invite with email: ' + checked)
}
}
}
}
@ -430,8 +413,6 @@ DialogPlus {
// See and remove selected addresses.
// -------------------------------------------------------------------------
initialItem: ColumnLayout{
//anchors.fill: parent
Rectangle{
Layout.fillHeight: true
Layout.fillWidth: true
@ -546,7 +527,6 @@ DialogPlus {
textFormat: Text.RichText
//: 'Required' : Word relative to a star to explain that it is a requirement (Field form)
text : '<span style="color:red">*</span> '+qsTr('requiredField')
//font.weight: Font.DemiBold
color: NewConferenceStyle.requiredColor
font.pointSize: Units.dp * 8
}

View file

@ -39,7 +39,6 @@ ColumnLayout {
Text {
height: AssistantHomeStyle.info.title.height
Layout.fillWidth: true
//width: parent.width
color: AssistantHomeStyle.info.title.color
elide: Text.ElideRight

View file

@ -38,8 +38,8 @@ Item{
bold: true
pointSize: ConferencesStyle.bar.text.pointSize
}
text: 'Mes conférences'
//: 'Conferences' : Conference list title.
text: qsTr('conferencesTitle')
}
}
Rectangle {
@ -58,21 +58,18 @@ Item{
ExclusiveButtons {
texts: [
'TERMINEES',
'PROGRAMMEES',
'INVITATIONS',
'TEST'
//: 'Finished' : Filter conferences on end status.
qsTr('conferencesEndedFilter'),
//: 'Scheduled' : Filter conferences on scheduled status.
qsTr('conferencesScheduledFilter'),
//: 'Invitations' : Filter conferences on invited conferences (where we are not the organizer).
qsTr('conferencesEndedFilter'),
]
capitalization: Font.AllUppercase
selectedButton: mainItem.filterType
onClicked: {
if(button <= 2)
mainItem.filterType = (button === 0 ? ConferenceInfoProxyModel.Ended : button === 1 ?ConferenceInfoProxyModel.Scheduled : ConferenceInfoProxyModel.Invitations);
else {
window.detachVirtualWindow()
window.attachVirtualWindow(Qt.resolvedUrl('../Calls/VideoConferenceMenu.qml'))
}
//mainItem.filterType = button
}
}
}
@ -184,19 +181,17 @@ Item{
width: parent.width
height: parent.height
conferenceInfoModel: $modelData
//width: calendarGrid.cellWidth
//maxWidth: calendarGrid.cellWidth
gotoButtonMode: mainItem.filterType == ConferenceInfoProxyModel.Scheduled ? 1
: mainItem.filterType == ConferenceInfoProxyModel.Ended ? -1
: 0
onExpandToggle: calendarGrid.expanded = !calendarGrid.expanded
isExpanded: calendarGrid.expanded
onConferenceUriCopied: messageBanner.noticeBannerText = 'Conference URL has been copied'
//: 'Conference URL has been copied' : Message text in a banner to warn the user that the µURL have been copied to the clipboard.
onConferenceUriCopied: messageBanner.noticeBannerText = qsTr('conferencesCopiedURL')
}
}
}
}
}
}
}

Some files were not shown because too many files have changed in this diff Show more