Commit 853d46f1 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(ui/views/App/Calls/ConferenceManager): in progress

parent ec2916f5
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include "../../Utils.hpp" #include "../../Utils.hpp"
#include "../core/CoreManager.hpp" #include "../core/CoreManager.hpp"
#include "ConferenceHelperModel.hpp"
#include "ConferenceModel.hpp" #include "ConferenceModel.hpp"
...@@ -32,28 +31,13 @@ using namespace std; ...@@ -32,28 +31,13 @@ using namespace std;
// ============================================================================= // =============================================================================
ConferenceModel::ConferenceModel (QObject *parent) : QAbstractListModel(parent) {} ConferenceModel::ConferenceModel (QObject *parent) : QSortFilterProxyModel(parent) {}
int ConferenceModel::rowCount (const QModelIndex &index) const { bool ConferenceModel::filterAcceptsRow (int sourceRow, const QModelIndex &sourceParent) const {
return mSipAddresses.count(); const QModelIndex &index = sourceModel()->index(sourceRow, 0, sourceParent);
} const CallModel *callModel = index.data().value<CallModel *>();
QHash<int, QByteArray> ConferenceModel::roleNames () const {
QHash<int, QByteArray> roles;
roles[Qt::DisplayRole] = "$sipAddress";
return roles;
}
QVariant ConferenceModel::data (const QModelIndex &index, int role) const {
int row = index.row();
if (!index.isValid() || row < 0 || row >= mSipAddresses.count())
return QVariant();
if (role == Qt::DisplayRole)
return mSipAddresses[row];
return QVariant(); return callModel->getCall()->getParams()->getLocalConferenceMode();
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
......
...@@ -23,11 +23,13 @@ ...@@ -23,11 +23,13 @@
#ifndef CONFERENCE_MODEL_H_ #ifndef CONFERENCE_MODEL_H_
#define CONFERENCE_MODEL_H_ #define CONFERENCE_MODEL_H_
#include <QAbstractListModel> #include <QSortFilterProxyModel>
// ============================================================================= // =============================================================================
class ConferenceModel : public QAbstractListModel { class CallModel;
class ConferenceModel : public QSortFilterProxyModel {
Q_OBJECT; Q_OBJECT;
Q_PROPERTY(bool microMuted READ getMicroMuted WRITE setMicroMuted NOTIFY microMutedChanged); Q_PROPERTY(bool microMuted READ getMicroMuted WRITE setMicroMuted NOTIFY microMutedChanged);
...@@ -38,10 +40,8 @@ public: ...@@ -38,10 +40,8 @@ public:
ConferenceModel (QObject *parent = Q_NULLPTR); ConferenceModel (QObject *parent = Q_NULLPTR);
~ConferenceModel () = default; ~ConferenceModel () = default;
int rowCount (const QModelIndex &index = QModelIndex()) const override; protected:
bool filterAcceptsRow (int sourceRow, const QModelIndex &sourceParent) const override;
QHash<int, QByteArray> roleNames () const override;
QVariant data (const QModelIndex &index, int role = Qt::DisplayRole) const override;
Q_INVOKABLE void terminate (); Q_INVOKABLE void terminate ();
...@@ -59,8 +59,6 @@ private: ...@@ -59,8 +59,6 @@ private:
bool getRecording () const; bool getRecording () const;
bool mRecording = false; bool mRecording = false;
QStringList mSipAddresses;
}; };
#endif // CONFERENCE_MODEL_H_ #endif // CONFERENCE_MODEL_H_
...@@ -11,15 +11,13 @@ import App.Styles 1.0 ...@@ -11,15 +11,13 @@ import App.Styles 1.0
// ============================================================================= // =============================================================================
Rectangle { Rectangle {
property var call: null // TODO: Remove me
color: CallStyle.backgroundColor color: CallStyle.backgroundColor
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
ConferenceModel { ConferenceModel {
id: conference id: conference
} }
ColumnLayout { ColumnLayout {
anchors { anchors {
...@@ -30,7 +28,7 @@ Rectangle { ...@@ -30,7 +28,7 @@ Rectangle {
spacing: 0 spacing: 0
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
// Call info. // Conference info.
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
Item { Item {
...@@ -53,7 +51,14 @@ Rectangle { ...@@ -53,7 +51,14 @@ Rectangle {
anchors.centerIn: parent anchors.centerIn: parent
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
text: qsTr('conferenceTitle') text: qsTr('conferenceTitle')
color: CallStyle.header.conferenceDescription.color
font {
bold: true
pointSize: CallStyle.header.conferenceDescription.fontSize
}
height: parent.height height: parent.height
width: parent.width - rightActions.width - leftActions.width - CallStyle.header.conferenceDescription.width width: parent.width - rightActions.width - leftActions.width - CallStyle.header.conferenceDescription.width
...@@ -75,30 +80,12 @@ Rectangle { ...@@ -75,30 +80,12 @@ Rectangle {
useStates: false useStates: false
onClicked: !enabled onClicked: !enabled
? conference.startRecording() ? conference.startRecording()
: conference.stopRecording() : conference.stopRecording()
} }
} }
} }
Text {
id: elapsedTime
Layout.fillWidth: true
color: CallStyle.header.elapsedTime.color
font.pointSize: CallStyle.header.elapsedTime.fontSize
horizontalAlignment: Text.AlignHCenter
Timer {
interval: 1000
repeat: true
running: true
triggeredOnStart: true
onTriggered: elapsedTime.text = Utils.formatElapsedTime(conference.duration)
}
}
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
// Contacts visual. // Contacts visual.
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
...@@ -153,32 +140,6 @@ Rectangle { ...@@ -153,32 +140,6 @@ Rectangle {
onClicked: conference.microMuted = enabled onClicked: conference.microMuted = enabled
} }
} }
Row {
spacing: CallStyle.actionArea.vu.spacing
VuMeter {
Timer {
interval: 50
repeat: true
running: speaker.enabled
onTriggered: parent.value = conference.speakerVu
}
enabled: speaker.enabled
}
ActionSwitch {
id: speaker
enabled: true
icon: 'speaker'
iconSize: CallStyle.actionArea.iconSize
onClicked: console.log('TODO')
}
}
} }
ActionBar { ActionBar {
......
...@@ -66,6 +66,13 @@ QtObject { ...@@ -66,6 +66,13 @@ QtObject {
property int width: 150 property int width: 150
} }
property QtObject conferenceDescription: QtObject {
property color color: Colors.x
property int fontSize: 12
property int height: 60
property int width: 150
}
property QtObject elapsedTime: QtObject { property QtObject elapsedTime: QtObject {
property color color: Colors.j property color color: Colors.j
property int fontSize: 10 property int fontSize: 10
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment