Skip to content
Snippets Groups Projects
Commit ef776637 authored by Albert  Babí Oller's avatar Albert Babí Oller Committed by Albert Babí Oller
Browse files

callview: add hangup to context menu and icon change

- during a call context menu shows "hangup" and hides "clear", "remove", "block" and "start call"
- change start call and record call (context menu) icons

Gitlab: #104

Change-Id: I6c213b525fa6cd9d8063aae0065614c94d9e2209
parent d057fa1b
No related branches found
No related tags found
No related merge requests found
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M12 15c1.66 0 2.99-1.34 2.99-3L15 6c0-1.66-1.34-3-3-3S9 4.34 9 6v6c0 1.66 1.34 3 3 3zm6.08-3c-.42 0-.77.3-.83.71-.37 2.61-2.72 4.39-5.25 4.39s-4.88-1.77-5.25-4.39c-.06-.41-.42-.71-.83-.71-.52 0-.92.46-.85.97.46 2.97 2.96 5.3 5.93 5.75V21c0 .55.45 1 1 1s1-.45 1-1v-2.28c2.96-.43 5.47-2.78 5.93-5.75.07-.51-.33-.97-.85-.97z"/></svg>
\ No newline at end of file
...@@ -119,6 +119,8 @@ ...@@ -119,6 +119,8 @@
<file>images/icons/person_add-24px.svg</file> <file>images/icons/person_add-24px.svg</file>
<file>images/icons/router-24px.svg</file> <file>images/icons/router-24px.svg</file>
<file>images/icons/insert_drive_file-24dp.svg</file> <file>images/icons/insert_drive_file-24dp.svg</file>
<file>images/icons/arrow_back-white-24dp.svg</file> <file>images/icons/arrow_back-white-24dp.svg</file>
<file>images/icons/keyboard_voice-24px.svg</file>
<file>images/icons/videocam-24px.svg</file>
</qresource> </qresource>
</RCC> </RCC>
...@@ -67,7 +67,7 @@ Item { ...@@ -67,7 +67,7 @@ Item {
if (!isAudioOnly && !isPaused) { if (!isAudioOnly && !isPaused) {
ContextMenuGenerator.addMenuItem(isRecording ? JamiStrings.stopRec : ContextMenuGenerator.addMenuItem(isRecording ? JamiStrings.stopRec :
JamiStrings.startRec, JamiStrings.startRec,
"qrc:/images/icons/ic_video_call_24px.svg", "qrc:/images/icons/keyboard_voice-24px.svg",
function (){ function (){
CallAdapter.recordThisCallToggle() CallAdapter.recordThisCallToggle()
}) })
......
...@@ -33,43 +33,57 @@ Item { ...@@ -33,43 +33,57 @@ Item {
property string responsibleConvUid: "" property string responsibleConvUid: ""
property int contactType: Profile.Type.INVALID property int contactType: Profile.Type.INVALID
function openMenu(){ function openMenu() {
ContextMenuGenerator.addMenuItem(qsTr("Start video call"), var hasCall = UtilsAdapter.getCallId(responsibleAccountId, responsibleConvUid) !== ""
"qrc:/images/icons/ic_video_call_24px.svg", if (!hasCall) {
function (){ ContextMenuGenerator.addMenuItem(qsTr("Start video call"),
ConversationsAdapter.selectConversation( "qrc:/images/icons/videocam-24px.svg",
responsibleAccountId, function (){
responsibleConvUid, false) ConversationsAdapter.selectConversation(
CallAdapter.placeCall() responsibleAccountId,
}) responsibleConvUid, false)
ContextMenuGenerator.addMenuItem(qsTr("Start audio call"), CallAdapter.placeCall()
"qrc:/images/icons/ic_phone_24px.svg", })
function (){ ContextMenuGenerator.addMenuItem(qsTr("Start audio call"),
ConversationsAdapter.selectConversation( "qrc:/images/icons/ic_phone_24px.svg",
responsibleAccountId, function (){
responsibleConvUid, false) ConversationsAdapter.selectConversation(
CallAdapter.placeAudioOnlyCall() responsibleAccountId,
}) responsibleConvUid, false)
ContextMenuGenerator.addMenuItem(qsTr("Clear conversation"), CallAdapter.placeAudioOnlyCall()
"qrc:/images/icons/ic_clear_24px.svg", })
function (){
UtilsAdapter.clearConversationHistory(
responsibleAccountId,
responsibleConvUid)
})
if (contactType === Profile.Type.RING || contactType === Profile.Type.SIP) { ContextMenuGenerator.addMenuItem(qsTr("Clear conversation"),
ContextMenuGenerator.addMenuItem(qsTr("Remove contact"), "qrc:/images/icons/ic_clear_24px.svg",
"qrc:/images/icons/round-remove_circle-24px.svg",
function (){ function (){
UtilsAdapter.removeConversation( UtilsAdapter.clearConversationHistory(
responsibleAccountId, responsibleAccountId,
responsibleConvUid) responsibleConvUid)
}) })
if (contactType === Profile.Type.RING || contactType === Profile.Type.SIP) {
ContextMenuGenerator.addMenuItem(qsTr("Remove contact"),
"qrc:/images/icons/round-remove_circle-24px.svg",
function (){
UtilsAdapter.removeConversation(
responsibleAccountId,
responsibleConvUid)
})
}
} else {
ContextMenuGenerator.addMenuItem(qsTr("Hang up call"),
"qrc:/images/icons/ic_call_end_white_24px.svg",
function (){
CallAdapter.hangUpACall(responsibleAccountId,
responsibleConvUid)
})
} }
if (contactType === Profile.Type.RING || contactType === Profile.Type.PENDING) { if ((contactType === Profile.Type.RING || contactType === Profile.Type.PENDING)) {
ContextMenuGenerator.addMenuSeparator() if (contactType === Profile.Type.PENDING || !hasCall) {
ContextMenuGenerator.addMenuSeparator()
}
if (contactType === Profile.Type.PENDING) { if (contactType === Profile.Type.PENDING) {
ContextMenuGenerator.addMenuItem(JamiStrings.acceptContactRequest, ContextMenuGenerator.addMenuItem(JamiStrings.acceptContactRequest,
...@@ -85,13 +99,14 @@ Item { ...@@ -85,13 +99,14 @@ Item {
responsibleConvUid) responsibleConvUid)
}) })
} }
ContextMenuGenerator.addMenuItem(qsTr("Block contact"), if (!hasCall) {
"qrc:/images/icons/ic_block_24px.svg", ContextMenuGenerator.addMenuItem(qsTr("Block contact"),
function (){ "qrc:/images/icons/ic_block_24px.svg",
MessagesAdapter.blockConversation( function (){
responsibleConvUid) MessagesAdapter.blockConversation(
}) responsibleConvUid)
})
}
ContextMenuGenerator.addMenuSeparator() ContextMenuGenerator.addMenuSeparator()
ContextMenuGenerator.addMenuItem(qsTr("Profile"), ContextMenuGenerator.addMenuItem(qsTr("Profile"),
"qrc:/images/icons/person-24px.svg", "qrc:/images/icons/person-24px.svg",
......
...@@ -165,7 +165,7 @@ Rectangle { ...@@ -165,7 +165,7 @@ Rectangle {
width: buttonPreferredSize width: buttonPreferredSize
radius: 30 radius: 30
source: "qrc:/images/icons/ic_video_call_24px.svg" source: "qrc:/images/icons/videocam-24px.svg"
backgroundColor: "white" backgroundColor: "white"
onExitColor: "white" onExitColor: "white"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment