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