diff --git a/images/icons/keyboard_voice-24px.svg b/images/icons/keyboard_voice-24px.svg new file mode 100644 index 00000000..28f52038 --- /dev/null +++ b/images/icons/keyboard_voice-24px.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/resources.qrc b/resources.qrc index 0ea0cf0b..07c63cf8 100644 --- a/resources.qrc +++ b/resources.qrc @@ -119,6 +119,8 @@ images/icons/person_add-24px.svg images/icons/router-24px.svg images/icons/insert_drive_file-24dp.svg - images/icons/arrow_back-white-24dp.svg + images/icons/arrow_back-white-24dp.svg + images/icons/keyboard_voice-24px.svg + images/icons/videocam-24px.svg diff --git a/src/mainview/components/CallViewContextMenu.qml b/src/mainview/components/CallViewContextMenu.qml index 9cb217c1..bdd61922 100644 --- a/src/mainview/components/CallViewContextMenu.qml +++ b/src/mainview/components/CallViewContextMenu.qml @@ -67,7 +67,7 @@ Item { if (!isAudioOnly && !isPaused) { ContextMenuGenerator.addMenuItem(isRecording ? JamiStrings.stopRec : JamiStrings.startRec, - "qrc:/images/icons/ic_video_call_24px.svg", + "qrc:/images/icons/keyboard_voice-24px.svg", function (){ CallAdapter.recordThisCallToggle() }) diff --git a/src/mainview/components/ConversationSmartListContextMenu.qml b/src/mainview/components/ConversationSmartListContextMenu.qml index 1b26cf1b..b9b8def9 100644 --- a/src/mainview/components/ConversationSmartListContextMenu.qml +++ b/src/mainview/components/ConversationSmartListContextMenu.qml @@ -33,43 +33,57 @@ Item { property string responsibleConvUid: "" property int contactType: Profile.Type.INVALID - function openMenu(){ - ContextMenuGenerator.addMenuItem(qsTr("Start video call"), - "qrc:/images/icons/ic_video_call_24px.svg", - function (){ - ConversationsAdapter.selectConversation( - responsibleAccountId, - responsibleConvUid, false) - CallAdapter.placeCall() - }) - ContextMenuGenerator.addMenuItem(qsTr("Start audio call"), - "qrc:/images/icons/ic_phone_24px.svg", - function (){ - ConversationsAdapter.selectConversation( - responsibleAccountId, - responsibleConvUid, false) - CallAdapter.placeAudioOnlyCall() - }) - ContextMenuGenerator.addMenuItem(qsTr("Clear conversation"), - "qrc:/images/icons/ic_clear_24px.svg", - function (){ - UtilsAdapter.clearConversationHistory( - responsibleAccountId, - responsibleConvUid) - }) - - if (contactType === Profile.Type.RING || contactType === Profile.Type.SIP) { - ContextMenuGenerator.addMenuItem(qsTr("Remove contact"), - "qrc:/images/icons/round-remove_circle-24px.svg", + function openMenu() { + var hasCall = UtilsAdapter.getCallId(responsibleAccountId, responsibleConvUid) !== "" + if (!hasCall) { + ContextMenuGenerator.addMenuItem(qsTr("Start video call"), + "qrc:/images/icons/videocam-24px.svg", function (){ - UtilsAdapter.removeConversation( + ConversationsAdapter.selectConversation( + responsibleAccountId, + responsibleConvUid, false) + CallAdapter.placeCall() + }) + ContextMenuGenerator.addMenuItem(qsTr("Start audio call"), + "qrc:/images/icons/ic_phone_24px.svg", + function (){ + ConversationsAdapter.selectConversation( + responsibleAccountId, + responsibleConvUid, false) + CallAdapter.placeAudioOnlyCall() + }) + + ContextMenuGenerator.addMenuItem(qsTr("Clear conversation"), + "qrc:/images/icons/ic_clear_24px.svg", + function (){ + UtilsAdapter.clearConversationHistory( responsibleAccountId, 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) { - ContextMenuGenerator.addMenuSeparator() + if ((contactType === Profile.Type.RING || contactType === Profile.Type.PENDING)) { + if (contactType === Profile.Type.PENDING || !hasCall) { + ContextMenuGenerator.addMenuSeparator() + } if (contactType === Profile.Type.PENDING) { ContextMenuGenerator.addMenuItem(JamiStrings.acceptContactRequest, @@ -85,13 +99,14 @@ Item { responsibleConvUid) }) } - ContextMenuGenerator.addMenuItem(qsTr("Block contact"), - "qrc:/images/icons/ic_block_24px.svg", - function (){ - MessagesAdapter.blockConversation( - responsibleConvUid) - }) - + if (!hasCall) { + ContextMenuGenerator.addMenuItem(qsTr("Block contact"), + "qrc:/images/icons/ic_block_24px.svg", + function (){ + MessagesAdapter.blockConversation( + responsibleConvUid) + }) + } ContextMenuGenerator.addMenuSeparator() ContextMenuGenerator.addMenuItem(qsTr("Profile"), "qrc:/images/icons/person-24px.svg", diff --git a/src/mainview/components/MessageWebViewHeader.qml b/src/mainview/components/MessageWebViewHeader.qml index a54f10c9..9f19a369 100644 --- a/src/mainview/components/MessageWebViewHeader.qml +++ b/src/mainview/components/MessageWebViewHeader.qml @@ -165,7 +165,7 @@ Rectangle { width: buttonPreferredSize radius: 30 - source: "qrc:/images/icons/ic_video_call_24px.svg" + source: "qrc:/images/icons/videocam-24px.svg" backgroundColor: "white" onExitColor: "white"