Commit a064407f authored by Ronan Abhamon's avatar Ronan Abhamon

feat(src/components/calls/CallsListModel): call transfer in progress

parent 74e52ac6
...@@ -135,8 +135,8 @@ void CallModel::terminate () { ...@@ -135,8 +135,8 @@ void CallModel::terminate () {
core->unlockVideoRender(); core->unlockVideoRender();
} }
void CallModel::transfer () { void CallModel::askForTransfer () {
// TODO CoreManager::getInstance()->getCallsListModel()->askForTransfer(this);
} }
void CallModel::acceptVideoRequest () { void CallModel::acceptVideoRequest () {
......
...@@ -86,7 +86,7 @@ public: ...@@ -86,7 +86,7 @@ public:
Q_INVOKABLE void accept (); Q_INVOKABLE void accept ();
Q_INVOKABLE void acceptWithVideo (); Q_INVOKABLE void acceptWithVideo ();
Q_INVOKABLE void terminate (); Q_INVOKABLE void terminate ();
Q_INVOKABLE void transfer (); Q_INVOKABLE void askForTransfer ();
Q_INVOKABLE void acceptVideoRequest (); Q_INVOKABLE void acceptVideoRequest ();
Q_INVOKABLE void rejectVideoRequest (); Q_INVOKABLE void rejectVideoRequest ();
......
...@@ -85,6 +85,12 @@ QVariant CallsListModel::data (const QModelIndex &index, int role) const { ...@@ -85,6 +85,12 @@ QVariant CallsListModel::data (const QModelIndex &index, int role) const {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
void CallsListModel::askForTransfer (CallModel *callModel) {
emit callTransferAsked(callModel);
}
// -----------------------------------------------------------------------------
void CallsListModel::launchAudioCall (const QString &sipUri) const { void CallsListModel::launchAudioCall (const QString &sipUri) const {
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore(); shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
shared_ptr<linphone::Address> address = core->interpretUrl(::Utils::qStringToLinphoneString(sipUri)); shared_ptr<linphone::Address> address = core->interpretUrl(::Utils::qStringToLinphoneString(sipUri));
......
...@@ -43,6 +43,8 @@ public: ...@@ -43,6 +43,8 @@ public:
QHash<int, QByteArray> roleNames () const override; QHash<int, QByteArray> roleNames () const override;
QVariant data (const QModelIndex &index, int role = Qt::DisplayRole) const override; QVariant data (const QModelIndex &index, int role = Qt::DisplayRole) const override;
void askForTransfer (CallModel *callModel);
Q_INVOKABLE void launchAudioCall (const QString &sipUri) const; Q_INVOKABLE void launchAudioCall (const QString &sipUri) const;
Q_INVOKABLE void launchVideoCall (const QString &sipUri) const; Q_INVOKABLE void launchVideoCall (const QString &sipUri) const;
...@@ -52,6 +54,7 @@ public: ...@@ -52,6 +54,7 @@ public:
signals: signals:
void callRunning (int index, CallModel *callModel); void callRunning (int index, CallModel *callModel);
void callTransferAsked (CallModel *callModel);
private: private:
bool removeRow (int row, const QModelIndex &parent = QModelIndex()); bool removeRow (int row, const QModelIndex &parent = QModelIndex());
......
...@@ -16,7 +16,7 @@ var MAP_STATUS_TO_PARAMS = (function () { ...@@ -16,7 +16,7 @@ var MAP_STATUS_TO_PARAMS = (function () {
handler: (function () { call.pausedByUser = true }), handler: (function () { call.pausedByUser = true }),
name: qsTr('pauseCall') name: qsTr('pauseCall')
}, { }, {
handler: call.transfer, handler: call.askForTransfer,
name: qsTr('transferCall') name: qsTr('transferCall')
}, { }, {
handler: call.terminate, handler: call.terminate,
...@@ -40,10 +40,10 @@ var MAP_STATUS_TO_PARAMS = (function () { ...@@ -40,10 +40,10 @@ var MAP_STATUS_TO_PARAMS = (function () {
handler: (function () { call.accept() }) handler: (function () { call.accept() })
}, { }, {
name: qsTr('acceptVideoCall'), name: qsTr('acceptVideoCall'),
handler: (function () { call.acceptWithVideo() }) handler: call.acceptWithVideo
}, { }, {
name: qsTr('terminateCall'), name: qsTr('terminateCall'),
handler: (function () { call.terminate() }) handler: call.terminate
}], }],
component: callActions, component: callActions,
string: 'incoming' string: 'incoming'
...@@ -53,7 +53,7 @@ var MAP_STATUS_TO_PARAMS = (function () { ...@@ -53,7 +53,7 @@ var MAP_STATUS_TO_PARAMS = (function () {
map[CallModel.CallStatusOutgoing] = (function (call) { map[CallModel.CallStatusOutgoing] = (function (call) {
return { return {
component: callAction, component: callAction,
handler: (function () { call.terminate() }), handler: call.terminate,
icon: 'hangup', icon: 'hangup',
string: 'outgoing' string: 'outgoing'
} }
...@@ -68,10 +68,10 @@ var MAP_STATUS_TO_PARAMS = (function () { ...@@ -68,10 +68,10 @@ var MAP_STATUS_TO_PARAMS = (function () {
handler: (function () { call.pausedByUser = true }), handler: (function () { call.pausedByUser = true }),
name: qsTr('pauseCall') name: qsTr('pauseCall')
}), { }), {
handler: (function () { call.transfer() }), handler: call.askForTransfer,
name: qsTr('transferCall') name: qsTr('transferCall')
}, { }, {
handler: (function () { call.terminate() }), handler: call.terminate,
name: qsTr('terminateCall') name: qsTr('terminateCall')
}], }],
component: callActions, component: callActions,
......
...@@ -67,3 +67,9 @@ function getContent () { ...@@ -67,3 +67,9 @@ function getContent () {
return incall return incall
} }
// -----------------------------------------------------------------------------
function handleCallTransferAsked (call) {
console.log('TODO: handle call transfer')
}
...@@ -205,4 +205,13 @@ Window { ...@@ -205,4 +205,13 @@ Window {
} }
} }
} }
// ---------------------------------------------------------------------------
// Handle transfer.
// ---------------------------------------------------------------------------
Connections {
target: CallsListModel
onCallTransferAsked: Logic.handleCallTransferAsked(callModel)
}
} }
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